2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FUi_ModalLoopManager.h
19 * @brief This is the header file for the _ModalLoopManager class.
21 * This header file contains the declarations of the %_ModalLoopManager class.
24 #ifndef _FUI_INTERNAL_MODAL_LOOP_MANAGER_H_
25 #define _FUI_INTERNAL_MODAL_LOOP_MANAGER_H_
27 #include <FBaseColArrayListT.h>
28 #include <FBaseRtITimerEventListener.h>
30 namespace Tizen { namespace Base { namespace Runtime
35 namespace Tizen { namespace Ui
38 class _ModalLoopManager
39 : public Tizen::Base::Runtime::ITimerEventListener
46 bool operator== (const _TimerInfo& rhs) const;
47 bool operator!= (const _TimerInfo& rhs) const;
48 _TimerInfo& operator= (const _TimerInfo& rhs);
52 Tizen::Base::Runtime::Timer* pTimer;
56 typedef Tizen::Base::Collection::ArrayListT<_TimerInfo> TimerInfoList;
59 static void Initialize(void);
60 static _ModalLoopManager* GetInstance(void);
62 int BeginMainLoop(void);
63 int BeginMainLoop(unsigned long timeOut, int exitCode);
64 int EndMainLoop(int exitCode, bool endAllLoops);
65 int GetLastExitCode(void);
67 virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
70 ~_ModalLoopManager(void);
71 _ModalLoopManager(void);
72 _ModalLoopManager(const _ModalLoopManager& rhs);
73 _ModalLoopManager& operator =(const _ModalLoopManager& rhs);
77 MODAL_LOOP_EXIT_CODE_APP_TERMINATION = -1,
78 MODAL_LOOP_EXIT_CODE_CONTINUOUS_TERMINATION = -2
82 static _ModalLoopManager* __pInstance;
83 TimerInfoList* __pTimerInfoList;
86 }; // _ModalLoopManager
90 #endif // _FUI_INTERNAL_MODAL_LOOP_MANAGER_H_