Fix errors caused by -Wold-style-cast
[platform/core/uifw/dali-adaptor.git] / adaptors / common / callback-manager.h
index f6f4cec..fc16aca 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_CALLBACK_MANAGER_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,25 +40,6 @@ class CallbackManager
 public:
 
     /**
-     * Determines the priority of the call back
-     */
-    enum Priority
-    {
-      IDLE_PRIORITY,     ///< idle priority
-      DEFAULT_PRIORITY,  ///< priority of the callback will be the same as input handlers and timer callbacks.
-    };
-
-    /**
-     * Controls whether an event once processed by the handler is passed on to other
-     * handlers, or not.
-     */
-    enum EventControl
-    {
-      CALLBACK_PASS_ON,   ///< Pass the event on to any other handlers registered for this event
-      CALLBACK_DONE,      ///< Don't pass the event to any other handlers
-    };
-
-    /**
      * Create a new call back interface
      */
     static CallbackManager* New();
@@ -69,22 +50,24 @@ public:
     virtual ~CallbackManager() {}
 
     /**
-     * Adds a call back asynchronously.
-     * Can be called from any thread.
-     * @param callback custom call back function
-     * @param priority call back priority
+     * @brief Adds a @p callback to be run on idle.
+     * @note Must be called from the main thread only.
+     *
+     * @param[in] callback custom callback function.
+     *
      * @return true on success
      */
-    virtual bool AddCallback( CallbackBase* callback, Priority priority ) = 0;
+    virtual bool AddIdleCallback( CallbackBase* callback ) = 0;
 
     /**
-     * Adds a call back asynchronously to handle an event.
-     * E.g. to handle a CTRL-C event.
-     * Can be called from any thread.
-     * @param callback custom call back function
-     * @return true on success
+     * @brief Removes a previously added @p callback.
+     * @note Must be called from main thread only.
+     *
+     * Does nothing if the @p callback doesn't exist.
+     *
+     * @param[in] callback The callback to be removed.
      */
-    virtual bool AddEventCallback( CallbackBase* callback, int type, EventControl control ) = 0;
+    virtual void RemoveIdleCallback( CallbackBase* callback ) = 0;
 
     /**
      * Starts the callback manager.