ctkServiceSlotEntry_p.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 CTKSERVICESLOTENTRY_P_H
  16. #define CTKSERVICESLOTENTRY_P_H
  17. #include <QHash>
  18. #include <QList>
  19. #include <QString>
  20. #include <QStringList>
  21. #include <QExplicitlySharedDataPointer>
  22. #include "ctkServiceEvent.h"
  23. #include "ctkLDAPExpr_p.h"
  24. class ctkPlugin;
  25. class ctkServiceSlotEntryData;
  26. class QObject;
  27. /**
  28. * \ingroup PluginFramework
  29. *
  30. * Data structure for saving information about slots registered for
  31. * receiving service lifecycle events.
  32. */
  33. class ctkServiceSlotEntry
  34. {
  35. public:
  36. ctkServiceSlotEntry(QSharedPointer<ctkPlugin> p, QObject* receiver, const char* slot,
  37. const QString& filter = QString());
  38. ctkServiceSlotEntry(const ctkServiceSlotEntry& other);
  39. // default constructor for use in QSet
  40. ctkServiceSlotEntry();
  41. ~ctkServiceSlotEntry();
  42. // assignment operator for use in QSet
  43. ctkServiceSlotEntry& operator=(const ctkServiceSlotEntry& other);
  44. bool operator==(const ctkServiceSlotEntry& other) const;
  45. void invokeSlot(const ctkServiceEvent& event);
  46. void setRemoved(bool removed);
  47. bool isRemoved() const;
  48. QSharedPointer<ctkPlugin> getPlugin() const;
  49. ctkLDAPExpr getLDAPExpr() const;
  50. QString getFilter() const;
  51. ctkLDAPExpr::LocalCache& getLocalCache() const;
  52. private:
  53. friend uint qHash(const ctkServiceSlotEntry& serviceSlot);
  54. QExplicitlySharedDataPointer<ctkServiceSlotEntryData> d;
  55. };
  56. /**
  57. * \ingroup PluginFramework
  58. */
  59. uint qHash(const ctkServiceSlotEntry& serviceSlot);
  60. #endif // CTKSERVICESLOTENTRY_P_H