ctkPluginContext.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) 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 CTKPLUGINCONTEXT_H_
  16. #define CTKPLUGINCONTEXT_H_
  17. #include <QHash>
  18. #include <QString>
  19. #include <QVariant>
  20. #include <QUrl>
  21. #include <QSharedPointer>
  22. #include "ctkPluginFramework_global.h"
  23. #include "ctkPluginEvent.h"
  24. #include "ctkPluginFrameworkExport.h"
  25. // CTK class forward declarations
  26. class ctkPlugin;
  27. class ctkPluginPrivate;
  28. class ctkServiceRegistration;
  29. class ctkServiceReference;
  30. class ctkPluginContextPrivate;
  31. /**
  32. * A plugin's execution context within the Framework. The context is used to
  33. * grant access to other methods so that this plugin can interact with the
  34. * Framework.
  35. *
  36. * <p>
  37. * <code>ctkPluginContext</code> methods allow a plugin to:
  38. * <ul>
  39. * <li>Subscribe to events published by the Framework.
  40. * <li>Register service objects with the Framework service registry.
  41. * <li>Retrieve <code>ServiceReferences</code> from the Framework service
  42. * registry.
  43. * <li>Get and release service objects for a referenced service.
  44. * <li>Install new plugins in the Framework.
  45. * <li>Get the list of plugins installed in the Framework.
  46. * <li>Get the {@link ctkPlugin} object for a plugin.
  47. * <li>Create <code>QFile</code> objects for files in a persistent storage
  48. * area provided for the plugin by the Framework.
  49. * </ul>
  50. *
  51. * <p>
  52. * A <code>ctkPluginContext</code> object will be created and provided to the
  53. * plugin associated with this context when it is started using the
  54. * {@link ctkPluginActivator::start} method. The same <code>ctkPluginContext</code>
  55. * object will be passed to the plugin associated with this context when it is
  56. * stopped using the {@link ctkPluginActivator::stop} method. A
  57. * <code>ctkPluginContext</code> object is generally for the private use of its
  58. * associated plugin and is not meant to be shared with other plugins in the
  59. * plugin environment.
  60. *
  61. * <p>
  62. * The <code>ctkPlugin</code> object associated with a <code>ctkPluginContext</code>
  63. * object is called the <em>context plugin</em>.
  64. *
  65. * <p>
  66. * The <code>ctkPluginContext</code> object is only valid during the execution of
  67. * its context plugin; that is, during the period from when the context plugin
  68. * is in the <code>STARTING</code>, <code>STOPPING</code>, and
  69. * <code>ACTIVE</code> plugin states. If the <code>ctkPluginContext</code>
  70. * object is used subsequently, a <code>std::logic_error</code> must be
  71. * thrown. The <code>ctkPluginContext</code> object must never be reused after
  72. * its context plugin is stopped.
  73. *
  74. * <p>
  75. * The Framework is the only entity that can create <code>ctkPluginContext</code>
  76. * objects and they are only valid within the Framework that created them.
  77. *
  78. * @threadsafe
  79. */
  80. class CTK_PLUGINFW_EXPORT ctkPluginContext
  81. {
  82. Q_DECLARE_PRIVATE(ctkPluginContext)
  83. public:
  84. ~ctkPluginContext();
  85. /**
  86. * Returns the value of the specified property. If the key is not found in
  87. * the Framework properties, the system properties are then searched. The
  88. * method returns an invalid QVariant if the property is not found.
  89. *
  90. * @param key The name of the requested property.
  91. * @return The value of the requested property, or an invalid QVariant if
  92. * the property is undefined.
  93. */
  94. QVariant getProperty(const QString& key) const;
  95. /**
  96. * Returns the <code>ctkPlugin</code> object associated with this
  97. * <code>ctkPluginContext</code>. This plugin is called the context plugin.
  98. *
  99. * @return The <code>ctkPlugin</code> object associated with this
  100. * <code>ctkPluginContext</code>.
  101. * @throws std::logic_error If this ctkPluginContext is no
  102. * longer valid.
  103. */
  104. QSharedPointer<ctkPlugin> getPlugin() const;
  105. /**
  106. * Returns the plugin with the specified identifier.
  107. *
  108. * @param id The identifier of the plugin to retrieve.
  109. * @return A <code>ctkPlugin</code> object or <code>0</code> if the
  110. * identifier does not match any installed plugin.
  111. */
  112. QSharedPointer<ctkPlugin> getPlugin(long id) const;
  113. /**
  114. * Returns a list of all installed plugins.
  115. * <p>
  116. * This method returns a list of all plugins installed in the plugin
  117. * environment at the time of the call to this method. However, since the
  118. * Framework is a very dynamic environment, plugins can be installed or
  119. * uninstalled at anytime.
  120. *
  121. * @return A QList of <code>ctkPlugin</code> objects, one object per
  122. * installed plugin.
  123. */
  124. QList<QSharedPointer<ctkPlugin> > getPlugins() const;
  125. /**
  126. * Registers the specified service object with the specified properties
  127. * under the specified class names into the Framework. A
  128. * <code>ctkServiceRegistration</code> object is returned. The
  129. * <code>ctkServiceRegistration</code> object is for the private use of the
  130. * plugin registering the service and should not be shared with other
  131. * plugins. The registering plugin is defined to be the context plugin.
  132. * Other plugins can locate the service by using either the
  133. * {@link #getServiceReferences} or {@link #getServiceReference} method.
  134. *
  135. * <p>
  136. * A plugin can register a service object that implements the
  137. * {@link ctkServiceFactory} interface to have more flexibility in providing
  138. * service objects to other plugins.
  139. *
  140. * <p>
  141. * The following steps are required to register a service:
  142. * <ol>
  143. * <li>If <code>service</code> is not a <code>ctkServiceFactory</code>, an
  144. * <code>std::invalid_argument</code> is thrown if <code>service</code>
  145. * is not an instance of all the specified class names.
  146. * <li>The Framework adds the following service properties to the service
  147. * properties from the specified <code>ServiceProperties</code> (which may be
  148. * omitted): <br/>
  149. * A property named {@link ctkPluginConstants#SERVICE_ID} identifying the
  150. * registration number of the service <br/>
  151. * A property named {@link ctkPluginConstants#OBJECTCLASS} containing all the
  152. * specified classes. <br/>
  153. * Properties with these names in the specified <code>ServiceProperties</code> will
  154. * be ignored.
  155. * <li>The service is added to the Framework service registry and may now be
  156. * used by other plugins.
  157. * <li>A service event of type {@link ServiceEvent#REGISTERED} is fired.
  158. * <li>A <code>ctkServiceRegistration</code> object for this registration is
  159. * returned.
  160. * </ol>
  161. *
  162. * @param clazzes The class names under which the service can be located.
  163. * The class names will be stored in the service's
  164. * properties under the key {@link ctkPluginConstants#OBJECTCLASS}.
  165. * @param service The service object or a <code>ctkServiceFactory</code>
  166. * object.
  167. * @param properties The properties for this service. The keys in the
  168. * properties object must all be <code>QString</code> objects. See
  169. * {@link ctkPluginConstants} for a list of standard service property keys.
  170. * Changes should not be made to this object after calling this
  171. * method. To update the service's properties the
  172. * {@link ctkServiceRegistration::setProperties} method must be called.
  173. * The set of properties may be omitted if the service has
  174. * no properties.
  175. * @return A <code>ctkServiceRegistration</code> object for use by the plugin
  176. * registering the service to update the service's properties or to
  177. * unregister the service.
  178. * @throws std::invalid_argument If one of the following is true:
  179. * <ul>
  180. * <li><code>service</code> is <code>0</code>. <li><code>service
  181. * </code> is not a <code>ctkServiceFactory</code> object and is not an
  182. * instance of all the named classes in <code>clazzes</code>. <li>
  183. * <code>properties</code> contains case variants of the same key
  184. * name.
  185. * </ul>
  186. * @throws std::logic_error If this ctkPluginContext is no longer valid.
  187. * @see ctkServiceRegistration
  188. * @see ctkServiceFactory
  189. */
  190. ctkServiceRegistration* registerService(const QStringList& clazzes, QObject* service, const ServiceProperties& properties = ServiceProperties());
  191. /**
  192. * Returns a list of <code>ctkServiceReference</code> objects. The returned
  193. * list contains services that
  194. * were registered under the specified class and match the specified filter
  195. * expression.
  196. *
  197. * <p>
  198. * The list is valid at the time of the call to this method. However since
  199. * the Framework is a very dynamic environment, services can be modified or
  200. * unregistered at any time.
  201. *
  202. * <p>
  203. * The specified <code>filter</code> expression is used to select the
  204. * registered services whose service properties contain keys and values
  205. * which satisfy the filter expression. See {@link Filter} for a description
  206. * of the filter syntax. If the specified <code>filter</code> is
  207. * empty, all registered services are considered to match the
  208. * filter. If the specified <code>filter</code> expression cannot be parsed,
  209. * an {@link std::invalid_argument} will be thrown with a human readable
  210. * message where the filter became unparsable.
  211. *
  212. * <p>
  213. * The result is a list of <code>ctkServiceReference</code> objects for all
  214. * services that meet all of the following conditions:
  215. * <ul>
  216. * <li>If the specified class name, <code>clazz</code>, is not
  217. * empty, the service must have been registered with the
  218. * specified class name. The complete list of class names with which a
  219. * service was registered is available from the service's
  220. * {@link PlugincConstants::OBJECTCLASS objectClass} property.
  221. * <li>If the specified <code>filter</code> is not empty, the
  222. * filter expression must match the service.
  223. * </ul>
  224. *
  225. * @param clazz The class name with which the service was registered or
  226. * an empty string for all services.
  227. * @param filter The filter expression or empty for all
  228. * services.
  229. * @return A list of <code>ctkServiceReference</code> objects or
  230. * an empty list if no services are registered which satisfy the
  231. * search.
  232. * @throws std::invalid_argument If the specified <code>filter</code>
  233. * contains an invalid filter expression that cannot be parsed.
  234. * @throws std::logic_error If this ctkPluginContext is no longer valid.
  235. */
  236. QList<ctkServiceReference> getServiceReferences(const QString& clazz, const QString& filter = QString());
  237. /**
  238. * Returns a <code>ctkServiceReference</code> object for a service that
  239. * implements and was registered under the specified class.
  240. *
  241. * <p>
  242. * The returned <code>ctkServiceReference</code> object is valid at the time of
  243. * the call to this method. However as the Framework is a very dynamic
  244. * environment, services can be modified or unregistered at any time.
  245. *
  246. * <p>
  247. * This method is the same as calling
  248. * {@link ctkPluginContext::getServiceReferences(const QString&, const QString&)} with an
  249. * empty filter expression. It is provided as a convenience for
  250. * when the caller is interested in any service that implements the
  251. * specified class.
  252. * <p>
  253. * If multiple such services exist, the service with the highest ranking (as
  254. * specified in its {@link ctkPluginConstants::SERVICE_RANKING} property) is returned.
  255. * <p>
  256. * If there is a tie in ranking, the service with the lowest service ID (as
  257. * specified in its {@link ctkPluginConstants::SERVICE_ID} property); that is, the
  258. * service that was registered first is returned.
  259. *
  260. * @param clazz The class name with which the service was registered.
  261. * @return A <code>ctkServiceReference</code> object, or <code>0</code> if
  262. * no services are registered which implement the named class.
  263. * @throws std::logic_error If this ctkPluginContext is no longer valid.
  264. * @throws ctkServiceException It no service was registered under the given class name.
  265. * @see #getServiceReferences(const QString&, const QString&)
  266. */
  267. ctkServiceReference getServiceReference(const QString& clazz);
  268. /**
  269. * Returns the service object referenced by the specified
  270. * <code>ctkServiceReference</code> object.
  271. * <p>
  272. * A plugin's use of a service is tracked by the plugin's use count of that
  273. * service. Each time a service's service object is returned by
  274. * {@link #getService(ctkServiceReference*)} the context plugin's use count for
  275. * that service is incremented by one. Each time the service is released by
  276. * {@link #ungetService(ctkServiceReference*)} the context plugin's use count
  277. * for that service is decremented by one.
  278. * <p>
  279. * When a plugin's use count for a service drops to zero, the plugin should
  280. * no longer use that service.
  281. *
  282. * <p>
  283. * This method will always return <code>0</code> when the service
  284. * associated with this <code>reference</code> has been unregistered.
  285. *
  286. * <p>
  287. * The following steps are required to get the service object:
  288. * <ol>
  289. * <li>If the service has been unregistered, <code>0</code> is returned.
  290. * <li>The context plugin's use count for this service is incremented by
  291. * one.
  292. * <li>If the context plugin's use count for the service is currently one
  293. * and the service was registered with an object implementing the
  294. * <code>ctkServiceFactory</code> interface, the
  295. * {@link ctkServiceFactory::getService(ctkPlugin*, ctkServiceRegistration*)} method is
  296. * called to create a service object for the context plugin. This service
  297. * object is cached by the Framework. While the context plugin's use count
  298. * for the service is greater than zero, subsequent calls to get the
  299. * services's service object for the context plugin will return the cached
  300. * service object. <br>
  301. * If the service object returned by the <code>ctkServiceFactory</code> object
  302. * is not an instance of all the classes named when the service
  303. * was registered or the <code>ctkServiceFactory</code> object throws an
  304. * exception, <code>0</code> is returned and a Framework event of type
  305. * {@link ctkPluginFrameworkEvent::ERROR} containing a {@link ctkServiceException}
  306. * describing the error is fired.
  307. * <li>The service object for the service is returned.
  308. * </ol>
  309. *
  310. * @param reference A reference to the service.
  311. * @return A service object for the service associated with
  312. * <code>reference</code> or <code>0</code> if the service is not
  313. * registered, the service object returned by a
  314. * <code>ctkServiceFactory</code> does not implement the classes under
  315. * which it was registered or the <code>ctkServiceFactory</code> threw
  316. * an exception.
  317. * @throws std::logic_error If this ctkPluginContext is no
  318. * longer valid.
  319. * @throws std::invalid_argument If the specified
  320. * <code>ctkServiceReference</code> was not created by the same
  321. * framework instance as this <code>ctkPluginContext</code>.
  322. * @see #ungetService(ctkServiceReference*)
  323. * @see ctkServiceFactory
  324. */
  325. QObject* getService(ctkServiceReference reference);
  326. /**
  327. * Releases the service object referenced by the specified
  328. * <code>ctkServiceReference</code> object. If the context plugin's use count
  329. * for the service is zero, this method returns <code>false</code>.
  330. * Otherwise, the context plugins's use count for the service is decremented
  331. * by one.
  332. *
  333. * <p>
  334. * The service's service object should no longer be used and all references
  335. * to it should be destroyed when a bundle's use count for the service drops
  336. * to zero.
  337. *
  338. * <p>
  339. * The following steps are required to unget the service object:
  340. * <ol>
  341. * <li>If the context plugin's use count for the service is zero or the
  342. * service has been unregistered, <code>false</code> is returned.
  343. * <li>The context plugin's use count for this service is decremented by
  344. * one.
  345. * <li>If the context plugin's use count for the service is currently zero
  346. * and the service was registered with a <code>ctkServiceFactory</code> object,
  347. * the
  348. * {@link ctkServiceFactory#ungetService(ctkPlugin*, ctkServiceRegistration*, QObject*)}
  349. * method is called to release the service object for the context plugin.
  350. * <li><code>true</code> is returned.
  351. * </ol>
  352. *
  353. * @param reference A reference to the service to be released.
  354. * @return <code>false</code> if the context plugin's use count for the
  355. * service is zero or if the service has been unregistered;
  356. * <code>true</code> otherwise.
  357. * @throws std::logic_error If this ctkPluginContext is no
  358. * longer valid.
  359. * @throws std::invalid_argument If the specified
  360. * <code>ctkServiceReference</code> was not created by the same
  361. * framework instance as this <code>ctkPluginContext</code>.
  362. * @see #getService
  363. * @see ctkServiceFactory
  364. */
  365. bool ungetService(const ctkServiceReference& reference);
  366. /**
  367. * Installs a plugin from the specified <code>QIODevice</code> object.
  368. *
  369. * <p>
  370. * If the specified <code>QIODevice</code> is <code>null</code>, the
  371. * Framework must create the <code>QIODevice</code> from which to read the
  372. * plugin by interpreting, in an implementation dependent manner, the
  373. * specified <code>location</code>.
  374. *
  375. * <p>
  376. * The specified <code>location</code> identifier will be used as the
  377. * identity of the plugin. Every installed plugin is uniquely identified by
  378. * its location identifier which is typically in the form of a URL.
  379. *
  380. * <p>
  381. * The following steps are required to install a plugin:
  382. * <ol>
  383. * <li>If a plugin containing the same location identifier is already
  384. * installed, the <code>ctkPlugin</code> object for that plugin is returned.
  385. *
  386. * <li>The plugin's content is read from the input stream. If this fails, a
  387. * {@link ctkPluginException} is thrown.
  388. *
  389. * <li>The plugin's associated resources are allocated. The associated
  390. * resources minimally consist of a unique identifier and a persistent
  391. * storage area. If this step fails, a <code>ctkPluginException</code>
  392. * is thrown.
  393. *
  394. * <li>The plugin's state is set to <code>INSTALLED</code>.
  395. *
  396. * <li>A plugin event of type {@link ctkPluginEvent#INSTALLED} is fired.
  397. *
  398. * <li>The <code>ctkPlugin</code> object for the newly or previously installed
  399. * plugin is returned.
  400. * </ol>
  401. *
  402. * <b>Postconditions, no exceptions thrown </b>
  403. * <ul>
  404. * <li><code>getState()</code> in &#x007B; <code>INSTALLED</code>,
  405. * <code>RESOLVED</code> &#x007D;.
  406. * <li>Plugin has a unique ID.
  407. * </ul>
  408. * <b>Postconditions, when an exception is thrown </b>
  409. * <ul>
  410. * <li>Plugin is not installed and no trace of the plugin exists.
  411. * </ul>
  412. *
  413. * @param location The location identifier of the plugin to install.
  414. * @param input The <code>QIODevice</code> object from which this plugin
  415. * will be read or <code>null</code> to indicate the Framework must
  416. * create the I/O device from the specified location identifier.
  417. * The I/O device must always be closed when this method completes,
  418. * even if an exception is thrown.
  419. * @return The <code>ctkPlugin</code> object of the installed plugin.
  420. * @throws ctkPluginException If the I/O device cannot be read or the
  421. * installation failed.
  422. * @throws std::logic_error If this ctkPluginContext is no longer valid.
  423. */
  424. QSharedPointer<ctkPlugin> installPlugin(const QUrl& location, QIODevice* in = 0);
  425. /**
  426. * Connects the specified <code>slot</code> to the context
  427. * plugins's signal which is emitted when a plugin has
  428. * a lifecycle state change. The signature of the slot
  429. * must be "slotName(ctkPluginEvent)".
  430. *
  431. * @param receiver The object to connect to.
  432. * @param slot The slot to be connected.
  433. * @param type The Qt connection type. Only Qt::DirectConnection,
  434. * Qt::QueuedConnection, or Qt::BlockingQueuedConnection is allowed.
  435. * @throws std::logic_error If this ctkPluginContext is no
  436. * longer valid.
  437. * @see ctkPluginEvent
  438. * @see ctkEventBus
  439. */
  440. bool connectPluginListener(const QObject* receiver, const char* slot, Qt::ConnectionType type = Qt::QueuedConnection);
  441. /**
  442. * Connects the specified <code>slot</code> to the context
  443. * plugin's signal which emits general Framework events. The signature
  444. * of the slot must be "slotName(ctkPluginFrameworkEvent)".
  445. *
  446. * @param receiver The object to connect to.
  447. * @param slot The slot to be connected.
  448. * @param type The Qt connection type.
  449. * @throws std::logic_error If this ctkPluginContext is no
  450. * longer valid.
  451. * @see ctkPluginFrameworkEvent
  452. * @see ctkEventBus
  453. */
  454. bool connectFrameworkListener(const QObject* receiver, const char* slot, Qt::ConnectionType type = Qt::QueuedConnection);
  455. /**
  456. * Connects the specified <code>slot</code> with the
  457. * specified <code>filter</code> to the context plugins's signal emitting
  458. * service events when a service has a lifecycle state change. The signature
  459. * of the slot must be "slotName(const ctkServiceEvent&)", but only the name
  460. * of the slot must be provided as the argument.
  461. * See {@link ctkLDAPSearchFilter} for a description of
  462. * the filter syntax.
  463. *
  464. * <p>
  465. * If the object to connect to is destroyed, the slot is automatically
  466. * disconnected. To explicitly disconnect the slot, use
  467. * disconnectServiceListener().
  468. *
  469. * <p>
  470. * If the context plugin's list of listeners already contains the same
  471. * slot for the given receiver, then this
  472. * method replaces that slot's filter (which may be <code>null</code>)
  473. * with the specified one (which may be <code>null</code>).
  474. *
  475. * <p>
  476. * The slot is called if the filter criteria is met. To filter based
  477. * upon the class of the service, the filter should reference the
  478. * {@link ctkPluginConstants#OBJECTCLASS} property. If <code>filter</code> is
  479. * <code>null</code>, all services are considered to match the filter.
  480. *
  481. * <p>
  482. * When using a <code>filter</code>, it is possible that the
  483. * <code>ctkServiceEvent</code>s for the complete lifecycle of a service
  484. * will not be delivered to the slot. For example, if the
  485. * <code>filter</code> only matches when the property <code>x</code> has
  486. * the value <code>1</code>, the listener will not be called if the
  487. * service is registered with the property <code>x</code> not set to the
  488. * value <code>1</code>. Subsequently, when the service is modified
  489. * setting property <code>x</code> to the value <code>1</code>, the
  490. * filter will match and the slot will be called with a
  491. * <code>ServiceEvent</code> of type <code>MODIFIED</code>. Thus, the
  492. * slot will not be called with a <code>ServiceEvent</code> of type
  493. * <code>REGISTERED</code>.
  494. *
  495. * @param receiver The object to connect to.
  496. * @param slot The name of the slot to be connected.
  497. * @param filter The filter criteria.
  498. * @param type The Qt connection type.
  499. * @throws std::invalid_argument If <code>filter</code> contains an
  500. * invalid filter string that cannot be parsed.
  501. * @throws std::logic_error If this ctkPluginContext is no
  502. * longer valid.
  503. * @see ctkServiceEvent
  504. * @see disconnectServiceListener()
  505. * @see ctkEventBus
  506. */
  507. void connectServiceListener(QObject* receiver, const char* slot,
  508. const QString& filter = QString());
  509. /**
  510. * Disconnects a slot which has been previously connected
  511. * with a call to connectServiceListener().
  512. *
  513. * @param receiver The object containing the slot.
  514. * @param slot The slot to be disconnected.
  515. * @see connectServiceListener()
  516. */
  517. void disconnectServiceListener(QObject* receiver, const char* slot);
  518. protected:
  519. friend class ctkPluginFrameworkPrivate;
  520. friend class ctkPlugin;
  521. friend class ctkPluginPrivate;
  522. ctkPluginContext(ctkPluginPrivate* plugin);
  523. ctkPluginContextPrivate * const d_ptr;
  524. };
  525. #endif /* CTKPLUGINCONTEXT_H_ */