ctkPluginConstants.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 "CTKCoreExport.h"
  19. namespace ctk {
  20. struct CTK_CORE_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 version.
  55. *
  56. * <p>
  57. * The attribute value may be retrieved from the <code>QHash</code>
  58. * object returned by the <code>Plugin::getHeaders()</code> method.
  59. */
  60. static const QString PLUGIN_VERSION; // = "Plugin-Version"
  61. /**
  62. * Manifest header identifying the plugin's activation policy.
  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. * @see #ACTIVATION_EAGER
  68. */
  69. static const QString PLUGIN_ACTIVATIONPOLICY; // = "Plugin-ActivationPolicy"
  70. /**
  71. * Plugin activation policy declaring the plugin must be activated when the
  72. * first object is instantiated from the plugin.
  73. * <p>
  74. * A plugin with the lazy (default) activation policy
  75. * will wait in the Plugin#STARTING state until the first
  76. * class instantiation from the plugin occurs. The plugin will then be activated
  77. * before the instance is returned to the requester.
  78. * <p>
  79. * A plugin with the eager activation policy that is started with the
  80. * Plugin#START_ACTIVATION_POLICY option will be activating immediately when
  81. * the framework is started.
  82. * <p>
  83. * The activation policy value is specified as in the
  84. * Plugin-ActivationPolicy manifest header like:
  85. *
  86. * <pre>
  87. * Plugin-ActivationPolicy: eager
  88. * </pre>
  89. *
  90. * @see #PLUGIN_ACTIVATIONPOLICY
  91. * @see Plugin#start(int)
  92. * @see Plugin#START_ACTIVATION_POLICY
  93. */
  94. static const QString ACTIVATION_EAGER; // = "eager"
  95. };
  96. }
  97. #endif // CTKPLUGINCONSTANTS_H