InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpRunnable.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 _SnpRunnable_
25 #define _SnpRunnable_
26 
27 // General includes:
28 #include "BaseType.h"
29 
30 // Project includes:
31 #include "SnipRunID.h"
32 #include "IActiveContext.h"
33 #include "ISnpRunnableContext.h"
34 #include "SnpReferenceMacros.h"
35 #include "ISnipRunSuite.h"
36 
52 {
53  public:
58  SnpRunnable(ConstCString name);
59 
63  virtual ~SnpRunnable();
64 
68  virtual ConstCString GetName() const {return fName;}
69 
73  virtual ConstCString GetDescription() const {return fDescription;}
74 
79  virtual ConstCString GetPreconditions() const {return fPreconditions;};
80 
85  virtual ConstCString GetCategories() const {return fCategories;}
86 
94  virtual bool16 CanRun(ISnpRunnableContext* runnableContext) = 0;
95 
101  virtual ErrorCode Run(ISnpRunnableContext* runnableContext) = 0;
102 
108  virtual ErrorCode RunUnitTest(ISnpRunnableContext* runnableContext);
109 
133  virtual bool16 CanLoad() const {return kTrue;}
134 
143  virtual ErrorCode SetupContext(ISnpRunnableContext* runnableContext);
144 
150 
151  protected:
152  // The protected methods in this section must be called
153  // by the derived class's constructor. The strings a snippet
154  // author provides will be made available via ISnipRunSuite
155  // and displayed in the UI.
156 
161  virtual void SetDescription(ConstCString description) {fDescription = description;}
167  virtual void SetPreconditions(ConstCString preconditions) {fPreconditions = preconditions;}
174  virtual void SetCategories(ConstCString categories) {fCategories = categories;}
175 
176  private:
177  ConstCString fName;
178  ConstCString fDescription;
179  ConstCString fPreconditions;
180  ConstCString fCategories;
181 };
182 
183 #endif // SnpRunnable
184 
185 // End, SnpRunnable.h
186