00001 00002 #pragma once 00003 00004 #ifndef VIEWCONTROLLER_H 00005 #define VIEWCONTROLLER_H 00006 00007 #include "Types.h" 00008 #include "Util.h" 00009 #include "Error.h" 00010 #include "AbstractPropertyContainer.h" 00011 #include "PropertyContainer.h" 00012 #include "ViewControllerEvent.h" 00013 #include "RenderInterface.h" 00014 00015 using namespace std; 00016 00017 namespace RenderTools { 00018 00019 class ViewController : public RenderInterface, public AbstractPropertyContainer { 00020 public: 00021 00022 ViewController( void ); 00023 virtual ~ViewController( void ); 00024 00025 static PropertyPtr create( const XMLNodePtr & xml = XMLNodePtr() ); 00026 virtual void createProperties( void ); 00027 virtual const string getTypeName( bool ofComponent = false ) const; 00028 00029 void sendViewControllerEvent( const ViewControllerEvent & e ); 00030 virtual void onViewControllerEvent( const ViewControllerEvent & e ); 00031 virtual void onInitialize( void ); 00032 virtual void onRender( void ); 00033 virtual void show( bool state = true ); 00034 virtual void setSize( unsigned int width, unsigned int height ); 00035 virtual const Vec2 getSize( void ) const; 00036 virtual bool getTimer( void ) const; 00037 virtual unsigned int getTimerMillisec( void ) const; 00038 virtual bool getShow( void ) const; 00039 virtual void startTimer( unsigned int Millisec = 30 ); 00040 virtual void stopTimer( void ); 00041 static const ViewControllerWeakList & getViewControllers( void ); 00042 static unsigned int getMajorVersion( void ); 00043 static unsigned int getMinorVersion( void ); 00044 static DeviceName getDeviceName( void ); 00045 static void setMajorVersion( unsigned int v ); 00046 static void setMinorVersion( unsigned int v ); 00047 static void setDeviceName( DeviceName v ); 00048 00049 protected: 00050 unsigned int m_width; 00051 unsigned int m_height; 00052 bool m_timer; 00053 unsigned int m_timerMillisec; 00054 bool m_show; 00055 00056 static unsigned int s_majorVersion; 00057 static unsigned int s_minorVersion; 00058 static DeviceName s_deviceName; 00059 00060 private: 00061 static ViewControllerWeakList s_instances; 00062 }; 00063 00064 };//namespace RenderTools 00065 00066 #endif
1.5.8