libyui
YDownloadProgress.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: YDownloadProgress.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YDownloadProgress_h
26 #define YDownloadProgress_h
27 
28 #include "YWidget.h"
29 
30 
32 
37 class YDownloadProgress : public YWidget
38 {
39 protected:
50  const std::string & label,
51  const std::string & filename,
52  YFileSize_t expectedSize );
53 public:
57  virtual ~YDownloadProgress();
58 
63  virtual const char * widgetClass() const { return "YDownloadProgress"; }
64 
68  std::string label() const;
69 
76  virtual void setLabel( const std::string & label );
77 
81  std::string filename() const;
82 
89  virtual void setFilename( const std::string & filename );
90 
94  YFileSize_t expectedSize() const;
95 
102  virtual void setExpectedSize( YFileSize_t newSize );
103 
111  virtual YFileSize_t currentFileSize() const;
112 
116  int currentPercent() const;
117 
121  int value() const { return currentPercent(); }
122 
133  virtual bool setProperty( const std::string & propertyName,
134  const YPropertyValue & val );
135 
142  virtual YPropertyValue getProperty( const std::string & propertyName );
143 
150  virtual const YPropertySet & propertySet();
151 
152 
153 private:
154 
156 };
157 
158 
159 #endif // YDownloadProgress_h
std::string filename() const
Definition: YDownloadProgress.cc:88
Definition: YDownloadProgress.h:37
virtual YFileSize_t currentFileSize() const
Definition: YDownloadProgress.cc:131
Definition: YProperty.h:104
Definition: YProperty.h:197
virtual const char * widgetClass() const
Definition: YDownloadProgress.h:63
YWidget * parent() const
Definition: YWidget.cc:271
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition: YDownloadProgress.cc:186
Definition: YDownloadProgress.cc:37
virtual void setExpectedSize(YFileSize_t newSize)
Definition: YDownloadProgress.cc:109
virtual void setLabel(const std::string &label)
Definition: YDownloadProgress.cc:81
virtual void setFilename(const std::string &filename)
Definition: YDownloadProgress.cc:95
virtual ~YDownloadProgress()
Definition: YDownloadProgress.cc:67
YDownloadProgress(YWidget *parent, const std::string &label, const std::string &filename, YFileSize_t expectedSize)
Definition: YDownloadProgress.cc:53
std::string label() const
Definition: YDownloadProgress.cc:74
YFileSize_t expectedSize() const
Definition: YDownloadProgress.cc:102
virtual const YPropertySet & propertySet()
Definition: YDownloadProgress.cc:143
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition: YDownloadProgress.cc:169
int value() const
Definition: YDownloadProgress.h:121
Definition: YWidget.h:54
int currentPercent() const
Definition: YDownloadProgress.cc:116