Revert "[4.0] Create Widget Application"
[platform/core/uifw/dali-adaptor.git] / adaptors / common / trigger-event.h
index f5bb6d3..cb49b3d 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <boost/function.hpp>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/signals/callback.h>
+#include <file-descriptor-monitor.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-#include <base/interfaces/trigger-event-interface.h>
+#include <trigger-event-interface.h>
 
 namespace Dali
 {
@@ -34,7 +35,6 @@ namespace Internal
 namespace Adaptor
 {
 
-class FileDescriptorMonitor;
 
 /**
  * The TriggerEvent class is used to send events between threads.  For example, this can be used
@@ -46,7 +46,7 @@ class FileDescriptorMonitor;
  *
  * The implementation of TriggerEvent uses an event file descriptor.
  */
-class DALI_IMPORT_API TriggerEvent : public TriggerEventInterface
+class TriggerEvent : public TriggerEventInterface
 {
 public:
 
@@ -55,10 +55,11 @@ public:
    * Creates an event file descriptor and starts a GSource which reads from the file
    * descriptor when there is data.
    *
-   * @param[in]  functor to call
-   * @param[in] options, trigger event options.
+   * @param[in] callback The callback to call
+   * @param[in] options Trigger event options.
+   * @note The ownership of callback is taken by this class.
    */
-  TriggerEvent( boost::function<void()> functor, TriggerEventInterface::Options options = TriggerEventInterface::NONE );
+  TriggerEvent( CallbackBase* callback, TriggerEventInterface::Options options );
 
   /**
    * Destructor
@@ -77,9 +78,10 @@ public:
 private:
 
   /**
-   * Called when our event file descriptor has been written to.
+   * @brief Called when our event file descriptor has been written to.
+   * @param[in] eventBitMask bit mask of events that occured on the file descriptor
    */
-  void Triggered();
+  void Triggered( FileDescriptorMonitor::EventType eventBitMask );
 
 private:
 
@@ -88,7 +90,7 @@ private:
 private:
 
   FileDescriptorMonitor* mFileDescriptorMonitor;
-  boost::function<void()> mFunctor; ///< Function object to call
+  CallbackBase* mCallback;
   int mFileDescriptor;
   TriggerEventInterface::Options mOptions;
 };