InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ProgressBar.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Dave Burnard (was 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 __ProgressBar__
25 #define __ProgressBar__
26 
27 #include "IProgressBarManager.h"
28 #include "IProgressBarControlData.h"
29 
30 class PMString; // foward decl
31 class IDrawMgr;
32 class IDocWindowProgressBar;
33 
34 
35 
39 {
40 public:
41  CProgressBar();
42  virtual ~CProgressBar() {}
43 
45  virtual bool16 WasCancelled(bool8 setGlobalErrorState = kTrue) = 0;
46 
51  virtual void Abort() = 0;
52 
54  virtual void DisableChildProgressBars(bool16 disable) = 0;
55 
59  virtual bool16 WasRegisterSuccessful() = 0;
60 
62  virtual void SetPosition(int32 newPosition);
63 
64 private:
65  int32 nVTTest;
66 };
67 
72 {
73 protected:
85  BaseProgressBar( int32 nType,
86  const PMString& progressDialogTitle,
87  int32 taskStart,
88  int32 taskEnd,
89  bool8 showImmediate,
90  bool8 showCancel,
91  IProgressBarControlData* customProgress,
92  bool32 useTwoBars);
93 
94 public:
95  virtual ~BaseProgressBar();
96 
98  bool16 WasCancelled(bool8 setGlobalErrorState = kTrue);
99 
104  void Abort();
105 
107  void DisableChildProgressBars(bool16 disable);
108 
112  bool16 WasRegisterSuccessful();
113 
115  void SetPosition(int32 newPosition);
116 
117 protected:
118  IProgressBarManager* fProgressMgr;
119  int32 fnBarID;
120 };
121 
126 {
127 public:
137  DocWindowProgressBar( int32 nStart, int32 nEnd, const PMString& strText, IDrawMgr* pMgr, bool32 bAllowCancel = kTrue, bool32 bShowImmediate = kFalse);
139 
141  virtual bool16 WasCancelled(bool8 setGlobalErrorState = kTrue);
142 
147  virtual void Abort();
148 
150  virtual void DisableChildProgressBars(bool16 disable);
151 
155  virtual bool16 WasRegisterSuccessful();
156 
158  virtual void SetPosition(int32 newPosition);
159 
160 private:
161  IDocWindowProgressBar* fProgressBarImpl;
162 };
163 
168 {
169 public:
179  TaskProgressBar(const PMString& title, int32 numTasks, bool8 showImmediate = kFalse,
180  bool8 showCancel = kTrue, IProgressBarControlData* customProgress = nil, bool32 useTwoBars = kFalse);
181  virtual ~TaskProgressBar();
182 
184  void DoTask(const PMString& displayText = "", int32 advanceNtasks = 1);
185 
187  void SetTaskStatus(const PMString& displayText = "");
188 };
189 
194 {
195 public:
206  RangeProgressBar(const PMString& title, int32 startRange, int32 endRange, bool8 showImmediate = kFalse,
207  bool8 showCancel = kTrue, IProgressBarControlData* customProgress = nil, bool32 useTwoBars = kFalse,std::function<void()> callback=nullptr);
208  virtual ~RangeProgressBar();
209 
211  void SetTaskText(const PMString& text, bool16 forceRedraw = kTrue);
212 };
213 
229 {
230 public:
237  SubTaskFoldupProgressBar(const PMString& strText,
238  int32 startRange,
239  int32 endRange);
240  virtual ~SubTaskFoldupProgressBar();
241 
242 public:
244  void SetTaskText(const PMString& strText, bool16 forceRedraw = kTrue);
245 };
246 
254 {
255  public:
257  SuppressProgressBarDisplay(bool16 suppressDisplay = kTrue);
258  virtual ~SuppressProgressBarDisplay();
259 
261  static bool16 IsSuppressed();
262 
263  protected:
264  IProgressBarManager* fProgressMgr;
265 
266 };
267 
268 
269 #endif