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
00039
00041 struct LayeredControl
00042 {
00043 LayeredControl( CtrlGeneric *pControl, int layer ):
00044 m_pControl( pControl ), m_layer( layer ) {}
00045
00047 CtrlGeneric *m_pControl;
00049 int m_layer;
00050 };
00051
00052
00054 class GenericLayout: public SkinObject, public Box
00055 {
00056 public:
00057 GenericLayout( intf_thread_t *pIntf, int width, int height,
00058 int minWidth, int maxWidth, int minHeight,
00059 int maxHeight );
00060
00061 virtual ~GenericLayout();
00062
00064 virtual void setWindow( TopWindow *pWindow );
00065
00067 virtual TopWindow *getWindow() const { return m_pWindow; }
00068
00070 virtual void onControlCapture( const CtrlGeneric &rCtrl );
00071
00073 virtual void onControlRelease( const CtrlGeneric &rCtrl );
00074
00076 virtual void refreshAll();
00077
00079 virtual void refreshRect( int x, int y, int width, int height );
00080
00082 virtual OSGraphics *getImage() const { return m_pImage; }
00083
00085 virtual int getLeft() const { return m_pWindow->getLeft(); }
00086 virtual int getTop() const { return m_pWindow->getTop(); }
00087
00089 virtual int getWidth() const { return m_width; }
00090 virtual int getHeight() const { return m_height; }
00091
00093 virtual int getMinWidth() const { return m_minWidth; }
00094 virtual int getMaxWidth() const { return m_maxWidth; }
00095 virtual int getMinHeight() const { return m_minHeight; }
00096 virtual int getMaxHeight() const { return m_maxHeight; }
00097
00099 virtual void resize( int width, int height );
00100
00103 virtual void addControl( CtrlGeneric *pControl,
00104 const Position &rPosition,
00105 int layer );
00106
00108 virtual const list<LayeredControl> &getControlList() const;
00109
00114 virtual void onControlUpdate( const CtrlGeneric &rCtrl,
00115 int width, int height,
00116 int xOffSet, int yOffSet );
00117
00119 virtual const list<Anchor*>& getAnchorList() const;
00120
00122 virtual void addAnchor( Anchor *pAnchor );
00123
00124 private:
00126 TopWindow *m_pWindow;
00128 int m_width, m_height;
00129 int m_minWidth, m_maxWidth;
00130 int m_minHeight, m_maxHeight;
00132 OSGraphics *m_pImage;
00134 list<LayeredControl> m_controlList;
00136 list<Anchor*> m_anchorList;
00137 };
00138
00139
00140 typedef CountedPtr<GenericLayout> GenericLayoutPtr;
00141
00142
00143 #endif