libyui  3.0.10
/usr/src/RPM/BUILD/libyui-3.0.10/src/YTimezoneSelector.h
00001 /*
00002   Copyright (C) 2000-2012 Novell, Inc
00003   This library is free software; you can redistribute it and/or modify
00004   it under the terms of the GNU Lesser General Public License as
00005   published by the Free Software Foundation; either version 2.1 of the
00006   License, or (at your option) version 3.0 of the License. This library
00007   is distributed in the hope that it will be useful, but WITHOUT ANY
00008   WARRANTY; without even the implied warranty of MERCHANTABILITY or 
00009   FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00010   License for more details. You should have received a copy of the GNU
00011   Lesser General Public License along with this library; if not, write
00012   to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
00013   Floor, Boston, MA 02110-1301 USA
00014 */
00015 
00016 
00017 /*-/
00018 
00019   File:         YTimezoneSelector.h
00020 
00021   Author:       Stephan Kulow <coolo@suse.de>
00022 
00023 /-*/
00024 
00025 #ifndef YTimezoneSelector_h
00026 #define YTimezoneSelector_h
00027 
00028 #include <map>
00029 #include "YWidget.h"
00030 
00031 
00032 class YTimezoneSelectorPrivate;
00033 
00034 
00035 class YTimezoneSelector : public YWidget
00036 {
00037 protected:
00038     /**
00039      * Constructor. This widget isn't doing much on it's own, but the
00040      * UI may have some fancy use. @arg pixmap should be a png or jpg
00041      * of a world map with centered 0°0° and the timezones are a map
00042      * between zone.tab entry and user visible string.
00043      *
00044      * The widget is only displaying timezones/cities in that map
00045      **/
00046     YTimezoneSelector( YWidget *parent,
00047                        const std::string &pixmap,
00048                        const std::map<std::string, std::string> &timezones );
00049 
00050 public:
00051     /**
00052      * Destructor.
00053      **/
00054     virtual ~YTimezoneSelector();
00055 
00056     /**
00057      * Return a descriptive name of this widget class for logging,
00058      * debugging etc.
00059      **/
00060     virtual const char * widgetClass() const { return "YTimezoneSelector"; }
00061 
00062     /**
00063      * Set a property.
00064      * Reimplemented from YWidget.
00065      *
00066      * This function may throw YUIPropertyExceptions.
00067      *
00068      * This function returns 'true' if the value was successfully set and
00069      * 'false' if that value requires special handling (not in error cases:
00070      * those are covered by exceptions).
00071      **/
00072     virtual bool setProperty( const std::string & propertyName,
00073                               const YPropertyValue & val );
00074 
00075     /**
00076      * Get a property.
00077      * Reimplemented from YWidget.
00078      *
00079      * This method may throw YUIPropertyExceptions.
00080      **/
00081     virtual YPropertyValue getProperty( const std::string & propertyName );
00082 
00083     /**
00084      * Return this class's property set.
00085      * This also initializes the property upon the first call.
00086      *
00087      * Reimplemented from YWidget.
00088      **/
00089     virtual const YPropertySet & propertySet();
00090 
00091     /**
00092      * subclasses have to implement this to return value
00093      */
00094     virtual std::string currentZone() const = 0;
00095 
00096     /**
00097      * subclasses have to implement this to set value
00098      */
00099     virtual void setCurrentZone( const std::string &zone, bool zoom ) = 0;
00100 
00101 private:
00102     ImplPtr<YTimezoneSelectorPrivate> priv;
00103 
00104 };
00105 
00106 
00107 #endif // YMultiProgressMeter_h
 All Classes Functions Variables Enumerations Friends