00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00032 #ifndef __vtkKWMostRecentFilesManager_h
00033 #define __vtkKWMostRecentFilesManager_h
00034
00035 #include "vtkKWObject.h"
00036
00037 class vtkKWMostRecentFilesManagerInternals;
00038 class vtkKWMenu;
00039
00040 class KWWIDGETS_EXPORT vtkKWMostRecentFilesManager : public vtkKWObject
00041 {
00042 public:
00043 static vtkKWMostRecentFilesManager* New();
00044 vtkTypeRevisionMacro(vtkKWMostRecentFilesManager,vtkKWObject);
00045 void PrintSelf(ostream& os, vtkIndent indent);
00046
00048
00055 virtual void AddFile(
00056 const char *filename,
00057 vtkObject *target_object = NULL,
00058 const char *target_command = NULL);
00060
00062
00069 vtkGetObjectMacro(DefaultTargetObject, vtkObject);
00070 virtual void SetDefaultTargetObject(vtkObject*);
00071 vtkGetStringMacro(DefaultTargetCommand);
00072 virtual void SetDefaultTargetCommand(const char *);
00074
00076
00082 virtual void RestoreFilesListFromRegistry();
00083 virtual void SaveFilesToRegistry();
00084 virtual void RestoreFilesListFromRegistry(
00085 const char *reg_key, int max_nb);
00086 virtual void SaveFilesToRegistry(
00087 const char *reg_key, int max_nb);
00089
00091
00094 vtkGetStringMacro(RegistryKey);
00095 vtkSetStringMacro(RegistryKey);
00097
00099
00101 vtkGetMacro(MaximumNumberOfFilesInRegistry, int);
00102 vtkSetMacro(MaximumNumberOfFilesInRegistry, int);
00104
00110 vtkKWMenu* GetMenu();
00111
00113
00115 vtkGetMacro(MaximumNumberOfFilesInMenu, int);
00116 virtual void SetMaximumNumberOfFilesInMenu(int);
00118
00121 virtual void UpdateMenuStateInParent();
00122
00126 virtual void PopulateMenu(vtkKWMenu*, int max_nb);
00127
00128 protected:
00129 vtkKWMostRecentFilesManager();
00130 ~vtkKWMostRecentFilesManager();
00131
00132 char *DefaultTargetCommand;
00133 vtkObject *DefaultTargetObject;
00134 char *RegistryKey;
00135 int MaximumNumberOfFilesInRegistry;
00136 int MaximumNumberOfFilesInMenu;
00137
00138
00139
00140
00141
00142 vtkKWMostRecentFilesManagerInternals *Internals;
00143 friend class vtkKWMostRecentFilesManagerInternals;
00144
00145
00146
00148
00150 virtual void AddFileInternal(
00151 const char *filename,
00152 vtkObject *target_object = NULL,
00153 const char *target_command = NULL);
00155
00157 virtual void UpdateMenu();
00158
00159 private:
00160
00161
00162
00163 vtkKWMenu *Menu;
00164
00165 vtkKWMostRecentFilesManager(const vtkKWMostRecentFilesManager&);
00166 void operator=(const vtkKWMostRecentFilesManager&);
00167 };
00168
00169 #endif
00170