InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AsyncWork.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Paul Messmer
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 __ASYNCWORK__
25 #define __ASYNCWORK__
26 
27 //--------------------------------------------------------------------------------------
32 {
33 public:
34 
35  enum Priority
36  {
37  kLowestPriority = 0,
38 
39  kLowPriority = 0,
40  kNormalPriority = 1,
41  kHighPriority = 2,
42 
43  kHighestPriority = 2,
44 
45  kReservedForceCompletionPriority = 3, // clients shouldn't use; this level is used by IAsyncWorkManager::WaitForCompletion
46  };
55  virtual ~AsyncWorkPacket () {}
56 };
57 
58 //--------------------------------------------------------------------------------------
59 
60 typedef uint64 AsyncWorkPacketID;
61 typedef void (*AsyncWorkCompletionCallback) (AsyncWorkPacket *completedPacket);
62 
63 const AsyncWorkPacketID kInvalidAsyncWorkPacketID((uint64) -1);
64 
65 //--------------------------------------------------------------------------------------
66 
72 {
73 public:
74 
75  virtual ~AsyncWorkProcessor () {} // virtual destructor because the architecture deletes these
76 
77  virtual void ProcessPacket (AsyncWorkPacket *packetToProcess) = 0;
78 };
79 
80 //--------------------------------------------------------------------------------------
81 
82 #endif // __ASYNCWORK__