Menu

[r2337]: / trunk / Src / IntfFrameMgrs.pas  Maximize  Restore  History

Download this file

224 lines (195 with data), 8.9 kB

  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
{
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/
*
* Copyright (C) 2005-2012, Peter Johnson (www.delphidabbler.com).
*
* $Rev$
* $Date$
*
* Declares interfaces, constants and enumerations required to manage various
* parts of CodeSnip's UI.
}
unit IntfFrameMgrs;
interface
uses
// Delphi
SHDocVw, ActiveX,
// Project
Browser.IntfDocHostUI, DB.USnippet, Compilers.UGlobals, UCommandBars, UView;
const
// Indexes of tabs in Overview Pane
cCategorisedTab = 0;
cAlphabeticTab = 1;
cKindTab = 2; // snippet kind tab
// Identifiers for Overview Pane's command bars
cOverviewToolBar: TCommandBarID = 1;
cOverviewPopupMenu: TCommandBarID = 2;
// Identifiers for Detail Pane's main view command bars
cDetailPopupMenuDefault: TCommandBarID = CONTEXT_MENU_DEFAULT;
cDetailPopupMenuImage: TCommandBarID = CONTEXT_MENU_IMAGE;
cDetailPopupMenuControl: TCommandBarID = CONTEXT_MENU_CONTROL;
cDetailPopupMenuTable: TCommandBarID = CONTEXT_MENU_TABLE;
cDetailPopupMenuTextSelect: TCommandBarID = CONTEXT_MENU_TEXTSELECT;
cDetailPopupMenuAnchor: TCommandBarID = CONTEXT_MENU_ANCHOR;
cDetailPopupMenuUnknown: TCommandBarID = CONTEXT_MENU_UNKNOWN;
cDetailPopupMenuFirst = CONTEXT_MENU_DEFAULT;
cDetailPopupMenuLast = CONTEXT_MENU_UNKNOWN;
// Set of all Detail Pane popup menu command bars
cDetailPopupMenuIDs: TCommandBarIDs =
[cDetailPopupMenuFirst..cDetailPopupMenuLast];
// Identifier for Detail Pane's tab set command bar
// (must be different to all cDetailPopupMenuXXX constants)
cDetailTabSetPopupMenu = Succ(cDetailPopupMenuLast);
////////////////////////////////////////////////////////////////////////////////
// Interfaces that deal with display of snippets and other views //
////////////////////////////////////////////////////////////////////////////////
type
/// <summary>Interface that defines methods for use in managing tab sets.
/// </summary>
ITabbedDisplayMgr = interface(IInterface)
['{5445BF4F-0A02-48E6-A6FA-AE0FFC2F9939}']
/// <summary>Select tab with given index in set.</summary>
procedure SelectTab(const TabIdx: Integer);
/// <summary>Get index of currently selected tab.</summary>
function SelectedTab: Integer;
/// <summary>Switch to next tab in sequence or go to first tab if current
/// tab is last.</summary>
procedure NextTab;
/// <summary>Switch to previous tab in sequence or go to last tab if
/// current tab is first.</summary>
procedure PreviousTab;
end;
type
/// <summary>Interface that defines operations on Detail Pane relating to
/// display of views in one or more tabs.</summary>
IDetailPaneDisplayMgr = interface(IInterface)
['{79F8BCAB-4C3F-4935-B5BF-9E5B9B32D88A}']
/// <summary>Return currently selected view.</summary>
function SelectedView: IView;
/// <summary>Select detail pane tab with given index.</summary>
procedure SelectTab(const TabIdx: Integer);
/// <summary>Find index of tab displaying given view or -1 if no such tab.
/// </summary>
function FindTab(ViewKey: IViewKey): Integer;
/// <summary>Display given view in tab with given index.</summary>
procedure Display(View: IView; const TabIdx: Integer);
/// <summary>Reload the currently displayed views.</summary>
procedure Reload;
/// <summary>Close all tabs and delete all views.</summary>
procedure Clear;
/// <summary>Create a new tab displaying given view and return its index.
/// </summary>
function CreateTab(View: IView): Integer;
/// <summary>Check if tab set is empty, i.e. there are no tabs displayed.
/// </summary>
function IsEmptyTabSet: Boolean;
/// <summary>Close tab at given index.</summary>
procedure CloseTab(const TabIdx: Integer);
/// <summary>Close all tabs, or all except selected tabs, depending on
/// whether KeepSelected is False or True, respectively.</summary>
procedure CloseMultipleTabs(const KeepSelected: Boolean);
end;
type
/// <summary>Enumeration describing the various expand / collapse operations
/// on the nodes of a tree view.</summary>
TTreeNodeAction = (
taExpandNode, // expand selected node
taExpandAll, // expand all nodes
taCollapseNode, // collapse selected node
taCollapseAll // collapse all nodes
);
type
/// <summary>Interface that defines operations on Overview Pane relating to
/// manipulation of, and interaction with, tree view that lists and groups
/// snippets.</summary>
IOverviewDisplayMgr = interface(IInterface)
['{AD5D5A0F-E7D3-4173-A4F9-04D43909B0F5}']
/// <summary>Initialise frame with given tab selected.</summary>
procedure Initialise(const TabIdx: Integer);
/// <summary>Display given list of snippets in the current overview tab.
/// </summary>
/// <remarks>If given snippet list is same as that displayed it may not
/// be redisplayed unless Force parameter is True.</remarks>
procedure Display(const SnippetList: TSnippetList; const Force: Boolean);
/// <summary>Clear the display.</summary>
procedure Clear;
/// <summary>Select given view item in tree view.</summary>
/// <remarks>Pass a nil parameter to deselect current selection.</remarks>
procedure SelectItem(ViewItem: IView);
/// <summary>Update expand / collapse state of tree nodes as specified by
/// State.</summary>
procedure UpdateTreeState(const State: TTreeNodeAction);
/// <summary>Check if tree view can support the expand / collapse request
/// specified in State.</summary>
function CanUpdateTreeState(const State: TTreeNodeAction): Boolean;
/// <summary>Save current expand / collapse state of tree view.
/// </summary>
procedure SaveTreeState;
/// <summary>Restore expand / collapse state of treeview to last save
/// state.</summary>
procedure RestoreTreeState;
end;
type
/// <summary>Interface that defines operations on Detail Pane relating to
/// display of a view item in detail.</summary>
IViewItemDisplayMgr = interface(IInterface)
['{1FE68233-1AD7-44C3-A6C0-3974E0C0455E}']
/// <summary>Display detailed information about given view. Set Reload to
/// to force display to be re-loaded.</summary>
procedure Display(View: IView; Reload: Boolean);
end;
////////////////////////////////////////////////////////////////////////////////
// Other pane-related interfaces //
////////////////////////////////////////////////////////////////////////////////
type
/// <summary>Interface that defines methods implemented by frames that
/// support copying to the clipboard.</summary>
IClipboardMgr = interface(IInterface)
['{328EF9CA-5510-4D77-A570-7F499C0CFA79}']
/// <summary>Check whether anything can currently be copied to the
/// clipboard.</summary>
function CanCopy: Boolean;
/// <summary>Copy data to clipboard.</summary>
/// <remarks>Behaviour when there is no available data is not defined.
/// </remarks>
procedure CopyToClipboard;
end;
type
/// <summary>Interface that defines methods implemented by frames that
/// support selection of text.</summary>
ISelectionMgr = interface(IInterface)
['{70FEFF07-75B5-4A82-A903-3A1B096E1D7C}']
/// <summary>Check whether any text can currently be selected.</summary>
function CanSelectAll: Boolean;
/// <summary>Selects all text.</summary>
/// <remarks>Behaviour when no text can be selected is not defined.
/// </remarks>
procedure SelectAll;
end;
type
/// <summary>Interface that defines operations supported by frames that
/// can customise the behaviour of a hosted web browser control.</summary>
IWBCustomiser = interface(IInterface)
['{B46CDC61-EC43-43E3-838C-73AB8F150E46}']
/// <summary>Use the given object to extend the browser control's 'external
/// object'.</summary>
procedure SetExternalObj(Obj: IDispatch);
/// <summary>Use the given object to handle drag-drop operations for the
/// browser control.</summary>
procedure SetDragDropHandler(Obj: IDropTarget);
end;
type
/// <summary>Interface the defines operations supported by frames to provide
/// information about the state of the UI.</summary>
IPaneInfo = interface(IInterface)
['{AB826763-0589-440D-B849-BE70C6E152D0}']
/// <summary>Check if the frame, or one of its child controls, is currently
/// interactive with the user.</summary>
/// <remarks>This can mean a child control has input focus or a browser
/// control's UI is active.</remarks>
function IsInteractive: Boolean;
end;
implementation
end.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.