Revert "[4.0] Create Widget Application"
[platform/core/uifw/dali-adaptor.git] / adaptors / common / trigger-event.h
index e511b3f..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 <base/interfaces/trigger-event-interface.h>
+#include <trigger-event-interface.h>
 
 namespace Dali
 {
@@ -35,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
@@ -56,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
@@ -78,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:
 
@@ -89,7 +90,7 @@ private:
 private:
 
   FileDescriptorMonitor* mFileDescriptorMonitor;
-  boost::function<void()> mFunctor; ///< Function object to call
+  CallbackBase* mCallback;
   int mFileDescriptor;
   TriggerEventInterface::Options mOptions;
 };