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) const;
33  void getMatchingEntries(OP_GalleryEntryList &found,
34  const char *namepattern,
35  const char *labelpattern,
36  const char *keywordpattern,
37  const char *category,
38  const char *optable,
39  const char *optype) const;
40 
41  /// Returns the array of all keywords used by gallery entries
42  /// that match the requirement of the optable.
43  void getKeywords(UT_StringArray & keywords,
44  const char *optable = NULL);
45 
46  const UT_String &getFilePath() const;
47  bool getFileIsValid() const;
48  bool getFileIsWritable() const;
49 
50  bool refresh(bool force);
51  bool save();
52 
53 protected:
55  const char *filepath);
56  virtual ~OP_Gallery();
57 
58  void clear();
59 
60 private:
61  static bool createBackupFile(const char *filename);
62 
63  OP_GalleryManager *myGalleryManager;
64  FS_IndexFile *myIndexFile;
65  OP_GalleryEntryList myGalleryEntries;
66  UT_String myFilePath;
67 
68  friend class OP_GalleryManager;
69 };
70 
72 
73 #endif
74 
GT_API const UT_StringHolder filename
#define OP_API
Definition: OP_API.h:10
GLuint index
Definition: glcorearb.h:785