1
/***************************************************************************
2
* Copyright 2007 by Aaron Seigo <aseigo@kde.org> *
3
* Copyright 2007 by Riccardo Iaconelli <riccardo@kde.org> *
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. *
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. *
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
***************************************************************************/
28
#include <QGraphicsItem>
30
#include <Plasma/Containment>
31
#include <Plasma/DataEngine>
33
#include <plasmaclock/clockapplet.h>
34
#include "ui_clockConfig.h"
45
class Clock : public ClockApplet
49
Clock(QObject *parent, const QVariantList &args);
53
void constraintsEvent(Plasma::Constraints constraints);
54
QPainterPath shape() const;
55
void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
58
void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);
61
void createClockConfigurationInterface(KConfigDialog *parent);
62
void changeEngineTimezone(const QString &oldTimezone, const QString &newTimezone);
65
void clockConfigAccepted();
66
void clockConfigChanged();
68
void moveSecondHand();
71
void connectToEngine();
72
void drawHand(QPainter *p, const QRect &rect, const qreal verticalTranslation, const qreal rotation, const QString &handName);
73
QRect tzRect(const QString &text);
74
Plasma::FrameSvg *tzFrame();
75
void invalidateCache();
77
QString m_oldTimezone;
78
bool m_showSecondHand;
80
bool m_showTimezoneString;
81
bool m_showingTimezone;
82
Plasma::FrameSvg *m_tzFrame;
90
RepaintCache m_repaintCache;
94
qreal m_verticalTranslation;
95
QTimer *m_secondHandUpdateTimer;
96
bool m_animateSeconds;
98
/// Designer Config file
102
K_EXPORT_PLASMA_APPLET(clock, Clock)