HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_NetworkBoxFlags.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: OP Library (C++)
7  *
8  * COMMENTS: A simple class to hold flags for network boxes
9  *
10  */
11 
12 #ifndef __OP_NetworkBoxFlags_h__
13 #define __OP_NetworkBoxFlags_h__
14 
15 #include "OP_API.h"
16 #include <iosfwd>
17 
18 #include <UT/UT_String.h>
19 
20 class OP_NetworkBox;
21 
22 #define OP_NETWORKBOX_PICK_FLAG 'p'
23 #define OP_NETWORKBOX_MINIMIZED_FLAG 'm'
24 
26 {
27 public:
28 
29  void setUndoComment(bool flag)
30  { myUndoComment = flag; }
31  void setUndoLayout(bool flag)
32  { myUndoLayout = flag; }
33  void setUndoMinimize(bool flag)
34  { myUndoMinimize = flag; }
35  void setUndoRename(bool flag)
36  { myUndoRename = flag; }
37  void setUndoResize(bool flag)
38  { myUndoResize = flag; }
39 
40  void setMarked(bool flag)
41  { myMarked = flag; }
42  void setMinimized(bool flag)
43  { myMinimized = flag; }
44  void setPicked(bool flag)
45  { myPicked = flag; }
46  void setResizing(bool flag)
47  { myResizing = flag; }
48  void setAutoFit(bool flag)
49  { myAutoFit = flag; }
50 
51  bool getUndoComment() const
52  { return myUndoComment; }
53  bool getUndoLayout() const
54  { return myUndoLayout; }
55  bool getUndoMinimize() const
56  { return myUndoMinimize; }
57  bool getUndoRename() const
58  { return myUndoRename; }
59  bool getUndoResize() const
60  { return myUndoResize; }
61 
62  bool getMarked() const
63  { return myMarked; }
64  bool getMinimized() const
65  { return myMinimized; }
66  bool getPicked() const
67  { return myPicked; }
68  bool getResizing() const
69  { return myResizing; }
70  bool getAutoFit() const
71  { return myAutoFit; }
72 
73  void getFlagOptions(UT_String &options) const;
74 
75 private:
76  bool myMarked:1, // Temporary marking for various purposes
77  myMinimized:1, // Netbox is minimized
78  myPicked:1, // Picked by user
79  myResizing:1, // Netbox is being resized
80  myAutoFit:1, // Netbox should auto-resize to fit contents
81 
82  // These flags are used to save whether a particular
83  // type of change for the node has been saved.
84  myUndoComment:1,
85  myUndoLayout:1,
86  myUndoMinimize:1,
87  myUndoRename:1,
88  myUndoResize:1;
89 
90 private:
93 
94  friend class OP_NetworkBox;
95 
96  ///Writes out the values of the flags specified by 'flags' to 'os'. If
97  ///'flags' is NULL, writes out values for all our flags
98  void appendCommandString(std::ostream &os, const char *flags,
99  bool save_to_hip) const;
100 
101  void shallowCopy(const OP_NetworkBoxFlags &source);
102 
103  ///Initializes all the flags to their default values
104  void setDefaults(void);
105 
106 };
107 
108 #endif
void setUndoComment(bool flag)
bool getUndoLayout() const
void setUndoResize(bool flag)
bool getAutoFit() const
bool getMinimized() const
GLbitfield flags
Definition: glcorearb.h:1595
bool getUndoRename() const
void setUndoLayout(bool flag)
void setUndoRename(bool flag)
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
bool getMarked() const
bool getResizing() const
void setMinimized(bool flag)
void setUndoMinimize(bool flag)
bool getUndoResize() const
#define OP_API
Definition: OP_API.h:10
bool getUndoComment() const
void setResizing(bool flag)
void setAutoFit(bool flag)
bool getPicked() const
bool getUndoMinimize() const
void setMarked(bool flag)
png_infop png_uint_32 flag
Definition: png.h:2242
void setPicked(bool flag)