Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

ctrl_generic.hpp

00001 /*****************************************************************************
00002  * ctrl_generic.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: ctrl_generic.hpp 12207 2005-08-15 15:54:32Z asmax $
00006  *
00007  * Authors: Cyril Deguet     <[email protected]>
00008  *          Olivier Teulière <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef CTRL_GENERIC_HPP
00026 #define CTRL_GENERIC_HPP
00027 
00028 #include "../src/skin_common.hpp"
00029 #include "../utils/pointer.hpp"
00030 #include "../utils/fsm.hpp"
00031 #include "../utils/ustring.hpp"
00032 #include "../utils/observer.hpp"
00033 #include "../commands/cmd_generic.hpp"
00034 
00035 class EvtGeneric;
00036 class OSGraphics;
00037 class GenericLayout;
00038 class Position;
00039 class TopWindow;
00040 class VarBool;
00041 
00042 
00044 class CtrlGeneric: public SkinObject, public Observer<VarBool>
00045 {
00046     public:
00047         virtual ~CtrlGeneric();
00048 
00050         virtual void handleEvent( EvtGeneric &rEvent ) {}
00051 
00053         virtual bool mouseOver( int x, int y ) const { return false; }
00054 
00056         virtual void draw( OSGraphics &rImage, int xDest, int yDest ) {}
00057 
00059         virtual void setLayout( GenericLayout *pLayout,
00060                                 const Position &rPosition );
00061 
00063         virtual const Position *getPosition() const { return m_pPosition; }
00064 
00066         virtual UString getTooltipText() const
00067             { return UString( getIntf(), "" ); }
00068 
00071         virtual void onResize() {}
00072 
00074         virtual const UString &getHelpText() const { return m_help; }
00075 
00077         virtual bool isFocusable() const { return false; }
00078 
00080         virtual bool isVisible() const;
00081 
00083         virtual string getType() const { return ""; }
00084 
00085     protected:
00086         // If pVisible is NULL, the control is always visible
00087         CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
00088                      VarBool *pVisible = NULL );
00089 
00093         virtual void notifyLayout( int witdh = -1, int height = -1,
00094                                    int xOffSet = 0, int yOffSet = 0 ) const;
00095 
00098         void notifyLayoutMaxSize( const OSGraphics *pImg1 = NULL,
00099                                   const OSGraphics *pImg2 = NULL );
00100 
00102         virtual void captureMouse() const;
00103 
00105         virtual void releaseMouse() const;
00106 
00108         virtual void notifyTooltipChange() const;
00109 
00111         virtual TopWindow *getWindow() const;
00112 
00115         virtual void onPositionChange() {}
00116 
00118         virtual void onVarBoolUpdate( VarBool &rVar ) {}
00119 
00120     private:
00122         GenericLayout *m_pLayout;
00124         Position *m_pPosition;
00126         UString m_help;
00128         VarBool *m_pVisible;
00129 
00131         virtual void onUpdate( Subject<VarBool> &rVariable );
00132 };
00133 
00134 typedef CountedPtr<CtrlGeneric> CtrlGenericPtr;
00135 
00136 
00137 #endif

Generated on Tue Dec 20 10:14:41 2005 for vlc-0.8.4a by  doxygen 1.4.2