1
/***************************************************************************
2
* Copyright (C) 2007-2008 by Riccardo Iaconelli <riccardo@kde.org> *
3
* Copyright (C) 2007-2008 by Sebastian Kuegler <sebas@kde.org> *
4
* Copyright (C) 2009 by John Layt <john@layt.net> *
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 2 of the License, or *
9
* (at your option) any later version. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
20
***************************************************************************/
25
#include <QtCore/QTime>
26
#include <QtCore/QDate>
28
#include <KDE/Plasma/DataEngine>
29
#include <KDE/Plasma/Dialog>
30
#include <KDE/Plasma/PopupApplet>
31
#include <KDE/Plasma/ToolTipManager>
33
#include "plasmaclock_export.h"
43
class PLASMACLOCK_EXPORT ClockApplet : public Plasma::PopupApplet
47
ClockApplet(QObject *parent, const QVariantList &args);
52
QString currentTimezone() const;
53
QString prettyTimezone() const;
54
bool isLocalTimezone() const;
55
QStringList getSelectedTimezones() const;
56
bool shouldDisplayTimezone() const;
57
QList<QAction*> contextualActions();
59
static QString localTimezone();
60
static QString localTimezoneUntranslated();
62
const KCalendarSystem *calendar () const;
66
void toolTipAboutToShow();
70
virtual void createClockConfigurationInterface(KConfigDialog *parent);
71
virtual void clockConfigChanged();
72
virtual void clockConfigAccepted();
73
virtual void changeEngineTimezone(const QString &oldTimezone, const QString &newTimezone);
74
virtual Plasma::ToolTipContent toolTipContent();
75
void wheelEvent(QGraphicsSceneWheelEvent *event);
76
void createConfigurationInterface(KConfigDialog *parent);
77
void initExtenderItem(Plasma::ExtenderItem *item);
78
void updateTipContent();
79
void updateClockApplet();
80
void updateClockApplet(const Plasma::DataEngine::Data &data);
81
void popupEvent(bool show);
82
void constraintsEvent(Plasma::Constraints constraints);
83
QTime lastTimeSeen() const;
84
void resetLastTimeSeen();
85
void focusInEvent(QFocusEvent * event);
88
void setCurrentTimezone(const QString &tz);
89
void configAccepted();
90
void updateClockDefaultsTo();
91
void speakTime(const QTime &);
92
void launchTimeControlPanel();
95
void updateClipboardMenu();
96
void copyToClipboard(QAction* action);
102
Q_PRIVATE_SLOT(d, void createCalendarExtender())
103
Q_PRIVATE_SLOT(d, void createToday())