InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
InterruptOnlyProgressBar.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 __InterruptOnlyProgressBar__
25 #define __InterruptOnlyProgressBar__
26 
27 #include "ProgressBar.h"
28 
29 class DrawInterrupter;
30 
31 
32 // all this does is check for key/mouse interrupts, and return WasCancelled == true if
33 // they occur. It doesn't display a progress UI.
35 {
36 public:
37  CInterruptOnlyProgressImpl(): fpInterrupt(nil) {};
39 
40  // Check this to see if the user cancelled the action
41  virtual bool16 WasCancelled(bool8 setGlobalErrorState = kTrue);
42 
43  // Call this anytime during the tasks to immediately terminate
44  // the entire progress bar process. Usually called when an
45  // error condition is encountered during one of the sub tasks.
46  virtual void Abort() {}
47 
48  //Enabling this will keep any subsequent progress bars from subdividing your progress bar
49  virtual void DisableChildProgressBars(bool16 /*disable*/) {};
50 
51  //Not usually necessary to call this. It will return whether or not the registration of this progress
52  //bar was successful(reasons for failure include another progress bar calling DisableChildProgressBars())
53  virtual bool16 WasRegisterSuccessful() { return kTrue; }
54 
55  // Call this to set the position of the progressbar to a location within the specified range
56  virtual void SetPosition(int32) {}
57 
58 private:
59  DrawInterrupter* fpInterrupt;
60 };
61 
62 
63 #endif