kanimwidget.h
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000 Kurt Granroth <granroth@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 #ifndef _KANIMWIDGET_H 00019 #define _KANIMWIDGET_H 00020 00021 #include <tqframe.h> 00022 00023 #include <kdelibs_export.h> 00024 00025 class TQStringList; 00026 class TQPainter; 00027 class TQMouseEvent; 00028 00029 class KAnimWidgetPrivate; 00055 class KDEUI_EXPORT KAnimWidget : public TQFrame 00056 { 00057 Q_OBJECT 00058 Q_PROPERTY( int size READ size WRITE setSize ) 00059 Q_PROPERTY( TQString icons READ icons WRITE setIcons ) 00060 00061 public: 00076 KAnimWidget( const TQString& icons, int size = 0, 00077 TQWidget *parent = 0L, const char *name = 0L ); 00078 00082 virtual ~KAnimWidget(); 00083 00089 void setSize( int size ); 00090 00095 int size() const; 00096 00101 TQString icons() const; 00102 00109 void setIcons( const TQString& icons ); 00110 00111 public slots: 00115 void start(); 00116 00120 void stop(); 00121 00122 signals: 00123 void clicked(); 00124 00125 protected: 00126 virtual void drawContents( TQPainter *p ); 00127 virtual void leaveEvent( TQEvent *e ); 00128 virtual void enterEvent( TQEvent *e ); 00129 virtual void hideEvent( TQHideEvent *e); 00130 virtual void showEvent( TQShowEvent *e); 00131 virtual void mousePressEvent( TQMouseEvent *e ); 00132 virtual void mouseReleaseEvent( TQMouseEvent *e ); 00133 00134 protected slots: 00135 void slotTimerUpdate(); 00136 void updateIcons(); 00137 00138 protected: 00139 virtual void virtual_hook( int id, void* data ); 00140 private: 00141 KAnimWidgetPrivate *d; 00142 }; 00143 00144 #endif // _KANIMWIDGET_H