ctkPluginPrivate_p.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #ifndef CTKPLUGINPRIVATE_P_H
  2. #define CTKPLUGINPRIVATE_P_H
  3. #include "ctkPlugin.h"
  4. #include "ctkPluginException.h"
  5. #include <QHash>
  6. namespace ctk {
  7. class PluginActivator;
  8. class PluginArchiveInterface;
  9. class PluginFrameworkContext;
  10. class PluginPrivate {
  11. public:
  12. /**
  13. * Construct a new plugin based on a PluginArchive.
  14. *
  15. * @param fw PluginFrameworkContext for this plugin.
  16. * @param ba Plugin archive representing the shared library and cached data
  17. * @param checkContext AccessConrolContext to do permission checks against.
  18. * @exception std::invalid_argument Faulty manifest for bundle
  19. */
  20. PluginPrivate(PluginFrameworkContext* fw,
  21. PluginArchiveInterface* ba /*, Object checkContext*/);
  22. /**
  23. * Construct a new empty Plugin.
  24. *
  25. * Only called for the system plugin
  26. *
  27. * @param fw Framework for this plugin.
  28. */
  29. PluginPrivate(PluginFrameworkContext* fw,
  30. int id,
  31. QString loc,
  32. QString sym,
  33. const Version& ver);
  34. virtual ~PluginPrivate();
  35. QHash<QString, QString> getHeaders(const QString& locale);
  36. protected:
  37. /**
  38. * Union of flags allowing plugin class access
  39. */
  40. static const Plugin::States RESOLVED_FLAGS;
  41. PluginFrameworkContext * const fwCtx;
  42. /**
  43. * Plugin identifier
  44. */
  45. const int id;
  46. /**
  47. * Plugin symbolic name
  48. */
  49. QString symbolicName;
  50. /**
  51. * Plugin version
  52. */
  53. Version version;
  54. /**
  55. * State of the plugin
  56. */
  57. Plugin::States state;
  58. /**
  59. * PluginContext for the plugin
  60. */
  61. PluginContext* pluginContext;
  62. /**
  63. * PluginActivator for the plugin
  64. */
  65. PluginActivator* pluginActivator;
  66. /**
  67. * Stores the default locale entries when uninstalled
  68. */
  69. QHash<QString, QString> cachedHeaders;
  70. /**
  71. * Stores the raw manifest headers
  72. */
  73. QHash<QString, QString> cachedRawHeaders;
  74. bool lazyActivation;
  75. /** True during the finalization of an activation. */
  76. bool activating;
  77. /** True during the state change from active to resolved. */
  78. bool deactivating;
  79. /** Saved exception of resolve failure */
  80. PluginException resolveFailException;
  81. };
  82. }
  83. #endif // CTKPLUGINPRIVATE_P_H