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 TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 
00025 #ifndef FRAME_H
00026 #define FRAME_H
00027 
00028 #include <tqobject.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 TQObject
00044     {
00045         Q_OBJECT
00046   TQ_OBJECT
00047 
00048         public:
00049             Frame(TQObject *parent, KParts::ReadOnlyPart *part, TQWidget *w, const TQString& tit, bool watchSignals=true);
00050             virtual ~Frame();
00051 
00052             enum {Idle, Started, Completed, Canceled};
00053 
00054             KParts::ReadOnlyPart *part() const;
00055             TQWidget *widget() const;
00056             const TQString& title() const;
00057             const TQString& caption() const;
00058             int state() const;
00059             int progress() const;
00060             const TQString& statusText() const;
00061             
00063             void setAutoDeletePart(bool autoDelete);
00064 
00065         public slots:
00066             void setStarted();
00067             void setCanceled(const TQString &);
00068             void setCompleted();
00069             void setState(int);
00070             void setProgress(int);
00071             void setCaption(const TQString &);
00072             void setTitle(const TQString &);
00073             void setStatusText(const TQString &); 
00074 
00075         signals:
00076             void captionChanged(const TQString &);
00077             void titleChanged(Frame*, const TQString&);
00078             void started();
00079             void canceled(const TQString &);
00080             void completed();
00081             void loadingProgress(int);
00082             void statusText(const TQString &);
00083 
00084         private:
00085             KParts::ReadOnlyPart *m_part;
00086             TQWidget *m_widget;
00087             TQString m_title;
00088             TQString m_caption;
00089             int m_state;
00090             int m_progress;
00091             TQString m_statusText;
00092             TQString m_progressId;
00093             KPIM::ProgressItem *m_progressItem;
00094             bool m_autoDeletePart;
00095     };
00096 }
00097 
00098 #endif
00099 
00100 
00101 // vim: set et ts=4 sts=4 sw=4: