akregator/src

frame.h

00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2004 Sashmit Bhaduri <smt@vfemail.net>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #ifndef FRAME_H
00026 #define FRAME_H
00027 
00028 #include <qobject.h>
00029 
00030 namespace KParts
00031 {
00032     class ReadOnlyPart;
00033 }
00034 
00035 namespace KPIM
00036 {
00037     class ProgressItem;
00038 }
00039 
00040 namespace Akregator
00041 {
00042 
00043     class Frame : public QObject
00044     {
00045         Q_OBJECT
00046 
00047         public:
00048             Frame(QObject *parent, KParts::ReadOnlyPart *part, QWidget *w, const QString& tit, bool watchSignals=true);
00049             virtual ~Frame();
00050 
00051             enum {Idle, Started, Completed, Canceled};
00052 
00053             KParts::ReadOnlyPart *part() const;
00054             QWidget *widget() const;
00055             const QString& title() const;
00056             const QString& caption() const;
00057             int state() const;
00058             int progress() const;
00059             const QString& statusText() const;
00060             
00062             void setAutoDeletePart(bool autoDelete);
00063 
00064         public slots:
00065             void setStarted();
00066             void setCanceled(const QString &);
00067             void setCompleted();
00068             void setState(int);
00069             void setProgress(int);
00070             void setCaption(const QString &);
00071             void setTitle(const QString &);
00072             void setStatusText(const QString &); 
00073 
00074         signals:
00075             void captionChanged(const QString &);
00076             void titleChanged(Frame*, const QString&);
00077             void started();
00078             void canceled(const QString &);
00079             void completed();
00080             void loadingProgress(int);
00081             void statusText(const QString &);
00082 
00083         private:
00084             KParts::ReadOnlyPart *m_part;
00085             QWidget *m_widget;
00086             QString m_title;
00087             QString m_caption;
00088             int m_state;
00089             int m_progress;
00090             QString m_statusText;
00091             QString m_progressId;
00092             KPIM::ProgressItem *m_progressItem;
00093             bool m_autoDeletePart;
00094     };
00095 }
00096 
00097 #endif
00098 
00099 
00100 // vim: set et ts=4 sts=4 sw=4:
KDE Home | KDE Accessibility Home | Description of Access Keys