ctkTrackedService_p.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 CTKTRACKEDSERVICE_P_H
  16. #define CTKTRACKEDSERVICE_P_H
  17. #include "ctkPluginAbstractTracked_p.h"
  18. #include "ctkServiceEvent.h"
  19. class ctkServiceTracker;
  20. struct ctkServiceTrackerCustomizer;
  21. class ctkTrackedService : public QObject,
  22. public ctkPluginAbstractTracked<ctkServiceReference, ctkServiceEvent>
  23. {
  24. Q_OBJECT
  25. public:
  26. ctkTrackedService(ctkServiceTracker* serviceTracker,
  27. ctkServiceTrackerCustomizer* customizer);
  28. public slots:
  29. /**
  30. * Slot connected to service events for the
  31. * <code>ctkServiceTracker</code> class. This method must NOT be
  32. * synchronized to avoid deadlock potential.
  33. *
  34. * @param event <code>ctkServiceEvent</code> object from the framework.
  35. */
  36. void serviceChanged(const ctkServiceEvent& event);
  37. private:
  38. typedef ctkPluginAbstractTracked<ctkServiceReference, ctkServiceEvent> Superclass;
  39. ctkServiceTracker* serviceTracker;
  40. ctkServiceTrackerCustomizer* customizer;
  41. /**
  42. * Increment the tracking count and tell the tracker there was a
  43. * modification.
  44. *
  45. * @GuardedBy this
  46. */
  47. void modified();
  48. /**
  49. * Call the specific customizer adding method. This method must not be
  50. * called while synchronized on this object.
  51. *
  52. * @param item Item to be tracked.
  53. * @param related Action related object.
  54. * @return Customized object for the tracked item or <code>null</code>
  55. * if the item is not to be tracked.
  56. */
  57. QVariant customizerAdding(ctkServiceReference item, ctkServiceEvent related);
  58. /**
  59. * Call the specific customizer modified method. This method must not be
  60. * called while synchronized on this object.
  61. *
  62. * @param item Tracked item.
  63. * @param related Action related object.
  64. * @param object Customized object for the tracked item.
  65. */
  66. void customizerModified(ctkServiceReference item,
  67. ctkServiceEvent related, QVariant object) ;
  68. /**
  69. * Call the specific customizer removed method. This method must not be
  70. * called while synchronized on this object.
  71. *
  72. * @param item Tracked item.
  73. * @param related Action related object.
  74. * @param object Customized object for the tracked item.
  75. */
  76. void customizerRemoved(ctkServiceReference item,
  77. ctkServiceEvent related, QVariant object) ;
  78. };
  79. #endif // CTKTRACKEDSERVICE_P_H