00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GENERIC_WINDOW_HPP
00026 #define GENERIC_WINDOW_HPP
00027
00028 #include "skin_common.hpp"
00029 #include "../utils/var_bool.hpp"
00030
00031 class OSWindow;
00032 class EvtGeneric;
00033 class EvtFocus;
00034 class EvtLeave;
00035 class EvtMotion;
00036 class EvtMouse;
00037 class EvtKey;
00038 class EvtRefresh;
00039 class EvtScroll;
00040 class WindowManager;
00041
00042
00044 class GenericWindow: public SkinObject, public Observer<VarBool>
00045 {
00046 private:
00047 friend class WindowManager;
00048 public:
00049 GenericWindow( intf_thread_t *pIntf, int xPos, int yPos,
00050 bool dragDrop, bool playOnDrop,
00051 GenericWindow *pParent = NULL );
00052 virtual ~GenericWindow();
00053
00055 virtual void processEvent( EvtFocus &rEvtFocus ) {}
00056 virtual void processEvent( EvtMotion &rEvtMotion ) {}
00057 virtual void processEvent( EvtMouse &rEvtMouse ) {}
00058 virtual void processEvent( EvtLeave &rEvtLeave ) {}
00059 virtual void processEvent( EvtKey &rEvtKey ) {}
00060 virtual void processEvent( EvtScroll &rEvtScroll ) {}
00061
00062 virtual void processEvent( EvtRefresh &rEvtRefresh );
00063
00065 virtual void resize( int width, int height );
00066
00068 virtual void refresh( int left, int top, int width, int height ) {}
00069
00071 int getLeft() const { return m_left; }
00072 int getTop() const { return m_top; }
00073 int getWidth() const { return m_width; }
00074 int getHeight() const { return m_height; }
00075
00077 VarBool &getVisibleVar() { return m_varVisible; }
00078
00080 virtual string getType() const { return "Generic"; }
00081
00082 protected:
00084 OSWindow *getOSWindow() const { return m_pOsWindow; }
00085
00088
00089
00090 virtual void show() const;
00091
00093 virtual void hide() const;
00094
00096 virtual void move( int left, int top );
00097
00099 virtual void raise() const;
00100
00102 virtual void setOpacity( uint8_t value );
00103
00105 virtual void toggleOnTop( bool onTop ) const;
00107
00109 virtual void innerShow();
00110
00112 virtual void innerHide();
00113
00114 private:
00116 int m_left, m_top, m_width, m_height;
00118 OSWindow *m_pOsWindow;
00120 mutable VarBoolImpl m_varVisible;
00121
00123 virtual void onUpdate( Subject<VarBool> &rVariable );
00124 };
00125
00126
00127 #endif