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

ctrl_text.hpp

00001 /*****************************************************************************
00002  * ctrl_text.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: ctrl_text.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_TEXT_HPP
00026 #define CTRL_TEXT_HPP
00027 
00028 #include "ctrl_generic.hpp"
00029 #include "../utils/fsm.hpp"
00030 #include "../utils/observer.hpp"
00031 #include <string>
00032 
00033 class GenericFont;
00034 class GenericBitmap;
00035 class OSTimer;
00036 class UString;
00037 class VarText;
00038 
00039 
00041 class CtrlText: public CtrlGeneric, public Observer<VarText>
00042 {
00043     public:
00045         CtrlText( intf_thread_t *pIntf, VarText &rVariable,
00046                   const GenericFont &rFont, const UString &rHelp,
00047                   uint32_t color, VarBool *pVisible );
00048         virtual ~CtrlText();
00049 
00051         virtual void handleEvent( EvtGeneric &rEvent );
00052 
00054         virtual bool mouseOver( int x, int y ) const;
00055 
00057         virtual void draw( OSGraphics &rImage, int xDest, int yDest );
00058 
00061         void setText( const UString &rText, uint32_t color = 0xFFFFFFFF );
00062 
00064         virtual string getType() const { return "text"; }
00065 
00066     private:
00068         FSM m_fsm;
00070         VarText &m_rVariable;
00072         DEFINE_CALLBACK( CtrlText, ToManual )
00073         DEFINE_CALLBACK( CtrlText, ManualMoving )
00074         DEFINE_CALLBACK( CtrlText, ManualStill )
00075         DEFINE_CALLBACK( CtrlText, Move )
00077         EvtGeneric *m_pEvt;
00079         const GenericFont &m_rFont;
00081         uint32_t m_color;
00083         GenericBitmap *m_pImg;
00086         GenericBitmap *m_pImgDouble;
00088         GenericBitmap *m_pCurrImg;
00090         int m_xPos;
00093         int m_xOffset;
00095         OSTimer *m_pTimer;
00096 
00098         DEFINE_CALLBACK( CtrlText, UpdateText );
00099 
00101         virtual void onUpdate( Subject<VarText> &rVariable );
00102 
00104         void displayText( const UString &rText );
00105 
00107         void adjust( int &position );
00108 
00110         virtual void onChangePosition();
00111 };
00112 
00113 
00114 #endif

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