ctkEventDispatcherRemote.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * ctkEventDispatcherRemote.h
  3. * ctkEventBus
  4. *
  5. * Created by Daniele Giunchi on 11/04/10.
  6. * Copyright 2009 B3C. All rights reserved.
  7. *
  8. * See Licence at: http://tiny.cc/QXJ4D
  9. *
  10. */
  11. #ifndef CTKEVENTDISPATCHERREMOTE_H
  12. #define CTKEVENTDISPATCHERREMOTE_H
  13. //include list
  14. #include "ctkEventDefinitions.h"
  15. #include "ctkEventDispatcher.h"
  16. namespace ctkEventBus {
  17. class ctkNetworkConnector;
  18. /**
  19. Class name: ctkEventDispatcherRemote
  20. This allows dispatching events coming from local application to attached observers.
  21. */
  22. class org_commontk_eventbus_EXPORT ctkEventDispatcherRemote : public ctkEventDispatcher {
  23. Q_OBJECT
  24. public:
  25. /// object constructor.
  26. ctkEventDispatcherRemote();
  27. /// object destructor.
  28. /*virtual*/ ~ctkEventDispatcherRemote();
  29. /// Emit event corresponding to the given id (present into the event_dictionary) locally to the application.
  30. /*virtual*/ void notifyEvent(ctkBusEvent &event_dictionary, ctkEventArgumentsList *argList = NULL, ctkGenericReturnArgument *returnArg = NULL) const;
  31. /// Set the active server side network connector type.
  32. void setNetworkConnectorServer(ctkNetworkConnector *connector);
  33. /// return the current instantiated server side network connector.
  34. ctkNetworkConnector *networkConnectorServer();
  35. /// Set the active client side network connector type.
  36. void setNetworkConnectorClient(ctkNetworkConnector *connector);
  37. /// return the current instantiated client side network connector.
  38. ctkNetworkConnector *networkConnectorClient();
  39. protected:
  40. /// Register MAF global events
  41. /*virtual*/ void initializeGlobalEvents();
  42. private:
  43. ctkNetworkConnector *m_NetworkConnectorServer; ///< Class used to manage the communication with the remote event bus.
  44. ctkNetworkConnector *m_NetworkConnectorClient; ///< Class used to manage the communication with the remote event bus.
  45. };
  46. } //namespace ctkEventBus
  47. Q_DECLARE_METATYPE(QVariantList);
  48. #endif // CTKEVENTDISPATCHERREMOTE_H