HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_Gallery.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_Gallery.h ( OP Library, C++)
7  *
8  * COMMENTS: Class associated with a gallery file that manages the
9  * contained OP_GalleryEntrys.
10  */
11 
12 #ifndef __OP_Gallery__
13 #define __OP_Gallery__
14 
15 #include "OP_API.h"
16 #include <FS/FS_IndexFile.h>
17 #include "OP_GalleryEntry.h"
18 
19 class UT_StringArray;
20 class OP_GalleryManager;
21 
23 {
24 public:
25  int getNumGalleryEntries() const;
26  OP_GalleryEntry *getGalleryEntry(int index) const;
27  OP_GalleryEntry *findGalleryEntry(const char *entryname) const;
28  OP_GalleryEntry *newGalleryEntry(const char *entryname);
29  void removeGalleryEntry(const char *entryname);
30  void removeGalleryEntry(int index);
31  void getMatchingEntries(OP_GalleryEntryList &found,
32  OP_Node *node,
33  bool include_hidden = true) const;
34  void getMatchingEntries(OP_GalleryEntryList &found,
35  const char *namepattern,
36  const char *labelpattern,
37  const char *keywordpattern,
38  const char *category,
39  const char *optable,
40  const char *optype,
41  bool include_hidden = true) const;
42 
43  /// Returns the array of all keywords used by gallery entries
44  /// that match the requirement of the optable.
45  void getKeywords(UT_StringArray & keywords,
46  const char *optable = NULL);
47 
48  const UT_String &getFilePath() const;
49  bool getFileIsValid() const;
50  bool getFileIsWritable() const;
51 
52  bool refresh(bool force);
53  bool save();
54 
55 protected:
57  const char *filepath);
58  virtual ~OP_Gallery();
59 
60  void clear();
61 
62 private:
63  static bool createBackupFile(const char *filename);
64 
65  OP_GalleryManager *myGalleryManager;
66  FS_IndexFile *myIndexFile;
67  OP_GalleryEntryList myGalleryEntries;
68  UT_String myFilePath;
69 
70  friend class OP_GalleryManager;
71 };
72 
74 
75 #endif
76 
GT_API const UT_StringHolder filename
SIM_API const UT_StringHolder force
#define OP_API
Definition: OP_API.h:10
GLuint index
Definition: glcorearb.h:786