libyui-qt
YQDownloadProgress.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YQDownloadProgress.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YQDownloadProgress_h
27 #define YQDownloadProgress_h
28 
29 #include <QFrame>
30 #include <yui/YDownloadProgress.h>
31 
32 class YQWidgetCaption;
33 class QProgressBar;
34 
35 
36 class YQDownloadProgress : public QFrame, public YDownloadProgress
37 {
38  Q_OBJECT
39 
40 public:
41 
45  YQDownloadProgress( YWidget * parent,
46  const std::string & label,
47  const std::string & filename,
48  YFileSize_t expectedSize );
49 
53  virtual ~YQDownloadProgress();
54 
60  virtual void setLabel( const std::string & label );
61 
67  virtual void setFilename( const std::string & filename );
68 
74  virtual void setExpectedSize( YFileSize_t expectedSize );
75 
81  virtual void setEnabled( bool enabled );
82 
88  virtual int preferredWidth();
89 
95  virtual int preferredHeight();
96 
102  virtual void setSize( int newWidth, int newHeight );
103 
104 
105 public slots:
109  void pollFileSize( void );
110 
111 
112 protected:
113 
114  YQWidgetCaption * _caption;
115  QProgressBar * _qt_progressBar;
116  QTimer * _timer;
117 };
118 
119 
120 #endif // YQDownloadProgress_h
virtual int preferredWidth()
Definition: YQDownloadProgress.cc:123
virtual void setEnabled(bool enabled)
Definition: YQDownloadProgress.cc:114
virtual int preferredHeight()
Definition: YQDownloadProgress.cc:130
Definition: YQDownloadProgress.h:36
virtual void setExpectedSize(YFileSize_t expectedSize)
Definition: YQDownloadProgress.cc:99
virtual ~YQDownloadProgress()
Definition: YQDownloadProgress.cc:76
virtual void setSize(int newWidth, int newHeight)
Definition: YQDownloadProgress.cc:137
YQDownloadProgress(YWidget *parent, const std::string &label, const std::string &filename, YFileSize_t expectedSize)
Definition: YQDownloadProgress.cc:41
virtual void setFilename(const std::string &filename)
Definition: YQDownloadProgress.cc:91
Definition: YQWidgetCaption.h:38
void pollFileSize(void)
Definition: YQDownloadProgress.cc:107
virtual void setLabel(const std::string &label)
Definition: YQDownloadProgress.cc:83