Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

GUI/Widgets/vtkKWMostRecentFilesManager.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Module:    $RCSfile: vtkKWMostRecentFilesManager.h,v $
00004 
00005   Copyright (c) Kitware, Inc.
00006   All rights reserved.
00007   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
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   //BTX
00139 
00140   // PIMPL Encapsulation for STL containers
00141 
00142   vtkKWMostRecentFilesManagerInternals *Internals;
00143   friend class vtkKWMostRecentFilesManagerInternals;
00144 
00145   //ETX
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   // In private for lazy allocation using GetMenu()
00162 
00163   vtkKWMenu *Menu;
00164 
00165   vtkKWMostRecentFilesManager(const vtkKWMostRecentFilesManager&); // Not implemented
00166   void operator=(const vtkKWMostRecentFilesManager&); // Not implemented
00167 };
00168 
00169 #endif
00170 

Generated on Tue May 30 12:31:43 2006 for ParaView by doxygen 1.3.5