libyui  3.0.10
 All Classes Functions Variables Enumerations Friends
YBusyIndicator.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: YBusyIndicator.h
20 
21  Author: Thomas Goettlicher <tgoettlicher@suse.de>
22 
23 /-*/
24 
25 #ifndef YBusyIndicator_h
26 #define YBusyIndicator_h
27 
28 #include "YWidget.h"
29 
31 
32 
33 class YBusyIndicator : public YWidget
34 {
35 protected:
36  /**
37  * Constructor.
38  **/
40  const std::string & label,
41  int timeout = 1000,
42  bool alive = true );
43 
44 public:
45  /**
46  * Destructor.
47  **/
48  virtual ~YBusyIndicator();
49 
50  /**
51  * Returns a descriptive name of this widget class for logging,
52  * debugging etc.
53  **/
54  virtual const char * widgetClass() const { return "YBusyIndicator"; }
55 
56  /**
57  * Get the label (the caption above the progress bar).
58  **/
59  std::string label();
60 
61  /**
62  * Set the label (the caption above the progress bar).
63  *
64  * Derived classes are free to reimplement this, but they should call this
65  * base class method at the end of the overloaded function.
66  **/
67  virtual void setLabel( const std::string & label );
68 
69  /**
70  * Return the current timeout in milliseconds.
71  **/
72  int timeout() const;
73 
74  /**
75  * Set the timeout in milliseconds after that the widget shows 'stalled'
76  * when no new tick is received.
77  *
78  * Derived classes should reimplement this, but they should call this
79  * base class method at the end of the overloaded function.
80  **/
81  virtual void setTimeout( int newTimeout );
82 
83  /**
84  * Return whether busy indicator is alive or in stalled stated.
85  **/
86  bool alive() const;
87 
88 
89  /**
90  * Send a keep alive message to prevent BusyIndicator from changing
91  * to 'stalled' state.
92  *
93  * Derived classes should reimplement this, but they should call this
94  * base class method at the end of the overloaded function.
95  **/
96  virtual void setAlive( bool newAlive );
97 
98 
99  /**
100  * Set a property.
101  * Reimplemented from YWidget.
102  *
103  * This function may throw YUIPropertyExceptions.
104  *
105  * This function returns 'true' if the value was successfully set and
106  * 'false' if that value requires special handling (not in error cases:
107  * those are covered by exceptions).
108  **/
109  virtual bool setProperty( const std::string & propertyName,
110  const YPropertyValue & val );
111 
112  /**
113  * Get a property.
114  * Reimplemented from YWidget.
115  *
116  * This method may throw YUIPropertyExceptions.
117  **/
118  virtual YPropertyValue getProperty( const std::string & propertyName );
119 
120  /**
121  * Return this class's property set.
122  * This also initializes the property upon the first call.
123  *
124  * Reimplemented from YWidget.
125  **/
126  virtual const YPropertySet & propertySet();
127 
128 
129 private:
130 
132 };
133 
134 
135 #endif // YBusyIndicator_h
virtual YPropertyValue getProperty(const std::string &propertyName)
YWidget * parent() const
Definition: YWidget.cc:269
std::string label()
virtual void setAlive(bool newAlive)
virtual ~YBusyIndicator()
virtual const char * widgetClass() const
int timeout() const
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
virtual void setLabel(const std::string &label)
virtual void setTimeout(int newTimeout)
virtual const YPropertySet & propertySet()
bool alive() const
YBusyIndicator(YWidget *parent, const std::string &label, int timeout=1000, bool alive=true)