InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IWidgetCreator.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Bernd Paradies
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 __IWidgetCreator__
25 #define __IWidgetCreator__
26 
27 #include "IPMUnknown.h"
28 #include "widgetid.h"
29 
30 class IControlView;
31 
32 //----------------------------------------------------------------------------------------
33 // Interface IWidgetCreator
34 //----------------------------------------------------------------------------------------
35 
71 class IWidgetCreator : public IPMUnknown
72 {
73 public:
74  enum { kDefaultIID = IID_IWIDGETCREATOR };
75 
76 
82  virtual IControlView * CreateChildOf( IControlView *pParent ) = 0;
83 
84 
90  virtual IControlView * QueryWidget( IControlView *pParent = 0 ) = 0;
91 
96  virtual ClassID GetWidgetClassID() const = 0;
97 
102  virtual WidgetID GetWidgetID() const = 0;
103 
108  inline IControlView * QueryChildOf( IControlView *pParent );
109 
113  virtual void RecalcWidget() = 0;
114 };
115 
116 //---------------------------------------------------------------
117 // inline CWidgetCreator::QueryChildOf
118 //---------------------------------------------------------------
119 
121 {
122  IControlView *pView = this->QueryWidget( pParent );
123  if( !pView )
124  pView = CreateChildOf( pParent );
125  return pView;
126 }
127 
128 #endif
129