00001 /***************************************************************************** 00002 * tooltip.hpp 00003 ***************************************************************************** 00004 * Copyright (C) 2003 the VideoLAN team 00005 * $Id: tooltip.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 TOOLTIP_HPP 00026 #define TOOLTIP_HPP 00027 00028 #include "../utils/var_text.hpp" 00029 #include "../commands/cmd_generic.hpp" 00030 00031 class GenericFont; 00032 class OSTooltip; 00033 class OSTimer; 00034 class OSGraphics; 00035 class UString; 00036 00037 00038 class Tooltip: public SkinObject, public Observer<VarText> 00039 { 00040 public: 00042 Tooltip( intf_thread_t *pIntf, const GenericFont &rFont, int delay ); 00043 00044 virtual ~Tooltip(); 00045 00047 void show(); 00048 00051 void hide(); 00052 00053 private: 00055 const GenericFont &m_rFont; 00057 int m_delay; 00059 OSTimer *m_pTimer; 00061 OSTooltip *m_pOsTooltip; 00063 OSGraphics *m_pImage; 00065 int m_xPos, m_yPos; 00066 00068 virtual void onUpdate( Subject<VarText> &rVariable ); 00069 00071 void displayText( const UString &rText ); 00072 00074 void makeImage( const UString &rText ); 00075 00077 DEFINE_CALLBACK( Tooltip, Show ); 00078 }; 00079 00080 00081 #endif