ctkEventConstants.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 CTKEVENTCONSTANTS_H
  16. #define CTKEVENTCONSTANTS_H
  17. #include <QString>
  18. #include "ctkPluginFrameworkExport.h"
  19. /**
  20. * Defines standard names for event properties
  21. *
  22. * \see ctkEventBus::subscribeSlot()
  23. */
  24. struct CTK_PLUGINFW_EXPORT EventConstants {
  25. /**
  26. * Qt slot property (named <code>event.topics</code>)
  27. * specifying the <code>ctkEvent</code> topics of interest to a
  28. * subscribed slot.
  29. * <p>
  30. * Subscribed slots SHOULD be registered with this property. The value of the
  31. * property is a QString or a QStringList that describes the topics in
  32. * which the handler is interested. An asterisk ('*') may be used as a
  33. * trailing wildcard. Subscribed slots which do not have a value for this
  34. * property must not receive events. More precisely, the value of each
  35. * string must conform to the following grammar:
  36. *
  37. * <pre>
  38. * topic-description := '*' | topic ( '&#47*' )?
  39. * topic := token ( '/' token )*
  40. * </pre>
  41. *
  42. * @see ctkEvent
  43. */
  44. static const QString EVENT_TOPIC; // = "event.topics"
  45. /**
  46. * Qt slot property (named <code>event.filter</code>)
  47. * specifying a filter to further select <code>ctkEvent</code> s of interest to
  48. * a subscribed slot.
  49. * <p>
  50. * Subscribed slots MAY be registered with this property. The value of this
  51. * property is a QString containing an LDAP-style filter specification. Any
  52. * of the event's properties may be used in the filter expression. Each
  53. * subscribed slot is notified for any event which belongs to the topics in
  54. * which the slot has expressed an interest. If the slot is also
  55. * registered with this property, then the properties of the event
  56. * must also match the filter for the event to be delivered to the slot.
  57. * <p>
  58. * If the filter syntax is invalid, then the slot must be ignored
  59. * and a warning should be logged.
  60. *
  61. * @see ctkEvent
  62. * @see ctkLDAPSearchFilter
  63. */
  64. static const QString EVENT_FILTER; // = "event.filter"
  65. /**
  66. * The Plugin Symbolic Name of the plugin relevant to the event. The type of
  67. * the value for this event property is <code>QString</code>.
  68. */
  69. static const QString PLUGIN_SYMBOLICNAME; // = "plugin.symbolicName";
  70. /**
  71. * The Plugin id of the plugin relevant to the event. The type of the value
  72. * for this event property is <code>long</code>.
  73. */
  74. static const QString PLUGIN_ID; // = "plugin.id";
  75. /**
  76. * The ctkPlugin object of the plugin relevant to the event. The type of the
  77. * value for this event property is {@link ctkPlugin}.
  78. */
  79. static const QString PLUGIN; // = "plugin";
  80. /**
  81. * The version of the plugin relevant to the event. The type of the value
  82. * for this event property is {@link ctkVersion}.
  83. */
  84. static const QString PLUGIN_VERSION; // = "plugin.version";
  85. };
  86. #endif // CTKEVENTCONSTANTS_H