ctkPluginFrameworkFactory.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 CTKPLUGINFRAMEWORKFACTORY_H
  16. #define CTKPLUGINFRAMEWORKFACTORY_H
  17. #include <QHash>
  18. #include <QString>
  19. #include <QVariant>
  20. #include "CTKPluginFrameworkExport.h"
  21. namespace ctk {
  22. class PluginFramework;
  23. class PluginFrameworkContext;
  24. /**
  25. * A factory for creating PluginFramework instances.
  26. */
  27. class CTK_PLUGINFW_EXPORT PluginFrameworkFactory {
  28. public:
  29. typedef QHash<QString, QVariant> Properties;
  30. /**
  31. * Create a new <code>%PluginFrameworkFactory</code> instance.
  32. *
  33. * <p>
  34. * The Properties map is used to configure the PluginFramework. The
  35. * plugin framework instance created with #getFramework() must interpret
  36. * the following properties:
  37. *
  38. * <p>
  39. * <ul><li>PluginConstants::FRAMEWORK_STORAGE</li>
  40. * </ul>
  41. *
  42. * @param initProps The plugin framework configuration properties.
  43. * The PluginFramework instance created with #getFramework()
  44. * must use some reasonable default configuration if certain
  45. * properties are not provided.
  46. */
  47. PluginFrameworkFactory(const Properties& initProps = Properties());
  48. ~PluginFrameworkFactory();
  49. /**
  50. * Create a new PluginFramework instance.
  51. *
  52. * @return A new, configured PluginFramework instance. The plugin
  53. * framework instance must be in the Plugin::INSTALLED state.
  54. */
  55. PluginFramework* getFramework();
  56. private:
  57. PluginFrameworkContext * const fwCtx;
  58. };
  59. }
  60. #endif // CTKPLUGINFRAMEWORKFACTORY_H