ctkPluginConstants.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) 2010 German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKPLUGINCONSTANTS_H
  16. #define CTKPLUGINCONSTANTS_H
  17. #include <QString>
  18. #include "CTKPluginFrameworkExport.h"
  19. namespace ctk {
  20. struct CTK_PLUGINFW_EXPORT PluginConstants {
  21. /**
  22. * Location identifier of the CTK <i>system plugin</i>, which is defined
  23. * to be &quot;System Plugin&quot;.
  24. */
  25. static const QString SYSTEM_PLUGIN_LOCATION; // = "System Plugin"
  26. /**
  27. * Alias for the symbolic name of the CTK <i>system plugin</i>. It is
  28. * defined to be &quot;system.plugin&quot;.
  29. *
  30. */
  31. static const QString SYSTEM_PLUGIN_SYMBOLICNAME; // = "system.plugin"
  32. /**
  33. * Specifies the persistent storage area used by the framework. The value of
  34. * this property must be a valid file path in the file system to a
  35. * directory. If the specified directory does not exist then the framework
  36. * will create the directory. If the specified path exists but is not a
  37. * directory or if the framework fails to create the storage directory, then
  38. * framework initialization must fail. The framework is free to use this
  39. * directory as it sees fit. This area can not be shared with anything else.
  40. * <p>
  41. * If this property is not set, the framework should use a reasonable
  42. * platform default for the persistent storage area.
  43. */
  44. static const QString FRAMEWORK_STORAGE; // = "org.commontk.pluginfw.storage"
  45. /**
  46. * Manifest header identifying the plugin's symbolic name.
  47. *
  48. * <p>
  49. * The attribute value may be retrieved from the <code>QHash</code>
  50. * object returned by the <code>Plugin::getHeaders()</code> method.
  51. */
  52. static const QString PLUGIN_SYMBOLICNAME; // = "Plugin-SymbolicName"
  53. /**
  54. * Manifest header identifying the plugin's copyright information.
  55. * <p>
  56. * The attribute value may be retrieved from the <code>QHash</code>
  57. * object returned by the <code>Plugin::getHeaders</code> method.
  58. */
  59. static const QString PLUGIN_COPYRIGHT; // = "Plugin-Copyright"
  60. /**
  61. * Manifest header containing a brief description of the plugin's
  62. * functionality.
  63. * <p>
  64. * The attribute value may be retrieved from the <code>QHash</code>
  65. * object returned by the <code>Plugin::getHeaders</code> method.
  66. */
  67. static const QString PLUGIN_DESCRIPTION; // = "Plugin-Description"
  68. /**
  69. * Manifest header identifying the plugin's name.
  70. * <p>
  71. * The attribute value may be retrieved from the <code>QHash</code>
  72. * object returned by the <code>Plugin::getHeaders</code> method.
  73. */
  74. static const QString PLUGIN_NAME; // = "Plugin-Name"
  75. /**
  76. * Manifest header identifying the base name of the plugin's Qt .qm
  77. * files.
  78. *
  79. * <p>
  80. * The attribute value may be retrieved from the <code>QHash</code>
  81. * object returned by the <code>Plugin::getHeaders</code> method.
  82. *
  83. * @see #PLUGIN_LOCALIZATION_DEFAULT_BASENAME
  84. */
  85. static const QString PLUGIN_LOCALIZATION; // = "Plugin-Localization"
  86. /**
  87. * Default value for the <code>Plugin-Localization</code> manifest header.
  88. *
  89. * @see #PLUGIN_LOCALIZATION
  90. */
  91. static const QString PLUGIN_LOCALIZATION_DEFAULT_BASENAME; // = "CTK-INF/l10n/plugin"
  92. /**
  93. * Manifest header identifying the symbolic names of other plugins required
  94. * by the plugin.
  95. *
  96. * <p>
  97. * The attribute value may be retrieved from the <code>QHash</code>
  98. * object returned by the <code>Plugin::getHeaders</code> method.
  99. *
  100. */
  101. static const QString REQUIRE_PLUGIN; // = "Require-Plugin"
  102. /**
  103. * Manifest header attribute identifying a range of versions for a plugin
  104. * specified in the <code>Require-Plugin</code> manifest headers.
  105. * The default value is <code>0.0.0</code>.
  106. *
  107. * <p>
  108. * The attribute value is encoded in the Require-Plugin manifest header
  109. * like:
  110. *
  111. * <pre>
  112. * Require-Plugin: com.acme.module.test; plugin-version=&quot;1.1&quot;
  113. * Require-Plugin: com.acme.module.test; plugin-version=&quot;[1.0,2.0)&quot;
  114. * </pre>
  115. *
  116. * <p>
  117. * The plugin-version attribute value uses a mathematical interval notation
  118. * to specify a range of plugin versions. A plugin-version attribute value
  119. * specified as a single version means a version range that includes any
  120. * plugin version greater than or equal to the specified version.
  121. *
  122. * @see #REQUIRE_PLUGIN
  123. */
  124. static const QString PLUGIN_VERSION_ATTRIBUTE; // = "plugin-version"
  125. /**
  126. * Manifest header identifying the plugin's version.
  127. *
  128. * <p>
  129. * The attribute value may be retrieved from the <code>QHash</code>
  130. * object returned by the <code>Plugin::getHeaders()</code> method.
  131. */
  132. static const QString PLUGIN_VERSION; // = "Plugin-Version"
  133. /**
  134. * Manifest header identifying the plugin's activation policy.
  135. * <p>
  136. * The attribute value may be retrieved from the <code>QHash</code>
  137. * object returned by the <code>Plugin::getHeaders()</code> method.
  138. *
  139. * @see #ACTIVATION_EAGER
  140. */
  141. static const QString PLUGIN_ACTIVATIONPOLICY; // = "Plugin-ActivationPolicy"
  142. /**
  143. * Plugin activation policy declaring the plugin must be activated when the
  144. * first object is instantiated from the plugin.
  145. * <p>
  146. * A plugin with the lazy (default) activation policy
  147. * will wait in the Plugin#STARTING state until the first
  148. * class instantiation from the plugin occurs. The plugin will then be activated
  149. * before the instance is returned to the requester.
  150. * <p>
  151. * A plugin with the eager activation policy that is started with the
  152. * Plugin#START_ACTIVATION_POLICY option will be activating immediately when
  153. * the framework is started.
  154. * <p>
  155. * The activation policy value is specified as in the
  156. * Plugin-ActivationPolicy manifest header like:
  157. *
  158. * <pre>
  159. * Plugin-ActivationPolicy: eager
  160. * </pre>
  161. *
  162. * @see #PLUGIN_ACTIVATIONPOLICY
  163. * @see Plugin#start(int)
  164. * @see Plugin#START_ACTIVATION_POLICY
  165. */
  166. static const QString ACTIVATION_EAGER; // = "eager"
  167. /**
  168. * Manifest header directive identifying the resolution type in the
  169. * Require-Plugin manifest header. The default value is
  170. * {@link #RESOLUTION_MANDATORY mandatory}.
  171. *
  172. * <p>
  173. * The directive value is encoded in the Require-Plugin
  174. * manifest header like:
  175. *
  176. * <pre>
  177. * Require-Plugin: com.acme.module.test; resolution:=&quot;optional&quot;
  178. * </pre>
  179. *
  180. * @see #REQUIRE_PLUGIN
  181. * @see #RESOLUTION_MANDATORY
  182. * @see #RESOLUTION_OPTIONAL
  183. */
  184. static const QString RESOLUTION_DIRECTIVE; // = "resolution"
  185. /**
  186. * Manifest header directive value identifying a mandatory resolution type.
  187. * A mandatory resolution type indicates that the required plugin
  188. * must be resolved when the plugin is resolved. If such a
  189. * require plugin cannot be resolved, the module fails to resolve.
  190. *
  191. * <p>
  192. * The directive value is encoded in the Require-Plugin
  193. * manifest header like:
  194. *
  195. * <pre>
  196. * Require-Plugin: com.acme.module.test; resolution:=&quot;manditory&quot;
  197. * </pre>
  198. *
  199. * @see #RESOLUTION_DIRECTIVE
  200. */
  201. static const QString RESOLUTION_MANDATORY; // = "mandatory"
  202. /**
  203. * Manifest header directive value identifying an optional resolution type.
  204. * An optional resolution type indicates that the require plugin
  205. * is optional and the plugin may be resolved without the require
  206. * plugin being resolved. If the require plugin is not resolved
  207. * when the plugin is resolved, therequire plugin may not be
  208. * resolved before the plugin is refreshed.
  209. *
  210. * <p>
  211. * The directive value is encoded in the Require-Plugin
  212. * manifest header like:
  213. *
  214. * <pre>
  215. * Require-Plugin: com.acme.module.test; resolution:=&quot;optional&quot;
  216. * </pre>
  217. *
  218. * @see #RESOLUTION_DIRECTIVE
  219. */
  220. static const QString RESOLUTION_OPTIONAL; // = "optional"
  221. };
  222. }
  223. #endif // CTKPLUGINCONSTANTS_H