HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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
50 };
51 
52 class FS_FileHistory;
53 
55 {
56 public:
57 
58  static FS_FileHistoryManager *getFileHistoryManager();
60 
61  void saveFileHistoryList();
62  void saveDirHistoryList();
63 
64  void loadFileHistoryList();
65  void loadDirHistoryList();
66 
67 
68  // Queries the files for a menu.
69  int numFilesInList(FS_FileHistoryType filetype) const;
70  const char *getFilenameFromList(int index, FS_FileHistoryType filetype) const;
71 
72  // Queries the directories for a menu.
73  int numDirsInList(FS_FileHistoryType filetype) const;
74  const char *getDirFromList(int index, FS_FileHistoryType filetype) const;
75 
76  void getFormattedFilenameFromList(int index,
77  FS_FileHistoryType filetype, UT_String &path) const;
78  void getFormattedDirFromList(int index,
79  FS_FileHistoryType filetype, UT_String &path) const;
80 
81  // This will add to both the file and directory history
82  void addFileToHistoryList(const char *filename,
83  FS_FileHistoryType filetype);
84  void removeFileFromHistoryList(const char *filename,
85  FS_FileHistoryType filetype);
86 
87 protected:
89 
90  void saveHistoryList(const char *filename, bool filelist);
91  void loadHistoryList(const char *filename, bool filelist);
92 private:
93  FS_FileHistory *getHistoryList(FS_FileHistoryType filetype);
94  const FS_FileHistory *getHistoryList(FS_FileHistoryType filetype) const;
95  FS_FileHistory *getDirHistoryList(FS_FileHistoryType filetype);
96  const FS_FileHistory *getDirHistoryList(FS_FileHistoryType filetype) const;
97 
98  UT_ValArray<FS_FileHistory *> myHistoryList;
99  UT_ValArray<FS_FileHistory *> myDirHistoryList;
100 };
101 
102 #define FSgetFileHistoryManager FS_FileHistoryManager::getFileHistoryManager
103 
104 #endif
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