00001 /********************************************************************** 00002 00003 Copyright (c) 2005, TomTom B.V. 00004 00005 All rights reserved 00006 00007 00008 ***********************************************************************/ 00009 00010 00011 #ifndef __CUIEVENTLOOP_H__ 00012 #define __CUIEVENTLOOP_H__ 00013 00014 #include "CUIScreen.h" 00015 #include "MInputReader.h" 00016 #include "MVirtualScreen.h" 00017 00027 class CUIEventLoop 00028 { 00029 public: 00035 class MUIEventLoopEvents 00036 { 00037 public: 00046 virtual void FiredIdleEvent( CUIEventLoop& aSource ) = 0; 00047 }; 00048 00049 public: 00050 virtual ~CUIEventLoop(); 00051 00057 void SetScreen( CUIScreen* aScreen ); 00058 00060 CUIScreen* GetScreen(); 00061 00063 void RunOneStep(); 00064 00067 void Run(); 00068 00070 static CUIEventLoop& GetEventLoop(); 00071 00072 private: 00073 CUIEventLoop(); 00074 CUIEventLoop( const CUIEventLoop& ); 00075 CUIEventLoop& operator=( const CUIEventLoop& ); 00076 00077 public: 00078 MUIEventLoopEvents* iObserver; 00079 bool iExit; 00080 bool iForceFullRedraw; 00085 private: 00086 CUIScreen* iCurrentScreen; 00087 MInputReader& m_InputReder; 00088 MVirtualScreen& m_FrameBuffer; 00089 }; 00090 00091 #endif // __CUIEVENTLOOP_H__ 00092