not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / plasmaclock / clockapplet.h
blobb07a1f49b9dda9472466b57a26e5381dc7b7e515
1 /***************************************************************************
2 * Copyright (C) 2007-2008 by Riccardo Iaconelli <riccardo@kde.org> *
3 * Copyright (C) 2007-2008 by Sebastian Kuegler <sebas@kde.org> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
19 ***************************************************************************/
21 #ifndef CLOCKAPPLET_H
22 #define CLOCKAPPLET_H
24 #include <QtCore/QTime>
25 #include <QtCore/QDate>
27 #include <KDE/Plasma/DataEngine>
28 #include <KDE/Plasma/Dialog>
29 #include <KDE/Plasma/PopupApplet>
30 #include <KDE/Plasma/ToolTipManager>
32 #include "plasmaclock_export.h"
34 class KDialog;
35 class KConfigDialog;
37 namespace Plasma
39 class Svg;
42 class PLASMACLOCK_EXPORT ClockApplet : public Plasma::PopupApplet
44 Q_OBJECT
45 public:
46 ClockApplet(QObject *parent, const QVariantList &args);
47 ~ClockApplet();
49 void init();
51 QString currentTimezone() const;
52 QString prettyTimezone() const;
53 bool isLocalTimezone() const;
54 QStringList getSelectedTimezones() const;
55 bool shouldDisplayTimezone() const;
57 static QString localTimezone();
58 static QString localTimezoneUntranslated();
60 public Q_SLOTS:
61 void toolTipAboutToShow();
62 void toolTipHidden();
64 protected:
65 virtual void createClockConfigurationInterface(KConfigDialog *parent);
66 virtual void clockConfigAccepted();
67 virtual void changeEngineTimezone(const QString &oldTimezone, const QString &newTimezone);
68 virtual Plasma::ToolTipContent toolTipContent();
69 void wheelEvent(QGraphicsSceneWheelEvent *event);
70 void createConfigurationInterface(KConfigDialog *parent);
71 void initExtenderItem(Plasma::ExtenderItem *item);
72 void updateTipContent();
73 void popupEvent(bool show);
75 protected Q_SLOTS:
76 void setCurrentTimezone(const QString &tz);
77 void configAccepted();
78 void updateClockDefaultsTo();
80 private:
81 class Private;
82 Private * const d;
84 Q_PRIVATE_SLOT(d, void createCalendar())
87 #endif