X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fcallback-manager.h;h=20f87986c12cc43fbde761b2c7d69c1b033453b8;hb=b02339ca050d56d80668a59e94ced87e2c189541;hp=6bf3eb356f351b6818fee3eee797ea08e14755bf;hpb=6c48d965d1eca249b71488ab4193bf6dcdd74bcd;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/callback-manager.h b/adaptors/common/callback-manager.h index 6bf3eb3..20f8798 100644 --- a/adaptors/common/callback-manager.h +++ b/adaptors/common/callback-manager.h @@ -1,5 +1,5 @@ -#ifndef __DALI_CALLBACK_MANAGER_H__ -#define __DALI_CALLBACK_MANAGER_H__ +#ifndef __DALI_INTERNAL_CALLBACK_MANAGER_H__ +#define __DALI_INTERNAL_CALLBACK_MANAGER_H__ /* * Copyright (c) 2014 Samsung Electronics Co., Ltd. @@ -19,8 +19,8 @@ */ // EXTERNAL INCLUDES -#include #include +#include namespace Dali { @@ -34,32 +34,11 @@ namespace Adaptor /** * Abstract interface to install call backs in to an applications main loop. */ -class DALI_IMPORT_API CallbackManager +class CallbackManager { public: - typedef boost::function Callback; ///< Callback typedef - - /** - * 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 */ @@ -71,22 +50,13 @@ public: virtual ~CallbackManager() {} /** - * Adds a call back asynchronously. - * Can be called from any thread. + * Adds a call back to be run on idle. + * Must be call from main thread only. * @param callback custom call back function * @param priority call back priority * @return true on success */ - virtual bool AddCallback( Callback callback, Priority priority ) = 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 - */ - virtual bool AddEventCallback( Callback callback, int type, EventControl control ) = 0; + virtual bool AddIdleCallback( CallbackBase* callback ) = 0; /** * Starts the callback manager. @@ -123,4 +93,4 @@ private: } // namespace Dali -#endif // __DALI_CALLBACK_MANAGER_H__ +#endif // __DALI_INTERNAL_CALLBACK_MANAGER_H__