akregator/src

frame.h
1/*
2 This file is part of Akregator.
3
4 Copyright (C) 2004 Sashmit Bhaduri <smt@vfemail.net>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
20 As a special exception, permission is given to link this program
21 with any edition of TQt, and distribute the resulting executable,
22 without including the source code for TQt in the source distribution.
23*/
24
25#ifndef FRAME_H
26#define FRAME_H
27
28#include <tqobject.h>
29
30namespace KParts
31{
32 class ReadOnlyPart;
33}
34
35namespace KPIM
36{
37 class ProgressItem;
38}
39
40namespace Akregator
41{
42
43 class Frame : public TQObject
44 {
45 TQ_OBJECT
46
47
48 public:
49 Frame(TQObject *parent, KParts::ReadOnlyPart *part, TQWidget *w, const TQString& tit, bool watchSignals=true);
50 virtual ~Frame();
51
52 enum {Idle, Started, Completed, Canceled};
53
54 KParts::ReadOnlyPart *part() const;
55 TQWidget *widget() const;
56 const TQString& title() const;
57 const TQString& caption() const;
58 int state() const;
59 int progress() const;
60 const TQString& statusText() const;
61
63 void setAutoDeletePart(bool autoDelete);
64
65 public slots:
66 void setStarted();
67 void setCanceled(const TQString &);
68 void setCompleted();
69 void setState(int);
70 void setProgress(int);
71 void setCaption(const TQString &);
72 void setTitle(const TQString &);
73 void setStatusText(const TQString &);
74
75 signals:
76 void captionChanged(const TQString &);
77 void titleChanged(Frame*, const TQString&);
78 void started();
79 void canceled(const TQString &);
80 void completed();
81 void loadingProgress(int);
82 void statusText(const TQString &);
83
84 private:
85 KParts::ReadOnlyPart *m_part;
86 TQWidget *m_widget;
87 TQString m_title;
88 TQString m_caption;
89 int m_state;
90 int m_progress;
91 TQString m_statusText;
92 TQString m_progressId;
93 KPIM::ProgressItem *m_progressItem;
94 bool m_autoDeletePart;
95 };
96}
97
98#endif