kgameprogress.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 1996 Martynas Kunigelis martynas.kunigelis@vm.ktu.lt
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 /*****************************************************************************
00019 *                                                                            *
00020 *  KGameProgress -- progress indicator widget for KDE by Martynas Kunigelis  *
00021 *                                                                            *
00022 *****************************************************************************/
00023 
00024 #ifndef _KGAMEPROGRESS_H
00025 #define _KGAMEPROGRESS_H
00026 
00027 #include <QtGui/QFrame>
00028 #include <libkdegames_export.h>
00029 
00049 class KDEGAMES_EXPORT KGameProgress : public QFrame
00050 {
00051   Q_OBJECT
00052   Q_ENUMS( BarStyle )
00053   Q_PROPERTY( int value READ value WRITE setValue)
00054   Q_PROPERTY( int mininum READ minimum WRITE setMinimum)
00055   Q_PROPERTY( int maximum READ maximum WRITE setMaximum)
00056   Q_PROPERTY( BarStyle barStyle READ barStyle WRITE setBarStyle )
00057   Q_PROPERTY( QColor barColor READ barColor WRITE setBarColor )
00058   Q_PROPERTY( QPixmap barPixmap READ barPixmap WRITE setBarPixmap )
00059   Q_PROPERTY( Qt::Orientation orientation READ orientation WRITE setOrientation )
00060   Q_PROPERTY( bool textEnabled READ textEnabled WRITE setTextEnabled )
00061 
00062 public:
00069   enum BarStyle { Solid, Blocked };
00070 
00074   explicit KGameProgress(QWidget *parent=0);
00075 
00079   explicit KGameProgress(Qt::Orientation orient, QWidget *parent=0);
00080 
00084   ~KGameProgress();
00085 
00091   void setBarStyle(BarStyle style);
00092 
00096   void setBarColor(const QColor &);
00097 
00101   void setBarPixmap(const QPixmap &);
00102 
00108   void setOrientation(Qt::Orientation);
00109 
00114   void setTextEnabled(bool);
00115 
00121   BarStyle barStyle() const;
00122 
00127   QColor barColor() const;
00128 
00134   const QPixmap *barPixmap() const;
00135 
00141   int value() const;
00142 
00148   int minimum() const;
00149 
00155   int maximum() const;
00156 
00162   Qt::Orientation orientation() const;
00163 
00170   bool textEnabled() const;
00171 
00174   virtual QSize sizeHint() const;
00175 
00178   virtual QSize minimumSizeHint() const;
00179 
00182   virtual QSizePolicy sizePolicy() const;
00183 
00188   QString format() const;
00189 
00190 public Q_SLOTS:
00191 
00200   void setFormat(const QString & format);
00201 
00207   void setValue(int value);
00208 
00214   void setMinimum(int value);
00215 
00221   void setMaximum(int value);
00222 
00230   void advance(int prog);
00231 
00234   void valueChange(int newValue);
00235 
00236 Q_SIGNALS:
00240   void percentageChanged(int);
00241 
00242 protected:
00245   void styleChange( QStyle& );
00248   void paletteChange( const QPalette & );
00251   void paintEvent( QPaintEvent *e );
00252 
00253 private Q_SLOTS:
00254   void paletteChange();
00255 
00256 private:
00257   class KGameProgressPrivate;
00258   KGameProgressPrivate * const d;
00259 };
00260 
00261 
00262 #endif

Generated on Sun Mar 16 08:02:53 2008 for Libkdegames by  doxygen 1.5.3