libyui  3.0.10
 All Classes Functions Variables Enumerations Friends
YTimezoneSelector.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: YTimezoneSelector.h
20 
21  Author: Stephan Kulow <coolo@suse.de>
22 
23 /-*/
24 
25 #ifndef YTimezoneSelector_h
26 #define YTimezoneSelector_h
27 
28 #include <map>
29 #include "YWidget.h"
30 
31 
33 
34 
35 class YTimezoneSelector : public YWidget
36 {
37 protected:
38  /**
39  * Constructor. This widget isn't doing much on it's own, but the
40  * UI may have some fancy use. @arg pixmap should be a png or jpg
41  * of a world map with centered 0°0° and the timezones are a map
42  * between zone.tab entry and user visible string.
43  *
44  * The widget is only displaying timezones/cities in that map
45  **/
47  const std::string &pixmap,
48  const std::map<std::string, std::string> &timezones );
49 
50 public:
51  /**
52  * Destructor.
53  **/
54  virtual ~YTimezoneSelector();
55 
56  /**
57  * Return a descriptive name of this widget class for logging,
58  * debugging etc.
59  **/
60  virtual const char * widgetClass() const { return "YTimezoneSelector"; }
61 
62  /**
63  * Set a property.
64  * Reimplemented from YWidget.
65  *
66  * This function may throw YUIPropertyExceptions.
67  *
68  * This function returns 'true' if the value was successfully set and
69  * 'false' if that value requires special handling (not in error cases:
70  * those are covered by exceptions).
71  **/
72  virtual bool setProperty( const std::string & propertyName,
73  const YPropertyValue & val );
74 
75  /**
76  * Get a property.
77  * Reimplemented from YWidget.
78  *
79  * This method may throw YUIPropertyExceptions.
80  **/
81  virtual YPropertyValue getProperty( const std::string & propertyName );
82 
83  /**
84  * Return this class's property set.
85  * This also initializes the property upon the first call.
86  *
87  * Reimplemented from YWidget.
88  **/
89  virtual const YPropertySet & propertySet();
90 
91  /**
92  * subclasses have to implement this to return value
93  */
94  virtual std::string currentZone() const = 0;
95 
96  /**
97  * subclasses have to implement this to set value
98  */
99  virtual void setCurrentZone( const std::string &zone, bool zoom ) = 0;
100 
101 private:
103 
104 };
105 
106 
107 #endif // YMultiProgressMeter_h