#include <OP_PostIt.h>

Public Member Functions | |
| OP_PostIt (const UT_String &name, OP_Network *net) | |
| virtual | ~OP_PostIt () |
| virtual void | setXY (fpreal x, fpreal y) |
| virtual fpreal | getX () const |
| virtual fpreal | getY () const |
| virtual fpreal | getW () const |
| virtual fpreal | getH () const |
| fpreal | getMaximizedW () const |
| fpreal | getMaximizedH () const |
| bool | setXYWithBoundsChecks (fpreal x, fpreal y) |
| bool | setWWithBoundsChecks (fpreal h) |
| bool | setHWithBoundsChecks (fpreal h) |
| virtual const OP_PostItNoteFlags & | flags () const |
| virtual OP_PostItNoteFlags & | flags () |
| virtual int | getPicked () const |
| Returns true if this box is currently picked. | |
| virtual int | setPicked (int on_off, bool propagate_parent_event=true) |
| int | getUniqueId () const |
| bool | setName (const UT_String &name) |
| virtual const UT_String & | getItemName () const |
| bool | setText (const UT_String &text) |
| virtual const UT_String & | getText () const |
| virtual OP_ItemType | getItemType () const |
| Our children should implement this and return what type of item they are. | |
| virtual OP_Network * | getParentNetwork () const |
| Returns the network that is our parent. | |
| void | setW (fpreal w, bool force=false) |
| void | setH (fpreal h, bool force=false) |
| void | getItemBounds (fpreal &x1, fpreal &y1, fpreal &x2, fpreal &y2, bool incl_buff_border=true) const |
| void | setResizing (bool resizing) |
| bool | getResizing () |
| void | setXY (fpreal x, fpreal y, bool force, bool propagate_parent_event) |
| virtual bool | setColor (const UT_Color &color) |
| virtual const UT_Color * | getColor () const |
| const char * | getType (void) const |
| virtual OP_ERROR | save (ostream &os, const OP_SaveFlags &sflags, const char *path_prefix) |
| virtual OP_ERROR | saveIntrinsic (ostream &os, const OP_SaveFlags &sflags) |
| virtual bool | load (UT_IStream &is, const char *ext="", const char *path=0) |
| void | getFullPath (UT_String &str) const |
| bool | getMinimized () const |
| Get whether this box is currently minimized. | |
| bool | setMinimized (bool isminimized, bool update_position, bool propagate_parent_event) |
| int | saveCommand (ostream &os) const |
Static Public Member Functions | |
| static OP_PostIt * | lookupPostItNote (int unique_id) |
| static void | clearAllPendingUndoFlags (void) |
Friends | |
| class | OP_Network |
Definition at line 47 of file OP_PostIt.h.
| OP_PostIt::OP_PostIt | ( | const UT_String & | name, | |
| OP_Network * | net | |||
| ) |
Create a network box with the specified name. If a duplicate name is passed in, it will be altered to make it unique in the network.
| virtual OP_PostIt::~OP_PostIt | ( | ) | [virtual] |
| static void OP_PostIt::clearAllPendingUndoFlags | ( | void | ) | [static] |
| virtual OP_PostItNoteFlags& OP_PostIt::flags | ( | ) | [inline, virtual] |
| virtual const OP_PostItNoteFlags& OP_PostIt::flags | ( | ) | const [inline, virtual] |
| virtual const UT_Color* OP_PostIt::getColor | ( | void | ) | const [inline, virtual] |
| void OP_PostIt::getFullPath | ( | UT_String & | str | ) | const |
| virtual fpreal OP_PostIt::getH | ( | ) | const [virtual] |
Implements OP_NetworkBoxItem.
| void OP_PostIt::getItemBounds | ( | fpreal & | x1, | |
| fpreal & | y1, | |||
| fpreal & | x2, | |||
| fpreal & | y2, | |||
| bool | incl_buff_border = true | |||
| ) | const |
Calculate the smallest bounds we're willing to accept as our size given our contents. By default, 'incl_buff_border' is set to add a small buffer border to make the layout look pretty. NOTE: If we contain no items, we return an inverted bounding box, see implementation for further details.
| virtual const UT_String& OP_PostIt::getItemName | ( | ) | const [inline, virtual] |
Basically the same as OP_Node::getName(), but abstracted to a higher level so we can call it on all items.
Implements OP_NetworkBoxItem.
Definition at line 92 of file OP_PostIt.h.
| virtual OP_ItemType OP_PostIt::getItemType | ( | ) | const [virtual] |
Our children should implement this and return what type of item they are.
Implements OP_NetworkBoxItem.
| fpreal OP_PostIt::getMaximizedH | ( | ) | const |
| fpreal OP_PostIt::getMaximizedW | ( | ) | const |
| bool OP_PostIt::getMinimized | ( | ) | const |
Get whether this box is currently minimized.
| virtual OP_Network* OP_PostIt::getParentNetwork | ( | ) | const [virtual] |
| virtual int OP_PostIt::getPicked | ( | ) | const [virtual] |
| bool OP_PostIt::getResizing | ( | ) |
| virtual const UT_String& OP_PostIt::getText | ( | ) | const [inline, virtual] |
Definition at line 95 of file OP_PostIt.h.
| const char* OP_PostIt::getType | ( | void | ) | const |
| int OP_PostIt::getUniqueId | ( | ) | const [inline] |
Definition at line 85 of file OP_PostIt.h.
| virtual fpreal OP_PostIt::getW | ( | ) | const [virtual] |
Implements OP_NetworkBoxItem.
| virtual fpreal OP_PostIt::getX | ( | ) | const [virtual] |
Implements OP_NetworkBoxItem.
| virtual fpreal OP_PostIt::getY | ( | ) | const [virtual] |
Implements OP_NetworkBoxItem.
| virtual bool OP_PostIt::load | ( | UT_IStream & | is, | |
| const char * | ext = "", |
|||
| const char * | path = 0 | |||
| ) | [virtual] |
Load the contents of the stream into the attributes of this post-it note; if binary is nonzero, load in binary mode. Loading doesn't send the OP_POSTIT_NOTE_CREATED message to the network; the caller is responsible for doing that.
| static OP_PostIt* OP_PostIt::lookupPostItNote | ( | int | unique_id | ) | [static] |
Each netbox has a unique id. This is used primarily for undos, as we also keep a list of notes in order of id, so lookup by id becomes quite quick.
| virtual OP_ERROR OP_PostIt::save | ( | ostream & | os, | |
| const OP_SaveFlags & | sflags, | |||
| const char * | path_prefix | |||
| ) | [virtual] |
| int OP_PostIt::saveCommand | ( | ostream & | os | ) | const |
Used by opscript, this outputs the sequence of hscript commands necessary to recreate this sticky note.
| virtual OP_ERROR OP_PostIt::saveIntrinsic | ( | ostream & | os, | |
| const OP_SaveFlags & | sflags | |||
| ) | [virtual] |
| virtual bool OP_PostIt::setColor | ( | const UT_Color & | color | ) | [virtual] |
The colour used to display our background. Returns true if the color changed.
Reimplemented from OP_NetworkBoxItem.
| void OP_PostIt::setH | ( | fpreal | h, | |
| bool | force = false | |||
| ) |
| bool OP_PostIt::setHWithBoundsChecks | ( | fpreal | h | ) |
| bool OP_PostIt::setMinimized | ( | bool | isminimized, | |
| bool | update_position, | |||
| bool | propagate_parent_event | |||
| ) |
Set whether this box is currently minimized If update_position is true, then the box is moved to accomodate the minimized status. If propagate_parent_event is true, an event is sent to the network about our minimized state.
| bool OP_PostIt::setName | ( | const UT_String & | name | ) |
The name which is used for identification and in displays of this box. setName() returns true if the name change was successful, and alters the name slightly if necessary to make it unique within this network.
| virtual int OP_PostIt::setPicked | ( | int | on_off, | |
| bool | propagate_parent_event = true | |||
| ) | [virtual] |
Set whether this box is picked; returns true if the picked status has changed.
Implements OP_NetworkBoxItem.
| void OP_PostIt::setResizing | ( | bool | resizing | ) |
ALWAYS call this with 'resizing' == true before you do any resizing operations (e.g. setW()), and call it after you're done resizing with 'resizing' == false. You should only do this once for each group of resizing operations on the same netbox.
This method: 1) ensures we get a proper undo block around all the resize ops, and 2) allows you to use setXY() to stretch the box to the left (otherwise, setXY() just moves the box)
| bool OP_PostIt::setText | ( | const UT_String & | text | ) |
| void OP_PostIt::setW | ( | fpreal | w, | |
| bool | force = false | |||
| ) |
Get and set the width and height of this box. Units are absolute as opposed to the relative units found in OPUI. If the width or height specified is smaller than that which will contain all of the items, the width or height respectively will only be adjusted to the minimum size required to contain the items. To avoid this automatic size check, set 'force' to true.
| bool OP_PostIt::setWWithBoundsChecks | ( | fpreal | h | ) |
Same as setXY(), but here we can force the box to take on these X/Y coordinates, even if our contents don't fit us any more. The propagate_parent_event tells this method whether or not it should send and event after moving the network box -- this should normally be set to true.
Get and set the position of this item. Units are absolute, as opposed to relative units found in OPUI.
Implements OP_NetworkBoxItem.
friend class OP_Network [friend] |
Definition at line 204 of file OP_PostIt.h.
1.5.9