HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FS_FileHistoryManager.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: FS_FileHistoryManager.h (C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __FS_FileHistoryManager__
13 #define __FS_FileHistoryManager__
14 
15 #include "FS_API.h"
16 #include "FS_FileHistory.h"
17 
18 // IMPORTANT: Must be kept in sync with FS_FileHistoryTypeNames
51 };
52 
53 class FS_FileHistory;
54 
56 {
57 public:
58 
59  static FS_FileHistoryManager *getFileHistoryManager();
61 
62  void saveFileHistoryList();
63  void saveDirHistoryList();
64 
65  void loadFileHistoryList();
66  void loadDirHistoryList();
67 
68 
69  // Queries the files for a menu.
70  int numFilesInList(FS_FileHistoryType filetype) const;
71  const char *getFilenameFromList(int index, FS_FileHistoryType filetype) const;
72 
73  // Queries the directories for a menu.
74  int numDirsInList(FS_FileHistoryType filetype) const;
75  const char *getDirFromList(int index, FS_FileHistoryType filetype) const;
76 
77  void getFormattedFilenameFromList(int index,
78  FS_FileHistoryType filetype, UT_String &path) const;
79  void getFormattedDirFromList(int index,
80  FS_FileHistoryType filetype, UT_String &path) const;
81 
82  // This will add to both the file and directory history
83  void addFileToHistoryList(const char *filename,
84  FS_FileHistoryType filetype);
85  void removeFileFromHistoryList(const char *filename,
86  FS_FileHistoryType filetype);
87 
88 protected:
90 
91  void saveHistoryList(const char *filename, bool filelist);
92  void loadHistoryList(const char *filename, bool filelist);
93 private:
94  FS_FileHistory *getHistoryList(FS_FileHistoryType filetype);
95  const FS_FileHistory *getHistoryList(FS_FileHistoryType filetype) const;
96  FS_FileHistory *getDirHistoryList(FS_FileHistoryType filetype);
97  const FS_FileHistory *getDirHistoryList(FS_FileHistoryType filetype) const;
98 
99  UT_ValArray<FS_FileHistory *> myHistoryList;
100  UT_ValArray<FS_FileHistory *> myDirHistoryList;
101 };
102 
103 #define FSgetFileHistoryManager FS_FileHistoryManager::getFileHistoryManager
104 
105 #endif
GT_API const UT_StringHolder filename
FS_FileHistoryType
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
GLuint index
Definition: glcorearb.h:785
#define FS_API
Definition: FS_API.h:10