/usr/include/KWWidgets/vtkKWMostRecentFilesManager.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 | /*=========================================================================
Module: $RCSfile: vtkKWMostRecentFilesManager.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 vtkKWMostRecentFilesManager - a "most recent files" manager.
// .SECTION Description
// This class is basically a manager that acts as a container for a set of
// most recent files.
// It provides methods to manipulate them, load/save them from/to the
// registry, and display them as entries in a menu.
// An instance of this class is created in vtkKWWindowBase
// .SECTION Thanks
// This work is part of the National Alliance for Medical Image
// Computing (NAMIC), funded by the National Institutes of Health
// through the NIH Roadmap for Medical Research, Grant U54 EB005149.
// Information on the National Centers for Biomedical Computing
// can be obtained from http://nihroadmap.nih.gov/bioinformatics.
// .SECTION See Also
// vtkKWWindowBase
#ifndef __vtkKWMostRecentFilesManager_h
#define __vtkKWMostRecentFilesManager_h
#include "vtkKWObject.h"
class vtkKWMostRecentFilesManagerInternals;
class vtkKWMenu;
class KWWidgets_EXPORT vtkKWMostRecentFilesManager : public vtkKWObject
{
public:
static vtkKWMostRecentFilesManager* New();
vtkTypeRevisionMacro(vtkKWMostRecentFilesManager,vtkKWObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Add a most recent file to the list.
// Each most recent file is associated to a target object and a target
// command: when a most recent file is invoked (either programmatically or
// using the most recent files menu), the associated target commmand is
// invoked on the associated target object. If one and/or the other was not
// specified when the most recent file was added, the default target
// object and/or default target command are used.
// An optional label can be specified too.
// This label will be used in the menu if LabelVisibilityInMenu is true.
// The entry is always added at the beginning of the list (thus, becoming
// the most recently used).
virtual void AddFile(
const char *filename,
vtkObject *target_object = NULL,
const char *target_command = NULL,
const char *label = NULL);
// Description:
// Query the files
virtual int GetNumberOfFiles();
virtual const char* GetNthFileName(int idx);
virtual vtkObject* GetNthTargetObject(int idx);
virtual const char* GetNthTargetCommand(int idx);
virtual const char* GetNthLabel(int idx);
// Description:
// Set/Get the default target object and command.
// Each most recent file is associated to a target object and a target
// command: when a most recent file is invoked (either programmatically or
// using the most recent files menu), the associated target commmand is
// invoked on the associated target object. If one and/or the other was not
// specified when the most recent file was added, the default target
// object and default target command are used.
vtkGetObjectMacro(DefaultTargetObject, vtkObject);
virtual void SetDefaultTargetObject(vtkObject *object);
vtkGetStringMacro(DefaultTargetCommand);
virtual void SetDefaultTargetCommand(const char *);
// Description:
// Load/Save up to 'max_nb' most recent files from/to the registry under
// the application's 'reg_key' key.
// The parameter-less methods use RegistryKey as 'reg_key' and
// MaximumNumberOfFilesInRegistry as 'max_nb'.
// Only the filename and target command are saved. When entries are loaded
// make sure DefaultTargetObject is set to a valid object.
virtual void RestoreFilesListFromRegistry();
virtual void SaveFilesToRegistry();
virtual void RestoreFilesListFromRegistry(
const char *reg_key, int max_nb);
virtual void SaveFilesToRegistry(
const char *reg_key, int max_nb);
// Description:
// Set/Get the default registry key the most recent files are saved to or
// loaded from when it is not specified explicitly while calling load/save.
vtkGetStringMacro(RegistryKey);
vtkSetStringMacro(RegistryKey);
// Description:
// Set/Get the default maximum number of recent files in the registry when
// this number is not specified explicitly while calling load/save.
vtkGetMacro(MaximumNumberOfFilesInRegistry, int);
vtkSetMacro(MaximumNumberOfFilesInRegistry, int);
// Description:
// Get a most recent files menu object.
// This menu is updated automatically as entries are added and removed,
// up to MaximumNumberOfFilesInMenu entries.
// It is up to the caller to set its parent, and it should be done as soon as
// possible if there is a need to use this menu.
vtkKWMenu* GetMenu();
// Description:
// Set/Get the maximum number of recent files in the internal most recent
// files menu object (see GetMenu()).
vtkGetMacro(MaximumNumberOfFilesInMenu, int);
virtual void SetMaximumNumberOfFilesInMenu(int);
// Description:
// Set a label for a specific file entry.
// This label will be used in the menu if LabelVisibilityInMenu is true.
virtual void SetFileLabel(const char *filename, const char *label);
// Description:
// Set/Get the label visibility in menu (Off by default).
virtual void SetLabelVisibilityInMenu(int);
vtkBooleanMacro(LabelVisibilityInMenu, int);
vtkGetMacro(LabelVisibilityInMenu, int);
// Description:
// Set/Get the basename visibility in menu (On by default).
// (i.e., instead of "d:/temp/foo.raw", display "d:/temp")
// This setting is ignored per entry if no label is found for that specific
// menu entry (in which case only a directory would be displayed, which makes
// poor sense).
virtual void SetBaseNameVisibilityInMenu(int);
vtkBooleanMacro(BaseNameVisibilityInMenu, int);
vtkGetMacro(BaseNameVisibilityInMenu, int);
// Description:
// Separate path from basename in menu (Off by default).
// (i.e., instead of "d:/temp/foo.raw", display "foo.raw in d:/temp")
virtual void SetSeparatePathInMenu(int);
vtkBooleanMacro(SeparatePathInMenu, int);
vtkGetMacro(SeparatePathInMenu, int);
// Description:
// Disable/Enable the most recent files menu if it is a cascade in its
// parent. If the menu is empty, it will be disabled.
virtual void UpdateMenuStateInParent();
// Description:
// Populate a given menu with up to 'max_nb' most recent files entries.
// You do not need to call this method on GetMenu(), the
// internal menu is updated automatically.
virtual void PopulateMenu(vtkKWMenu*, int max_nb);
// Description:
// Event list
//BTX
enum
{
MenuHasChangedEvent = 24000
};
//ETX
protected:
vtkKWMostRecentFilesManager();
~vtkKWMostRecentFilesManager();
char *DefaultTargetCommand;
vtkObject *DefaultTargetObject;
char *RegistryKey;
int MaximumNumberOfFilesInRegistry;
int MaximumNumberOfFilesInMenu;
int LabelVisibilityInMenu;
int BaseNameVisibilityInMenu;
int SeparatePathInMenu;
//BTX
// PIMPL Encapsulation for STL containers
vtkKWMostRecentFilesManagerInternals *Internals;
friend class vtkKWMostRecentFilesManagerInternals;
//ETX
// Description:
// Add a most recent file to the list (internal, do not update the menu
// or save to the registry).
virtual void AddFileInternal(
const char *filename,
vtkObject *target_object = NULL,
const char *target_command = NULL,
const char *label = NULL);
// Description:
// Update the most recent files menu
virtual void UpdateMenu();
private:
// In private for lazy allocation using GetMenu()
vtkKWMenu *Menu;
vtkKWMostRecentFilesManager(const vtkKWMostRecentFilesManager&); // Not implemented
void operator=(const vtkKWMostRecentFilesManager&); // Not implemented
};
#endif
|