/usr/include/KWWidgets/vtkKWUserInterfaceManager.h is in libkwwidgets1-dev 1.0.0~cvs20100930-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | /*=========================================================================
Module: $RCSfile: vtkKWUserInterfaceManager.h,v $
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkKWUserInterfaceManager - a user interface manager.
// .SECTION Description
// This class is used to abstract the way a set of interface "panels"
// (vtkKWUserInterfacePanel) can be grouped inside a widget.
// For example, if a concrete implementation of that class
// uses a notebook as its underlying widget, then it will deliver a notebook's
// page when one of its managed panels request a "page" (i.e. a section
// within a panel). If another concrete implementation chooses for
// a flat GUI for example, then it will likely return frames as pages and
// pack them on top of each other.
// This class is not a widget. Concrete implementation of this class will
// provide an access point to a widget into which the manager will organize
// its panels (a notebook, a frame, etc.).
// Besides packing this widget, you will just have to set each panel's
// UserInterfaceManager ivar to point to this manager, and the rest should
// be taken care of (i.e. you do not need to manually add a panel to a manager,
// or manually request a page from the manager, it should be done through the
// panel's API).
// .SECTION See Also
// vtkKWUserInterfaceManagerNotebook vtkKWUserInterfacePanel
#ifndef __vtkKWUserInterfaceManager_h
#define __vtkKWUserInterfaceManager_h
#include "vtkKWObject.h"
class vtkKWIcon;
class vtkKWWidget;
class vtkKWUserInterfacePanel;
class vtkKWUserInterfaceManagerInternals;
class KWWidgets_EXPORT vtkKWUserInterfaceManager : public vtkKWObject
{
public:
vtkTypeRevisionMacro(vtkKWUserInterfaceManager,vtkKWObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Create the manager widget (i.e. the widget that will group and display
// all user interface panels).
virtual void Create();
virtual int IsCreated();
// Description:
// Enable/Disable this interface. This propagates SetEnabled() calls to all
// panels.
virtual void SetEnabled(int);
virtual void UpdateEnableState();
// Description:
// Iterate over all panels and call Update() for each one. This will refresh
// the panels (provided that Update() has been reimplemented).
virtual void Update();
// Description:
// Add a panel to the manager.
// Note that you most probably do not need to call this method, since setting
// a panel's UserInterfaceManager ivar will add the panel automatically
// (see vtkKWUserInterfacePanel::SetUserInterfaceManager()).
// Return a unique positive ID corresponding to that panel, or < 0 on error.
virtual int AddPanel(vtkKWUserInterfacePanel *panel);
virtual int HasPanel(vtkKWUserInterfacePanel *panel);
// Description:
// Get the number of panel
virtual int GetNumberOfPanels();
// Description:
// Get the panel from its name or ID, from a page ID (return the ID of the
// panel that holds that page), or the nth panel.
virtual vtkKWUserInterfacePanel* GetPanel(const char *panel_name);
virtual vtkKWUserInterfacePanel* GetPanel(int id);
virtual vtkKWUserInterfacePanel* GetPanelFromPageId(int id) = 0;
virtual vtkKWUserInterfacePanel* GetNthPanel(int rank);
// Description:
// Remove a panel (or all) from the manager.
// Note that you most probably do not need to call this method, since setting
// a panel's UserInterfaceManager ivar to NULL will remove the panel
// automatically (this is done in the panel's destructor).
// Return 1 on success, 0 on error.
virtual int RemovePanel(vtkKWUserInterfacePanel *panel);
virtual void RemoveAllPanels();
// Description:
// Instruct the manager to reserve or remove a page for a given panel.
// Note that you should use the panel's own API to add a page to a panel:
// this will automatically call this method with the proper panel parameter
// (see vtkKWUserInterfacePanel::AddPage() and
// vtkKWUserInterfacePanel::RemovePage()).
// Return a unique positive ID for the page that was reserved/removed,
// or < 0 on error.
virtual int AddPage(vtkKWUserInterfacePanel *panel,
const char *title,
const char *balloon = 0,
vtkKWIcon *icon = 0) = 0;
virtual int RemovePage(vtkKWUserInterfacePanel *panel,
const char *title) = 0;
// Description:
// Set a page's title, balloon help and icon.
virtual void SetPageTitle(int id, const char *title) = 0;
virtual void SetPageBalloonHelpString(int id, const char *str) = 0;
virtual void SetPageIcon(int id, vtkKWIcon *icon) = 0;
virtual void SetPageIconToPredefinedIcon(int id, int icon_index) = 0;
// Description:
// Retrieve the widget corresponding to a given page reserved by the manager.
// This can be done through the unique page ID, or using a panel and the
// page title. The user UI components should be inserted into this widget.
// Note that you should use the panel's own API to get a page widget: this
// will automatically call this method with the proper ID or panel parameter
// (see vtkKWUserInterfacePanel::GetPageWidget()).
// Return NULL on error.
virtual vtkKWWidget* GetPageWidget(int id) = 0;
virtual vtkKWWidget* GetPageWidget(vtkKWUserInterfacePanel *panel,
const char *title) = 0;
// Description:
// Retrieve the parent widget of the pages associated to a panel. It is
// the unique widget that is common to all pages in the chain of parents.
// Note that you should use the panel's own API to get the page parent: this
// will automatically call this method with the proper panel parameter
// (see vtkKWUserInterfacePanel::GetPagesParentWidget()).
virtual vtkKWWidget *GetPagesParentWidget(vtkKWUserInterfacePanel *panel)= 0;
// Description:
// Raise a page reserved by the manager. This can be done through the unique
// page ID, or using a panel and the page title.
// Note that you should use the panel's own API to raise a page: this
// will automatically call this method with the proper ID or panel parameter
// (see vtkKWUserInterfacePanel::RaisePage()).
virtual void RaisePage(int id) = 0;
virtual void RaisePage(vtkKWUserInterfacePanel *panel,
const char *title) = 0;
// Description:
// Show/Hide a panel. It will make sure the pages reserved by the manager
// for this panel are shown/hidden.
// RaisePanel() behaves like ShowPanel(), but it will also try to bring
// up the first page of the panel to the front (i.e., "select" it).
// IsPanelVisible() checks if the pages of the panel are visible/shown.
// Note that you should use the panel's own API to show/raise a panel: this
// will automatically call this method with the proper panel parameter
// (see vtkKWUserInterfacePanel::Show/Raise()).
// Return 1 on success, 0 on error.
virtual int ShowPanel(vtkKWUserInterfacePanel *panel) = 0;
virtual int HidePanel(vtkKWUserInterfacePanel *panel) = 0;
virtual int IsPanelVisible(vtkKWUserInterfacePanel *panel) = 0;
virtual int RaisePanel(vtkKWUserInterfacePanel *panel)
{ return this->ShowPanel(panel); };
// Description:
// Show/hide all panels.
virtual void ShowAllPanels();
virtual void HideAllPanels();
// Description:
// Update a panel according to the manager settings (i.e., it just performs
// manager-specific changes on the panel). Note that it does not call the
// panel's Update() method, on the opposite the panel's Update() will call
// this method if the panel has a UIM set.
virtual void UpdatePanel(vtkKWUserInterfacePanel *) {};
protected:
vtkKWUserInterfaceManager();
~vtkKWUserInterfaceManager();
// Description:
// Remove the widgets of all pages belonging to a panel. It is called
// by RemovePanel() and should be overloaded if the concrete implementation
// of the manager needs to unmap/unpack widgets before everything is deleted.
// Return 1 on success, 0 on error.
virtual int RemovePageWidgets(vtkKWUserInterfacePanel *)
{ return 1; };
int IdCounter;
//BTX
// A panel slot associate a panel to a unique Id
class PanelSlot
{
public:
int Id;
vtkKWUserInterfacePanel *Panel;
};
// PIMPL Encapsulation for STL containers
vtkKWUserInterfaceManagerInternals *Internals;
friend class vtkKWUserInterfaceManagerInternals;
// Helper methods
// Get a panel slot given a panel or an id, check if the manager has a given
// panel, get a panel id given a panel, etc.
PanelSlot* GetPanelSlot(vtkKWUserInterfacePanel *panel);
PanelSlot* GetPanelSlot(int id);
PanelSlot* GetPanelSlot(const char *panel_name);
PanelSlot* GetNthPanelSlot(int rank);
int GetPanelId(vtkKWUserInterfacePanel *panel);
//ETX
// Description:
// This method is (and should be) called each time the number of panels
// changes (for example, after AddPanel() / RemovePanel())
virtual void NumberOfPanelsChanged() {};
private:
int ManagerIsCreated;
vtkKWUserInterfaceManager(const vtkKWUserInterfaceManager&); // Not implemented
void operator=(const vtkKWUserInterfaceManager&); // Not Implemented
};
#endif
|