InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CTreeViewWidgetMgr.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Matt Joss
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 __CTreeViewWidgetMgr__
25 #define __CTreeViewWidgetMgr__
26 
27 #include <map>
28 
29 #include "ITreeViewWidgetMgr.h"
30 #include "IPanelControlData.h"
31 #include "HelperInterface.h"
32 #include "NodeID.h"
33 #include "PMPoint.h"
34 #include "TreeViewDefs.h"
35 #include "RsrcSpec.h"
36 
37 const int32 kDefaultIndent = 20;
38 
39 
40 
41 //----------------------------------------------------------------------------------------
42 // class CTreeViewWidgetMgr
43 //----------------------------------------------------------------------------------------
51 {
52 public:
56 
62  CTreeViewWidgetMgr(IPMUnknown *boss, int32 optionFlags);
66  virtual ~CTreeViewWidgetMgr();
67 
79  virtual bool16 ApplyNodeIDToWidget( const NodeID& node, IControlView* widget, int32 message = 0 ) const;
80 
86  virtual PMReal GetNodeWidgetHeight(const NodeID& node) const;
87 
93  virtual PMReal GetNodeWidgetWidth(const NodeID& node) const;
94 
100  virtual PMReal GetIndentForNode(const NodeID& node) const;
101 
107  virtual IControlView* CreateWidgetForNode(const NodeID& node) const;
108 
122  virtual void SetStyle(int32 styleIdentifier);
123 
127  virtual int32 GetStyle() const;
128 
134  virtual WidgetID GetWidgetTypeForNode(const NodeID& node) const;
135 
143  virtual void PreDeleteWidget( IControlView* widget );
144 
145 protected:
162  virtual bool16 ApplyDataToWidget( const NodeID& node, IPanelControlData* widgetList, int32 message = 0 ) const;
163 
164 
177  virtual void RegisterStyles();
178 
194  virtual void ApplyIndentToWidget( const NodeID& node, IPanelControlData* widgetList, int32 message = 0 ) const;
195  virtual PMReal GetBaseIndentOffset(IControlView* styleWidget) const;
196 
202  virtual PMReal GetTreeViewWidth() const;
203 
204  // Level 6
214  virtual void ApplyHighlightToWidget( const NodeID& node, IControlView* widget, int32 message = 0 ) const;
215 
224  virtual PMReal GetIndent(const NodeID& node) const;
225 
235  virtual void RegisterStyleWidget(int32 style, RsrcID widgetRsrcID, PluginID pluginID);
236 
248  virtual void HideExpanderIfNotExpandable( const NodeID& node, IPanelControlData* widgetList, int32 message = 0 ) const;
249 
250 
257  virtual void SetNodeName( IPanelControlData* widgetList, const PMString& name, WidgetID nameWidget = kTreeNodeNameWidgetID ) const;
258 
266  virtual void SetNodeIcon( IPanelControlData* widgetList, RsrcID iconRsrc, PluginID pluginID = 0, WidgetID iconWidget = kTreeNodeIconWidgetID ) const;
267 
268  typedef enum { kList = 0, kHierarchical = 1} Options; // second 16 bits reserved for PrivateOptions
269 
275  virtual bool16 IsOptionSet( Options option ) const;
276 
277 private:
278 
279  virtual void LazyRegisterStyles() const;
280  virtual void InternalSetStyle(int32 styleIdentifier);
281 
282  typedef enum { kCTreeViewWidgetMgrV2 = 0x0100, kRootNodeDisplayed = 0x0200} PrivateOptions;
283 // std::map<int32, std::pair<RsrcID, PluginID> > fStyleWidgetTable;
284  int32 fOptionFlags;
285  std::map<int32, RsrcSpec > fStyleWidgetTable;
286  int32 fStyle;
287  mutable PMPoint fDefaultWidgetSize;
288  WidgetID fCurrentStyleWidgetID;
289  RsrcSpec fCurrentStyleRsrcSpec;
290  PMReal fBaseIndentOffset;
291 
292 
293 
294 protected:
295  virtual void SetSelectableDlgDrawNodeSeparatorOff(IControlView* widget) const;
296 
297 };
298 
299 
300 
301 #endif