HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_PostItNoteList.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_PostItNoteList.h (OP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __OP_PostItNoteList__
12 #define __OP_PostItNoteList__
13 
14 #include "OP_API.h"
15 #include <SYS/SYS_Types.h>
16 #include <UT/UT_ValArray.h>
17 
18 #include "OP_Error.h"
19 #include "OP_Node.h"
20 
21 class OP_Network;
22 class OP_PostIt;
23 class OP_PostItNoteItem;
24 class OP_SaveFlags;
25 
26 class OP_API OP_PostItNoteList : public UT_ValArray<OP_PostIt *>
27 {
28 public:
30 
32  // NOTE: We don't need a virtual destructor, because our superclass
33  // has a non-virtual destructor, and this is only destructed
34  // as type OP_PostItNoteList.
36 
37  /// Remove all network boxes from this list
38  void clearAndDestroy();
39 
40  /// Create a network box with the specified name and insert it into this
41  /// OP_PostItNoteList at the next available index. Returns a pointer to the
42  /// OP_PostIt created or NULL if creation was unsuccessful. Pass in NULL
43  /// as the name if you'd like a default name. If a duplicate name is passed
44  /// in, it will be altered to make it unique. Passing in 'items' will
45  /// automatically create a network box containing those items with the
46  /// netbox positioned properly around them.
47  OP_PostIt *createPostItNote(const char *name);
48 
49  /// Find and return a given network box by name, or NULL if it's not found
50  OP_PostIt *findPostItNote(const char *name) const;
51 
52  /// Find the index of a given network box by name. Returns -1 if not found
53  int findPostItNoteIndex(const char *name) const;
54 
55  /// Find the index of a given network box by ptr. Returns -1 if not found
56  int findPostItNoteIndex(OP_PostIt *netbox) const;
57 
58  /// Remove a network box by ptr. Returns true if it was successfully
59  /// removed; false if the box wasn't found
60  bool deletePostItNote(OP_PostIt *netbox);
61 
62  /// Remove a network box by index. Returns true if it was successfully
63  /// removed; false if the index is invalid
64  bool deletePostItNote(int index);
65 
66  /// Load a network box from 'is'. Can load from both .hip files and the
67  /// clipboard. 'path' is used as the new netbox's name (only the portion of
68  /// path after the last slash). If 'overwrite' is specified, the new netbox
69  /// will overwrite any other netboxes in this network with the same name,
70  /// rather than modify its name to be unique. 'created' is used to return a
71  /// ptr to the new network box.
72  bool load(UT_IStream &is, const char *path,
73  bool path_contains_network,
74  bool path_contains_packet_ext,
75  int overwrite = 0, OP_PostIt **created = NULL);
76 
77  /// Return the amount of memory owned by this OP_PostItNoteList
78  int64 getMemoryUsage(bool inclusive) const;
79 
80 private:
81  OP_Network *myNetwork;
82 };
83 
84 #endif
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
int64 getMemoryUsage(bool inclusive=false) const
Definition: UT_Array.h:462
long long int64
Definition: SYS_Types.h:107
GLuint const GLchar * name
Definition: glcorearb.h:785
UT_ValArray< OP_PostIt * > Base
#define OP_API
Definition: OP_API.h:10
GLuint index
Definition: glcorearb.h:785
Definition: OP_PostIt.h:42