Choreonoid  1.5
Plugin.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_PLUGIN_H
6 #define CNOID_BASE_PLUGIN_H
7 
8 #include "ExtensionManager.h"
9 #include "exportdecl.h"
10 
11 namespace cnoid {
12 
13 class Item;
14 class View;
15 class ToolBar;
16 class PluginImpl;
17 
19 {
20 public:
21  typedef Plugin* (*PluginEntry)();
22 
23  Plugin(const char* name);
24  virtual ~Plugin();
25 
26  const char* name();
27 
28  virtual bool initialize();
29  virtual bool finalize();
30 
31  bool isUnloadable() const;
32 
33  const char* requisite(int index) const;
34  int numRequisites() const;
35 
36  const char* subsequence(int index) const;
37  int numSubsequences() const;
38 
39  const char* oldName(int index) const;
40  int numOldNames() const;
41 
42  virtual const char* description() const;
43 
44  int activationPriority() const;
45 
46 protected:
47  void setPluginScope(Item* item);
48  void setPluginScope(View* view);
49  void setPluginScope(ToolBar* toolBar);
50 
51  void setUnloadable(bool on);
52 
53  void require(const char* pluginName);
54  void precede(const char* pluginName);
55 
63  void setActivationPriority(int priority);
64 
69  void addOldName(const char* name);
70 
71 #ifdef CNOID_BACKWARD_COMPATIBILITY
72  void depend(const char* pluginName);
73 #endif
74 
75  static const char* LGPLtext();
76 
77 private:
78  Plugin(const Plugin& org); // disable the copy constructor
79 
80  PluginImpl* impl;
81 
82 };
83 }
84 
85 
86 #define CNOID_IMPLEMENT_PLUGIN_ENTRY(PluginTypeName) \
87  extern "C" CNOID_BASE_DLLEXPORT cnoid::Plugin* getChoreonoidPlugin() \
88  { \
89  return new PluginTypeName(); \
90  }
91 
92 #endif
Definition: ExtensionManager.h:26
Definition: Plugin.h:18
Definition: ToolBar.h:22
Definition: Item.h:38
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
const char * LGPLtext()
Definition: Licenses.cpp:5
Definition: View.h:28
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37