generic_layout.hpp
Go to the documentation of this file.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_LAYOUT_HPP
00026 #define GENERIC_LAYOUT_HPP
00027
00028 #include "skin_common.hpp"
00029 #include "top_window.hpp"
00030 #include "../utils/pointer.hpp"
00031 #include "../utils/position.hpp"
00032
00033 #include <list>
00034
00035 class Anchor;
00036 class OSGraphics;
00037 class CtrlGeneric;
00038 class CtrlVideo;
00039 class VarBoolImpl;
00040
00041
00042
00043 struct LayeredControl
00044 {
00045 LayeredControl( CtrlGeneric *pControl, int layer ):
00046 m_pControl( pControl ), m_layer( layer ) { }
00047
00048
00049 CtrlGeneric *m_pControl;
00050
00051 int m_layer;
00052 };
00053
00054
00055
00056 class GenericLayout: public SkinObject
00057 {
00058 public:
00059 GenericLayout( intf_thread_t *pIntf, int width, int height,
00060 int minWidth, int maxWidth, int minHeight, int maxHeight );
00061
00062 virtual ~GenericLayout();
00063
00064
00065 virtual void setWindow( TopWindow *pWindow );
00066
00067
00068 virtual TopWindow *getWindow() const { return m_pWindow; }
00069
00070
00071 virtual void onControlCapture( const CtrlGeneric &rCtrl );
00072
00073
00074 virtual void onControlRelease( const CtrlGeneric &rCtrl );
00075
00076
00077 virtual void refreshAll();
00078
00079
00080 virtual void refreshRect( int x, int y, int width, int height );
00081
00082
00083 virtual OSGraphics *getImage() const { return m_pImage; }
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 virtual int getLeft() const { return m_pWindow->getLeft(); }
00094 virtual int getTop() const { return m_pWindow->getTop(); }
00095
00096
00097 virtual int getWidth() const { return m_rect.getWidth(); }
00098 virtual int getHeight() const { return m_rect.getHeight(); }
00099 virtual const GenericRect &getRect() const { return m_rect; }
00100
00101
00102 virtual int getMinWidth() const { return m_minWidth; }
00103 virtual int getMaxWidth() const { return m_maxWidth; }
00104 virtual int getMinHeight() const { return m_minHeight; }
00105 virtual int getMaxHeight() const { return m_maxHeight; }
00106
00107
00108 virtual void resize( int width, int height );
00109
00110
00111
00112
00113
00114 virtual void addControl( CtrlGeneric *pControl,
00115 const Position &rPosition,
00116 int layer );
00117
00118
00119 virtual const list<LayeredControl> &getControlList() const;
00120
00121
00122
00123
00124
00125
00126
00127 virtual void onControlUpdate( const CtrlGeneric &rCtrl,
00128 int width, int height,
00129 int xOffSet, int yOffSet );
00130
00131
00132 virtual const list<Anchor*>& getAnchorList() const;
00133
00134
00135 virtual void addAnchor( Anchor *pAnchor );
00136
00137
00138 virtual void onShow();
00139
00140
00141 virtual void onHide();
00142
00143
00144
00145 VarBoolImpl &getActiveVar() { return *m_pVarActive; }
00146
00147 private:
00148
00149 TopWindow *m_pWindow;
00150
00151 SkinsRect m_rect;
00152 int m_minWidth, m_maxWidth;
00153 int m_minHeight, m_maxHeight;
00154
00155 OSGraphics *m_pImage;
00156
00157 list<LayeredControl> m_controlList;
00158
00159 set<CtrlVideo *> m_pVideoCtrlSet;
00160
00161 list<Anchor*> m_anchorList;
00162
00163 bool m_visible;
00164
00165
00166
00167
00168
00169
00170 mutable VarBoolImpl *m_pVarActive;
00171 };
00172
00173
00174 typedef CountedPtr<GenericLayout> GenericLayoutPtr;
00175
00176
00177 #endif