InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CDialogController.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Dave Burnard (was Tom Taylor)
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 __CDialogController__
25 #define __CDialogController__
26 
27 #include "IDialogController.h"
28 #include "CPMUnknown.h"
29 
30 #ifdef WIDGET_BUILD
31 #endif
32 
38 class CDialogController : public CPMUnknown<IDialogController>
39 {
40 public:
41  // ----- Initialization -----
42 
44  virtual ~CDialogController();
45 
46  // ----- Dialog protocol -----
47 private:
48  friend class QAFontDlgController; //SEIssue fix this
49 
50  // Framework Only - Don't call or override these, they call the protected XXXFields methods below.
51  virtual WidgetID ValidateDialog();
52  virtual void ApplyDialog( const WidgetID& widgetId);
53  virtual void ResetDialog();
54  virtual void DialogClosing();
55  virtual void InitializeDialog(IActiveContext* context);
56 
57  // Deprecated: These are declared here just to cause compiler errors in existing code.
58  virtual int ApplyFields(const WidgetID& /*widgetId*/) const {ASSERT_FAIL("Implement ApplyDialogFields instead"); return 0;}
59  virtual char* ValidateFields() const {ASSERT_FAIL("Implement ValidateDialogFields instead"); return 0;}
60  virtual int ResetFields() const {ASSERT_FAIL("Implement ResetDialogFields instead"); return 0;}
61  virtual int InitializeFields() const {ASSERT_FAIL("Implement InitializeDialogFields instead"); return 0;}
62 
63 protected:
69  virtual void InitializeDialogFields(IActiveContext* context);
70 
80  virtual WidgetID ValidateDialogFields(IActiveContext* myContext);
81 
88  virtual void ApplyDialogFields(IActiveContext* myContext, const WidgetID& widgetId);
89 
96  virtual void ResetDialogFields(IActiveContext* myContext);
97 
98 public:
102  virtual void UserCancelled();
103 
107  virtual void ClosingDialog(IActiveContext* lastChanceToUseMyContext);
108 
109  // ----- Dialog query methods -----
110 
112  virtual bool16 HasBeenInitialized() const;
113 
115  virtual void SetInitialized(bool16 initialized);
116 
117  // ----- Owner query methods -----
118 
122  virtual void SetOwner(IControlView* ownerPanel);
123 
127  virtual IControlView* GetOwner() const;
128 
129  // ----- Previewable dialog methods -----
130 
135  virtual void GetName(PMString& name);
136 
139 
141  virtual void SetTextControlData(const WidgetID& widgetId, const PMString& text, const IPanelControlData* panel = nil, bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue);
143  virtual PMString GetTextControlData(const WidgetID& widgetId, const IPanelControlData* panel = nil) const;
144 
146  virtual void SetTextValue(const WidgetID& widgetId, const PMReal& value, const IPanelControlData* panel = nil, bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue);
148  virtual PMReal GetTextValue(const WidgetID& widgetId, const IPanelControlData* panel = nil, bool16 *outParsingError = nil,bool16 *outIsBlank = nil) const;
150  virtual void SetTextValueControlState(const WidgetID& widgetId, ITextValue::TextControlState controlState, const IPanelControlData* panel = nil, bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue);
152  virtual ITextValue::TextControlState GetTextValueControlState(const WidgetID& widgetId, const IPanelControlData* panel = nil) const;
153  // Helper methods for easily setting and getting the value from a
154  // widget(editbox) that has an ITextValue interface
155 
157  virtual void SetBooleanControlData(const WidgetID& widgetId, bool16 isChecked, const IPanelControlData* panel = nil, bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue);
159  virtual bool16 GetBooleanControlData(const WidgetID& widgetId, const IPanelControlData* panel = nil) const;
160 
162  virtual void SetTriStateControlData(const WidgetID& widgetId, bool16 isSelected, const IPanelControlData* panel = nil, bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue);
164  virtual void SetTriStateControlData(const WidgetID& widgetId, ITriStateControlData::TriState triState, const IPanelControlData* panel = nil, bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue);
166  virtual ITriStateControlData::TriState GetTriStateControlData(const WidgetID& widgetId, const IPanelControlData* panel = nil) const;
167 
169  virtual WidgetID GetSelectedClusterWidget(WidgetID cluster, const IPanelControlData* panel = nil);
171  virtual void SetSelectedClusterWidget(WidgetID clusterId, WidgetID widgetToSelect, const IPanelControlData* panel = nil, bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue);
172 
174  virtual IStringListControlData* QueryListControlDataInterface(const WidgetID& widgetId, const IPanelControlData* panel = nil) const;
175 
177  virtual IPanelControlData* QueryIfNilElseAddRef(const IPanelControlData* panel) const;
178 
182  virtual void SelectDialogWidget(const WidgetID& widgetId);
183 
185  virtual bool16 GetPreviewModeOn();
187  virtual void SetPreviewModeOn(bool16 bOn);
188 
192 
193 private:
194  bool16 fInitialized;
195  IControlView* fOwner;
196  PMString fName;
197  bool16 fPreviewModeOn;
198  IActiveContext* fDialogContext;
199 };
200 
201 
202 #endif