00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Joe Drew 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: OP_PostItNoteList.h (OP Library, C++) 00015 * 00016 * COMMENTS: 00017 */ 00018 00019 #ifndef __OP_PostItNoteList__ 00020 #define __OP_PostItNoteList__ 00021 00022 #include "OP_API.h" 00023 #include <SYS/SYS_Types.h> 00024 #include <UT/UT_PtrArray.h> 00025 00026 #include "OP_Error.h" 00027 #include "OP_Node.h" 00028 00029 class OP_Network; 00030 class OP_PostIt; 00031 class OP_PostItNoteItem; 00032 class OP_SaveFlags; 00033 00034 class OP_API OP_PostItNoteList : public UT_PtrArray<OP_PostIt *> 00035 { 00036 public: 00037 OP_PostItNoteList(OP_Network *net); 00038 virtual ~OP_PostItNoteList(); 00039 00040 /// Remove all network boxes from this list 00041 void clearAndDestroy(); 00042 00043 /// Create a network box with the specified name and insert it into this 00044 /// OP_PostItNoteList at the next available index. Returns a pointer to the 00045 /// OP_PostIt created or NULL if creation was unsuccessful. Pass in NULL 00046 /// as the name if you'd like a default name. If a duplicate name is passed 00047 /// in, it will be altered to make it unique. Passing in 'items' will 00048 /// automatically create a network box containing those items with the 00049 /// netbox positioned properly around them. 00050 OP_PostIt *createPostItNote(const char *name); 00051 00052 /// Find and return a given network box by name, or NULL if it's not found 00053 OP_PostIt *findPostItNote(const char *name) const; 00054 00055 /// Find the index of a given network box by name. Returns -1 if not found 00056 int findPostItNoteIndex(const char *name) const; 00057 00058 /// Find the index of a given network box by ptr. Returns -1 if not found 00059 int findPostItNoteIndex(OP_PostIt *netbox) const; 00060 00061 /// Remove a network box by ptr. Returns true if it was successfully 00062 /// removed; false if the box wasn't found 00063 bool deletePostItNote(OP_PostIt *netbox); 00064 00065 /// Remove a network box by index. Returns true if it was successfully 00066 /// removed; false if the index is invalid 00067 bool deletePostItNote(int index); 00068 00069 ///Load a network box from 'is'. Can load from both .hip files and the 00070 ///clipboard. 'path' is used as the new netbox's name (only the portion of 00071 ///path after the last slash). If 'overwrite' is specified, the new netbox 00072 ///will overwrite any other netboxes in this network with the same name, 00073 ///rather than modify its name to be unique. 'created' is used to return a 00074 ///ptr to the new network box. 00075 bool load(UT_IStream &is, const char *path, 00076 int overwrite = 0, OP_PostIt **created = NULL); 00077 00078 private: 00079 00080 OP_Network *myNetwork; 00081 }; 00082 00083 #endif
1.5.9