InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnipRunLog.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Adobe Developer Technologies
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 _SnipRunLog_
25 #define _SnipRunLog_
26 
27 // Interface includes:
28 
29 // Forward declarations:
30 class PMString;
31 class ITextControlData;
33 class IPMStream;
34 
45 {
46  friend class SnipRunPanelWidgetObserver;
47 protected:
54  SnipRunLog(const WidgetID& logPanelWidgetID, const WidgetID& logWidgetID, const WidgetID& scrollBarWidgetID);
55 
56 public:
61  static SnipRunLog* Instance();
62 
66  static void DeleteInstance();
67 
70  virtual ~SnipRunLog();
71 
76  void Log(const PMString& message);
77 
81  void Clear();
82 
86  void UpdateTextControl();
87 
92  void SaveLog(InterfacePtr<IPMStream> stream);
93 
97  bool16 GetTrace() const {return fTrace;}
98 
99 
103  void SetTrace(bool16 traceState) {fTrace = traceState;}
104 
110  static SnipRunLog* PeekAtSnipRunLog() {return fSnipRunLog;}
111 
121  void Resize();
122 
126  void ResizeComplete();
127 
128 private:
129  void ScrollToTop();
130  void ScrollToBottom();
131  // return false if the view cannot be initialised (say the panel is hidden)
132  bool16 InitPanelView();
133  void DetachPanelView();
134  static SnipRunLog* fSnipRunLog;
135  InterfacePtr<ITextControlData> fLogTextControlData;
136  InterfacePtr<ICounterControlData> fScrollBarCounterData;
137  PMString fLog;
138  bool16 fTrace;
139  WidgetID fLogWidgetID;
140  WidgetID fLogPanelWidgetID;
141  WidgetID fScrollBarWidgetID;
142 
143  bool16 fPanelInit;
144  bool16 fResizeInProgress;
145  PMString fSavedLog;
146 };
147 
151 extern void SNIPLOG(const char* str, ...);
152 
157 extern void SNIPLOG_ASSERT_FAIL(const char* str, ...);
158 
159 #endif // _SnipRunLog_
160 
161