InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ToolInfo.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Yeming Liu
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __TOOLINFO__
25 #define __TOOLINFO__
26 
32 typedef enum { kNonePriority = -1, kLowPriority = 0, kMediumPriority, kHighPriority } ToolInfoPriority;
33 
38 {
39  public:
40  typedef object_type data_type;
41 
44  NonSelectionToolInfo() : fPriority(kNonePriority) {}
45 
46  /* Contruct object with given values.
47  @param toolType IN ClassID for tool.
48  @param protocol IN protocol when there is no selection.
49  @param widgetID IN widgetID for the panel when there is no selection.
50  @param priority IN determine which panel should be loaded if one tool has multiple panels associated with.
51  */
53  (
54  const ClassID& toolType,
55  const PMIID& protocol,
56  const WidgetID& widgetID,
57  const ToolInfoPriority priority
58  ):fToolType(toolType),
59  fProtocol(protocol),
60  fWidgetID(widgetID),
61  fPriority(priority) { }
62 
67  bool16 operator==(const NonSelectionToolInfo& other) const
68  {
69  return ( (fToolType == other.fToolType) &&
70  (fProtocol == other.fProtocol) &&
71  (fWidgetID == other.fWidgetID) &&
72  (fPriority == other.fPriority) );
73  }
74 
79 
84 
89 
93  ToolInfoPriority fPriority;
94 };
95 
100 {
101  public:
102  typedef object_type data_type;
103 
106  SelectionToolInfo() : fSelectionPriority(kNonePriority), fNonSelectionPriority(kNonePriority) {}
107 
115  (
116  const ClassID& toolType, // class ID for tool
117  const PMIID& selectionProtocol, // protocol when there is selection
118  const PMIID& nonSelectionProtocol, // protocol when there is no selection
119  const WidgetID& selectionWidgetID, // widgetID for the panel when there is selection
120  const WidgetID& nonSelectionWidgetID, // widgetID for the panel when there is no selection
121  const ToolInfoPriority selectionPriority, // priority as to display the panel when there is selection
122  const ToolInfoPriority nonSelectionPriority // priority as to display the panel when there is no selection
123  ):fToolType(toolType),
124  fSelectionProtocol(selectionProtocol),
125  fNonSelectionProtocol(nonSelectionProtocol),
126  fSelectionWidgetID(selectionWidgetID),
127  fNonSelectionWidgetID(nonSelectionWidgetID),
128  fSelectionPriority(selectionPriority),
129  fNonSelectionPriority(nonSelectionPriority) { }
130 
135  bool16 operator==(const SelectionToolInfo& other) const
136  {
137  return ( (fToolType == other.fToolType) &&
138  (fSelectionProtocol == other.fSelectionProtocol) &&
139  (fNonSelectionProtocol == other.fNonSelectionProtocol) &&
140  (fSelectionWidgetID == other.fSelectionWidgetID) &&
141  (fNonSelectionWidgetID == other.fNonSelectionWidgetID) &&
142  (fSelectionPriority == other.fSelectionPriority) &&
143  (fNonSelectionPriority == other.fNonSelectionPriority) );
144  }
145 
146  ClassID fToolType;
147  PMIID fSelectionProtocol;
148  PMIID fNonSelectionProtocol;
149  WidgetID fSelectionWidgetID;
150  WidgetID fNonSelectionWidgetID;
151  ToolInfoPriority fSelectionPriority;
152  ToolInfoPriority fNonSelectionPriority;
153 };
154 
155 #endif //__TOOLINFO__