InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPlugIn.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Robin_Briggs
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 __IPLUGIN__
25 #define __IPLUGIN__
26 
27 class ISession;
28 class IPlugIn;
29 class IDocument;
30 
35 typedef IPlugIn *(*GetPlugInFunc)();
36 
37 
84 class IPlugIn {
85 public:
89  typedef enum { kUnknownThreadingPolicy=0, kMainThreadOnly=1, kMultipleThreads=2 } ThreadingPolicy;
99  virtual bool16 Load(ISession* theSession) = 0;
100 
110  virtual bool16 Unload() = 0;
111 
121  virtual bool16 LoadAtStartup() = 0;
122 
131  virtual bool16 CanUnload() const = 0;
132 
141  virtual void FixUpData(IDocument *doc) = 0;
142 
147  virtual PluginID GetPluginID() const = 0;
148 
150  // Called by the ObjectModel to inform the plugin of it's pluginID.
151  // do not override this method -- use the default implementation in PlugIn.
152  virtual void SetPluginID(PluginID pluginID) = 0;
153 
154 #ifdef MACINTOSH
155 
156  // Called by the ObjectModel to inform the plugin of it's CFBundleRef.
157  // do not override this method -- use the default implementation in PlugIn.
158  virtual void SetBundleRef(CFBundleRef bundle) = 0;
159 #endif
160 
162  // Returns the resource file of the plugin. You should not need
163  // to override this method -- use the default implementation in PlugIn.
164  virtual IDFile GetResourceFile() const = 0;
165 
167  // The plugin should install the factory methods for the
168  // classes it contains. You should not need to override
169  // this method -- use the default implementation in PlugIn.
170  virtual void LoadFactories(PluginID ownerComponent, ISession *theSession) = 0;
171 
172 
173 protected:
174  virtual ~IPlugIn();
175 };
176 
177 
178 #endif // __IPLUGIN__