00001 /*========================================================================= 00002 00003 Module: $RCSfile: vtkKWUserInterfaceManager.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 =========================================================================*/ 00037 #ifndef __vtkKWUserInterfaceManager_h 00038 #define __vtkKWUserInterfaceManager_h 00039 00040 #include "vtkKWObject.h" 00041 00042 class vtkKWApplication; 00043 class vtkKWIcon; 00044 class vtkKWWidget; 00045 class vtkKWUserInterfacePanel; 00046 class vtkKWUserInterfaceManagerInternals; 00047 00048 class KWWIDGETS_EXPORT vtkKWUserInterfaceManager : public vtkKWObject 00049 { 00050 public: 00051 vtkTypeRevisionMacro(vtkKWUserInterfaceManager,vtkKWObject); 00052 void PrintSelf(ostream& os, vtkIndent indent); 00053 00055 00057 virtual void Create(vtkKWApplication *app); 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 00089 virtual vtkKWUserInterfacePanel* GetPanel(const char *panel_name); 00090 virtual vtkKWUserInterfacePanel* GetPanel(int id); 00091 virtual vtkKWUserInterfacePanel* GetPanelFromPageId(int id) = 0; 00092 virtual vtkKWUserInterfacePanel* GetNthPanel(int rank); 00094 00096 00101 virtual int RemovePanel(vtkKWUserInterfacePanel *panel); 00102 virtual void RemoveAllPanels(); 00104 00106 00111 virtual int AddPage(vtkKWUserInterfacePanel *panel, 00112 const char *title, 00113 const char *balloon = 0, 00114 vtkKWIcon *icon = 0) = 0; 00116 00118 00125 virtual vtkKWWidget* GetPageWidget(int id) = 0; 00126 virtual vtkKWWidget* GetPageWidget(vtkKWUserInterfacePanel *panel, 00127 const char *title) = 0; 00129 00136 virtual vtkKWWidget *GetPagesParentWidget(vtkKWUserInterfacePanel *panel)= 0; 00137 00139 00144 virtual void RaisePage(int id) = 0; 00145 virtual void RaisePage(vtkKWUserInterfacePanel *panel, 00146 const char *title) = 0; 00148 00150 00159 virtual int ShowPanel(vtkKWUserInterfacePanel *panel) = 0; 00160 virtual int HidePanel(vtkKWUserInterfacePanel *panel) = 0; 00161 virtual int IsPanelVisible(vtkKWUserInterfacePanel *panel) = 0; 00162 virtual int RaisePanel(vtkKWUserInterfacePanel *panel) 00163 { return this->ShowPanel(panel); }; 00165 00167 00168 virtual void ShowAllPanels(); 00169 virtual void HideAllPanels(); 00171 00176 virtual void UpdatePanel(vtkKWUserInterfacePanel *) {}; 00177 00178 protected: 00179 vtkKWUserInterfaceManager(); 00180 ~vtkKWUserInterfaceManager(); 00181 00183 00187 virtual int RemovePageWidgets(vtkKWUserInterfacePanel *) 00188 { return 1; }; 00190 00191 int IdCounter; 00192 00193 //BTX 00194 00195 // A panel slot associate a panel to a unique Id 00196 00197 class PanelSlot 00198 { 00199 public: 00200 int Id; 00201 vtkKWUserInterfacePanel *Panel; 00202 }; 00203 00204 // PIMPL Encapsulation for STL containers 00205 00206 vtkKWUserInterfaceManagerInternals *Internals; 00207 friend class vtkKWUserInterfaceManagerInternals; 00208 00209 // Helper methods 00210 // Get a panel slot given a panel or an id, check if the manager has a given 00211 // panel, get a panel id given a panel, etc. 00212 00213 PanelSlot* GetPanelSlot(vtkKWUserInterfacePanel *panel); 00214 PanelSlot* GetPanelSlot(int id); 00215 PanelSlot* GetPanelSlot(const char *panel_name); 00216 PanelSlot* GetNthPanelSlot(int rank); 00217 int GetPanelId(vtkKWUserInterfacePanel *panel); 00218 00219 //ETX 00220 00223 virtual void NumberOfPanelsChanged() {}; 00224 00225 private: 00226 00227 vtkKWUserInterfaceManager(const vtkKWUserInterfaceManager&); // Not implemented 00228 void operator=(const vtkKWUserInterfaceManager&); // Not Implemented 00229 }; 00230 00231 #endif 00232