libyui  3.3.2
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 /**
36  * A fancy widget with a world map.
37  **/
38 class YTimezoneSelector : public YWidget
39 {
40 protected:
41  /**
42  * Constructor. This widget isn't doing much on it's own, but the
43  * UI may have some fancy use. @arg pixmap should be a png or jpg
44  * of a world map with centered 0°0° and the timezones are a map
45  * between zone.tab entry and user visible string.
46  *
47  * The widget is only displaying timezones/cities in that map
48  **/
50  const std::string &pixmap,
51  const std::map<std::string, std::string> &timezones );
52 
53 public:
54  /**
55  * Destructor.
56  **/
57  virtual ~YTimezoneSelector();
58 
59  /**
60  * Return a descriptive name of this widget class for logging,
61  * debugging etc.
62  **/
63  virtual const char * widgetClass() const { return "YTimezoneSelector"; }
64 
65  /**
66  * Set a property.
67  * Reimplemented from YWidget.
68  *
69  * This function may throw YUIPropertyExceptions.
70  *
71  * This function returns 'true' if the value was successfully set and
72  * 'false' if that value requires special handling (not in error cases:
73  * those are covered by exceptions).
74  **/
75  virtual bool setProperty( const std::string & propertyName,
76  const YPropertyValue & val );
77 
78  /**
79  * Get a property.
80  * Reimplemented from YWidget.
81  *
82  * This method may throw YUIPropertyExceptions.
83  **/
84  virtual YPropertyValue getProperty( const std::string & propertyName );
85 
86  /**
87  * Return this class's property set.
88  * This also initializes the property upon the first call.
89  *
90  * Reimplemented from YWidget.
91  **/
92  virtual const YPropertySet & propertySet();
93 
94  /**
95  * subclasses have to implement this to return value
96  */
97  virtual std::string currentZone() const = 0;
98 
99  /**
100  * subclasses have to implement this to set value
101  */
102  virtual void setCurrentZone( const std::string &zone, bool zoom ) = 0;
103 
104 private:
106 
107 };
108 
109 
110 #endif // YMultiProgressMeter_h
Transport class for the value of simple properties.
Definition: YProperty.h:104
A set of properties to check names and types against.
Definition: YProperty.h:197
YWidget * parent() const
Return this widget&#39;s parent or 0 if it doesn&#39;t have a parent.
Definition: YWidget.cc:269
virtual ~YTimezoneSelector()
Destructor.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
A fancy widget with a world map.
virtual const YPropertySet & propertySet()
Return this class&#39;s property set.
virtual std::string currentZone() const =0
subclasses have to implement this to return value
Abstract base class of all UI widgets.
Definition: YWidget.h:54
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
virtual void setCurrentZone(const std::string &zone, bool zoom)=0
subclasses have to implement this to set value
virtual const char * widgetClass() const
Return a descriptive name of this widget class for logging, debugging etc.
YTimezoneSelector(YWidget *parent, const std::string &pixmap, const std::map< std::string, std::string > &timezones)
Constructor.