kig
construct_mode.cc
Go to the documentation of this file.
48 static void redefinePoint( ObjectTypeCalcer* mpt, const Coordinate& c, KigDocument& doc, const KigWidget& w )
157 // mcursor = ObjectFactory::instance()->sensiblePointCalcer( w.fromScreen( p ), mdoc.document(), w );
179 void BaseConstructMode::rightClicked( const std::vector<ObjectHolder*>&, const QPoint&, KigWidget& )
223 bool calcnow = ( goodargs.size() == 1 ) || ( ( goodargs.size() > 0 ) && ( goodargs.front()->imp()->inherits( PointImp::stype() ) ) );
303 mdoc.emitStatusBarText( i18n( "Click the location where you want to place the new point, or the curve that you want to attach it to..." ) );
388 void ConstructMode::handlePrelim( const std::vector<ObjectCalcer*>& args, const QPoint& p, KigPainter& pter, KigWidget& w )
406 int ConstructMode::wantArgs( const std::vector<ObjectCalcer*>& os, KigDocument& d, KigWidget& w )
428 void TestConstructMode::handlePrelim( const std::vector<ObjectCalcer*>& os, const QPoint& p, KigPainter& pter, KigWidget& w )
472 int TestConstructMode::wantArgs( const std::vector<ObjectCalcer*>& os, KigDocument&, KigWidget& )
534 void TestConstructMode::rightClicked( const std::vector<ObjectHolder*>& oco, const QPoint& p, KigWidget& w )
543 void TestConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const QPoint& p, KigWidget& w, bool shiftPressed )
554 TextImp ti( static_cast<const TestResultImp*>( mresult->imp() )->data(), loc, test_has_frame_dflt );
565 QString ConstructMode::selectStatement( const std::vector<ObjectCalcer*>& args, const KigWidget& w )
570 QString TestConstructMode::selectStatement( const std::vector<ObjectCalcer*>& sel, const KigWidget& )
virtual void handleArgs(const std::vector< ObjectCalcer * > &args, KigWidget &w)=0
void midClicked(const QPoint &p, KigWidget &w)
Definition: construct_mode.cc:163
void handleArgs(const std::vector< ObjectCalcer * > &args, KigWidget &w)
Definition: construct_mode.cc:477
void move(const Coordinate &to, const KigDocument &doc)
This is the method that does the real moving work.
Definition: object_calcer.cc:296
bool inherits(const ObjectImpType *t) const
Returns true if this ObjectImp inherits the ObjectImp type represented by t.
Definition: object_imp.cc:279
Definition: construct_mode.h:58
void handleArgs(const std::vector< ObjectCalcer * > &args, KigWidget &w)
Definition: construct_mode.cc:460
void redrawScreen(KigWidget *)
Redraw the document on KigWidget w .
Definition: construct_mode.cc:581
void setCursor(const QCursor &)
This is a convenience subclass of ObjectType that a type should inherit from if its parents can be sp...
Definition: object_type.h:113
void mouseMoved(const std::vector< ObjectHolder * > &os, const QPoint &p, KigWidget &w, bool shiftpressed)
Definition: construct_mode.cc:331
QString selectStatement(const std::vector< ObjectCalcer * > &args, const KigWidget &w)
Definition: construct_mode.cc:570
virtual Coordinate snapToGrid(const Coordinate &c, const KigWidget &w) const =0
virtual void handlePrelim(const std::vector< ObjectCalcer * > &os, const QPoint &p, KigPainter &, KigWidget &w)=0
This is an ObjectCalcer that keeps an ObjectImp, and never calculates a new one.
Definition: object_calcer.h:232
void mouseMoved(const std::vector< ObjectHolder * > &os, const QPoint &p, KigWidget &w, bool shiftpressed)
Definition: construct_mode.cc:184
static void redefinePoint(ObjectTypeCalcer *mpt, const Coordinate &c, KigDocument &doc, const KigWidget &w)
Definition: construct_mode.cc:48
Definition: text_imp.h:26
ObjectTypeCalcer * fixedPointCalcer(const Coordinate &c) const
Definition: object_factory.cc:50
void redrawScreen(KigWidget *)
Redraw the document on KigWidget w .
Definition: construct_mode.cc:586
virtual QString selectStatement(const std::vector< ObjectCalcer * > &sel, const KigDocument &d, const KigWidget &w) const =0
return a string describing what argument you want next, if the given selection of objects were select...
PointConstructMode(KigPart &d)
Definition: construct_mode.cc:293
void draw(const ObjectImp &imp, KigPainter &p, bool selected) const
Draw the object imp on kigpainter p .
Definition: object_drawer.cc:29
Definition: argsparser.h:112
static int getObjectFromList(const QPoint &p, KigWidget *w, const std::vector< ObjectHolder * > &objs, bool givepopup=true)
Get the index of the chosen object from a list of objects.
Definition: objectchooserpopup.cc:26
ConstructMode(KigPart &d, const ObjectConstructor *ctor)
Definition: construct_mode.cc:416
void rightClicked(const std::vector< ObjectHolder * > &oco, const QPoint &p, KigWidget &w)
Definition: construct_mode.cc:325
void finishObjectGroup()
Draws the current group of objects and add them as a whole to the Undo history.
Definition: kig_part.cpp:571
The BaseMode is a particular mode that allows an easy mapping of the mouse actions to real...
Definition: base_mode.h:33
This is an ObjectCalcer that uses one of the various ObjectType's to calculate its ObjectImp...
Definition: object_calcer.h:183
void enableActions()
actions: we enable the actions we want when our mode is made active.
Definition: construct_mode.cc:366
virtual void handlePrelim(KigPainter &p, const std::vector< ObjectCalcer * > &sel, const KigDocument &d, const KigWidget &v) const =0
show a preliminary version of what you would do when handleArgs would be called.
int x() const
virtual ObjectImp * calc(const Args &parents, const KigDocument &d) const =0
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
int isAlreadySelectedOK(const std::vector< ObjectCalcer * > &, const int &)
Definition: construct_mode.cc:466
This class represents a way to construct a set of objects from a set of other objects.
Definition: object_constructor.h:44
const ScreenInfo & screenInfo() const
the part of the document we're currently showing i.e.
Definition: kig_view.cpp:272
TestConstructMode(KigPart &d, const ArgsParserObjectType *type)
Definition: construct_mode.cc:451
void redefinePoint(ObjectTypeCalcer *point, const Coordinate &c, KigDocument &d, const KigWidget &w) const
set point to what sensiblePoint would have returned.
Definition: object_factory.cc:497
int isAlreadySelectedOK(const std::vector< ObjectCalcer * > &, const int &)
Definition: construct_mode.cc:400
void handlePrelim(const std::vector< ObjectCalcer * > &os, const QPoint &p, KigPainter &, KigWidget &w)
Definition: construct_mode.cc:428
An ObjectHolder represents an object as it is known to the document.
Definition: object_holder.h:40
const ObjectImp * imp() const
Returns the ObjectImp of this ObjectCalcer.
Definition: object_calcer.cc:100
An ObjectCalcer is an object that represents an algorithm for calculating an ObjectImp from other Obj...
Definition: object_calcer.h:66
void enableActions()
actions: we enable the actions we want when our mode is made active.
Definition: base_mode.cc:148
void mouseMoved(const std::vector< ObjectHolder * > &os, const QPoint &p, KigWidget &w, bool shiftpressed)
Definition: construct_mode.cc:543
virtual void handleArgs(const std::vector< ObjectCalcer * > &os, KigPart &d, KigWidget &v) const =0
do something fun with os .
virtual void calc(const KigDocument &)=0
Makes the ObjectCalcer recalculate its ObjectImp from its parents.
void selectObject(ObjectHolder *o, KigWidget &w)
Definition: construct_mode.cc:280
void startObjectGroup()
Call this method to start an object group which will be deleted as a whole if the construction is can...
Definition: kig_part.cpp:555
virtual QString useText(const ObjectCalcer &o, const std::vector< ObjectCalcer * > &sel, const KigDocument &d, const KigWidget &v) const =0
return a string describing what you would use o for if it were selected...
int wantArgs(const std::vector< ObjectCalcer * > &, KigDocument &d, KigWidget &w)
Definition: construct_mode.cc:472
void updateCurPix(const std::vector< QRect > &=std::vector< QRect >())
update curPix (bitBlt stillPix onto curPix..)
Definition: kig_view.cpp:187
void leftClickedObject(ObjectHolder *o, const QPoint &p, KigWidget &w, bool ctrlOrShiftDown)
Definition: construct_mode.cc:108
ObjectTypeCalcer * cursorPointCalcer(const Coordinate &c) const
this returns a CursorPointType; this is used during special constructions (e.g.
Definition: object_factory.cc:81
Qt::KeyboardModifiers modifiers() const
virtual int wantArgs(const std::vector< ObjectCalcer * > &os, const KigDocument &d, const KigWidget &v) const =0
can this constructor do something useful with os ? return ArgsParser::Complete, Valid or NotGood ...
void handlePrelim(const std::vector< ObjectCalcer * > &os, const QPoint &p, KigPainter &, KigWidget &w)
Definition: construct_mode.cc:388
virtual bool isAlreadySelectedOK(const std::vector< ObjectCalcer * > &os, const uint &) const =0
the following function is called in case of duplication of arguments and returns true if this is acce...
QString selectStatement(const std::vector< ObjectCalcer * > &args, const KigWidget &w)
Definition: construct_mode.cc:565
A class holding some information about how a certain object is drawn on the window.
Definition: object_drawer.h:47
virtual int wantArgs(const std::vector< ObjectCalcer * > &, KigDocument &d, KigWidget &w)=0
ObjectTypeCalcer * sensiblePointCalcer(const Coordinate &c, const KigDocument &d, const KigWidget &w) const
this returns a "sensible point".
Definition: object_factory.cc:96
QPixmap curPix
temporary, gets bitBlt'd (copied) onto the widget (to avoid flickering)
Definition: kig_view.h:84
std::vector< ObjectCalcer * > getCalcers(const std::vector< ObjectHolder * > &os)
get the calcers that the holders represent ( not their namecalcers )
Definition: common.cc:34
void leftClickedObject(ObjectHolder *o, const QPoint &p, KigWidget &w, bool ctrlOrShiftDown)
Definition: construct_mode.cc:484
static const ObjectImpType * stype()
Returns the ObjectImpType representing PointImp's.
Definition: point_imp.cc:159
virtual QString selectStatement(const std::vector< ObjectCalcer * > &args, const KigWidget &w)=0
void leftClickedObject(ObjectHolder *o, const QPoint &p, KigWidget &w, bool ctrlOrShiftDown)
Definition: construct_mode.cc:310
void updateWidget(const std::vector< QRect > &=std::vector< QRect >())
this means bitBlting curPix on the actual widget...
Definition: kig_view.cpp:115
void enableActions()
actions: we enable the actions we want when our mode is made active.
Definition: construct_mode.cc:353
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
void selectObjects(const std::vector< ObjectHolder * > &os, KigWidget &w)
Definition: construct_mode.cc:378
virtual const ObjectImp * imp() const =0
Returns the ObjectImp of this ObjectCalcer.
void setX(int x)
std::string usetext(const ObjectImp *o, const Args &sel) const
returns the usetext for the argument that o would be used for, if sel were used as parents...
Definition: argsparser.cpp:192
QString fromLatin1(const char *str, int size)
void calc(const KigDocument &doc)
Makes the ObjectCalcer recalculate its ObjectImp from its parents.
Definition: object_calcer.cc:32
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
const QPoint & pos() const
virtual int isAlreadySelectedOK(const std::vector< ObjectCalcer * > &, const int &)=0
const CoordinateSystem & coordinateSystem() const
Definition: kig_document.cc:40
void cancelObjectGroup()
Deletes the current group of objects from the document without adding them to the Undo history...
Definition: kig_part.cpp:564
void redrawScreen(const std::vector< ObjectHolder * > &selection, bool paintOnWidget=true)
Definition: kig_view.cpp:252
void rightClicked(const std::vector< ObjectHolder * > &oco, const QPoint &p, KigWidget &w)
Definition: construct_mode.cc:179
Definition: bogus_imp.h:253
void midClicked(const QPoint &p, KigWidget &w)
Definition: construct_mode.cc:525
int wantArgs(const std::vector< ObjectCalcer * > &, KigDocument &d, KigWidget &w)
Definition: construct_mode.cc:406
void rightClicked(const std::vector< ObjectHolder * > &oco, const QPoint &p, KigWidget &w)
Definition: construct_mode.cc:534
void midClicked(const QPoint &p, KigWidget &w)
Definition: construct_mode.cc:320
void drawTextStd(const QPoint &p, const QString &s)
draws text in a standard manner, convenience function...
Definition: kigpainter.cpp:531
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.