00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00037 #ifndef __vtkKWUserInterfaceManager_h
00038 #define __vtkKWUserInterfaceManager_h
00039
00040 #include "vtkKWObject.h"
00041
00042 class vtkKWIcon;
00043 class vtkKWWidget;
00044 class vtkKWUserInterfacePanel;
00045 class vtkKWUserInterfaceManagerInternals;
00046
00047 class KWWidgets_EXPORT vtkKWUserInterfaceManager : public vtkKWObject
00048 {
00049
00050 public:
00051 vtkTypeRevisionMacro(vtkKWUserInterfaceManager,vtkKWObject);
00052 void PrintSelf(ostream& os, vtkIndent indent);
00053
00055
00057 virtual void Create();
00058 virtual int IsCreated();
00060
00062
00064 virtual void SetEnabled(int);
00065 virtual void UpdateEnableState();
00067
00070 virtual void Update();
00071
00073
00078 virtual int AddPanel(vtkKWUserInterfacePanel *panel);
00079 virtual int HasPanel(vtkKWUserInterfacePanel *panel);
00081
00083 virtual int GetNumberOfPanels();
00084
00086
00088 virtual vtkKWUserInterfacePanel* GetPanel(const char *panel_name);
00089 virtual vtkKWUserInterfacePanel* GetPanel(int id);
00090 virtual vtkKWUserInterfacePanel* GetPanelFromPageId(int id) = 0;
00091 virtual vtkKWUserInterfacePanel* GetNthPanel(int rank);
00093
00095
00100 virtual int RemovePanel(vtkKWUserInterfacePanel *panel);
00101 virtual void RemoveAllPanels();
00103
00105
00111 virtual int AddPage(vtkKWUserInterfacePanel *panel,
00112 const char *title,
00113 const char *balloon = 0,
00114 vtkKWIcon *icon = 0) = 0;
00115 virtual int RemovePage(vtkKWUserInterfacePanel *panel,
00116 const char *title) = 0;
00118
00120
00121 virtual void SetPageTitle(int id, const char *title) = 0;
00122 virtual void SetPageBalloonHelpString(int id, const char *str) = 0;
00123 virtual void SetPageIcon(int id, vtkKWIcon *icon) = 0;
00124 virtual void SetPageIconToPredefinedIcon(int id, int icon_index) = 0;
00126
00128
00135 virtual vtkKWWidget* GetPageWidget(int id) = 0;
00136 virtual vtkKWWidget* GetPageWidget(vtkKWUserInterfacePanel *panel,
00137 const char *title) = 0;
00139
00146 virtual vtkKWWidget *GetPagesParentWidget(vtkKWUserInterfacePanel *panel)= 0;
00147
00149
00154 virtual void RaisePage(int id) = 0;
00155 virtual void RaisePage(vtkKWUserInterfacePanel *panel,
00156 const char *title) = 0;
00158
00160
00169 virtual int ShowPanel(vtkKWUserInterfacePanel *panel) = 0;
00170 virtual int HidePanel(vtkKWUserInterfacePanel *panel) = 0;
00171 virtual int IsPanelVisible(vtkKWUserInterfacePanel *panel) = 0;
00172 virtual int RaisePanel(vtkKWUserInterfacePanel *panel)
00173 { return this->ShowPanel(panel); };
00175
00177
00178 virtual void ShowAllPanels();
00179 virtual void HideAllPanels();
00181
00186 virtual void UpdatePanel(vtkKWUserInterfacePanel *) {};
00187
00188
00189
00190 protected:
00191 vtkKWUserInterfaceManager();
00192 ~vtkKWUserInterfaceManager();
00193
00195
00199 virtual int RemovePageWidgets(vtkKWUserInterfacePanel *)
00200 { return 1; };
00202
00203 int IdCounter;
00204
00205
00206
00207
00208
00209 class PanelSlot
00210 {
00211 public:
00212 int Id;
00213 vtkKWUserInterfacePanel *Panel;
00214 };
00215
00216
00217
00218 vtkKWUserInterfaceManagerInternals *Internals;
00219 friend class vtkKWUserInterfaceManagerInternals;
00220
00221
00222
00223
00224
00225 PanelSlot* GetPanelSlot(vtkKWUserInterfacePanel *panel);
00226 PanelSlot* GetPanelSlot(int id);
00227 PanelSlot* GetPanelSlot(const char *panel_name);
00228 PanelSlot* GetNthPanelSlot(int rank);
00229 int GetPanelId(vtkKWUserInterfacePanel *panel);
00230
00231
00232
00235 virtual void NumberOfPanelsChanged() {};
00236
00237
00238
00239 private:
00240
00241 int ManagerIsCreated;
00242
00243 vtkKWUserInterfaceManager(const vtkKWUserInterfaceManager&);
00244 void operator=(const vtkKWUserInterfaceManager&);
00245 };
00246
00247 #endif
00248
00249