HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UNI_StickyNote.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UNI_StickyNote.h ( UNI Library, C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __UNI_StickyNote_h__
13 #define __UNI_StickyNote_h__
14 
15 #include "UNI_API.h"
16 #include "UNI_Item.h"
17 
18 // ============================================================================
19 class UNI_ConstStickyNote : public UNI_ConstItem<UNI_StickyNoteID>
20 {
21 public:
22  /// Expose base class constructors.
24 
26  { return graph() ? graph()->name( id() ) : UT_StringHolder(); }
28  { return graph() ? graph()->path( id() ) : UT_StringHolder(); }
30  { return graph() ? graph()->text( id() ) : UT_StringHolder(); }
32  { return graph() ? graph()->textColor( id() ) : UT_Color(); }
33  float textSize() const
34  { return graph() ? graph()->textSize( id() ) : 0.0; }
35  UT_Color color() const
36  { return graph() ? graph()->color( id() ) : UT_Color(); }
38  { return graph() ? graph()->position( id() ) : UT_Vector2D(0., 0.); }
39  UT_Vector2D size() const
40  { return graph() ? graph()->size( id() ) : UT_Vector2D(0., 0.); }
41  bool isCollapsed() const
42  { return graph() ? graph()->isCollapsed( id() ) : false; }
43  bool isBackgroundHidden() const
44  { return graph() ? graph()->isBackgroundHidden( id() ) : false; }
45  UNI_NodeID node() const
46  { return graph() ? graph()->ownerNode(id()) : UNI_NodeID(); }
47 };
48 
49 
50 // ============================================================================
51 class UNI_API UNI_StickyNote : public UNI_Item<UNI_StickyNoteID,
52  UNI_SessionStickyNoteID,
53  UNI_ConstStickyNote>
54 {
55 public:
56  /// Expose base class constructors.
57  using UNI_Item::UNI_Item;
58 
59  void setName( const UT_StringHolder &name );
60  void setPosition( const UT_Vector2D &pos );
61  void setSize( const UT_Vector2D &size );
62  void setColor( const UT_Color &clr );
63  void setText( const UT_StringHolder &text );
64  void setTextColor( const UT_Color &clr );
65  void setTextSize( const float size );
66  void setCollapsed( bool collapsed );
67  void setBackgroundHidden( bool hidden );
68  void destroy();
69 };
70 
71 #endif
virtual UT_StringHolder text(UNI_StickyNoteID note_id) const =0
Returns the sticky note's contents.
bool isBackgroundHidden() const
UT_Vector2D size() const
UT_Color textColor() const
virtual UT_Color textColor(UNI_StickyNoteID note_id) const =0
Returns the sticky note's text (foreground) color.
UT_Vector2T< fpreal64 > UT_Vector2D
UT_Vector2D position() const
virtual bool isBackgroundHidden(UNI_StickyNoteID note_id) const =0
UT_Color color() const
virtual UT_Vector2D size(UNI_StickyNoteID note_id) const =0
Returns the sticky note's size (width & height).
#define UNI_API
Definition: UNI_API.h:11
virtual UT_Color color(UNI_NodeID node_id) const =0
The color tint of the node in the graph editor.
float textSize() const
virtual UT_Vector2D position(UNI_NodeID node_id) const =0
The position of the node in the graph editor.
UT_StringHolder text() const
UT_StringHolder name() const
virtual UT_StringHolder name() const =0
GLuint const GLchar * name
Definition: glcorearb.h:786
UT_StringHolder path() const
virtual UNI_NodeID ownerNode(UNI_PortID port_id) const =0
UNI_NodeID node() const
GLsizeiptr size
Definition: glcorearb.h:664
UNI_Item()=default
Constructor.
virtual float textSize(UNI_StickyNoteID note_id) const =0
Returns the sticky note's text size.
virtual bool isCollapsed(UNI_StickyNoteID note_id) const =0
Returns true if the sticky note is collapsed (minimized).
const UNI_Graph * graph() const
Returns the graph inside which the node lives.
Definition: UNI_Item.h:44
virtual UT_StringHolder path(UNI_NodeID node_id) const =0
The full path of the node.
bool isCollapsed() const
UNI_ConstItem()=default
Constructor.