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 ***************************************************************************/
25 #include <QPaintDevice>
29 #include <QPaintEvent>
32 #include <QGraphicsItem>
35 #include <Plasma/Containment>
36 #include <Plasma/DataEngine>
38 #include <plasmaclock/clockapplet.h>
39 #include "ui_clockConfig.h"
49 class Clock
: public ClockApplet
53 Clock(QObject
*parent
, const QVariantList
&args
);
57 void constraintsEvent(Plasma::Constraints constraints
);
58 QPainterPath
shape() const;
59 void paintInterface(QPainter
*painter
, const QStyleOptionGraphicsItem
*option
, const QRect
&contentsRect
);
62 void dataUpdated(const QString
&name
, const Plasma::DataEngine::Data
&data
);
65 void createClockConfigurationInterface(KConfigDialog
*parent
);
66 void changeEngineTimezone(const QString
&oldTimezone
, const QString
&newTimezone
);
69 void clockConfigAccepted();
71 void moveSecondHand();
74 void connectToEngine();
75 void drawHand(QPainter
*p
, const QRect
&rect
, const qreal verticalTranslation
, const qreal rotation
, const QString
&handName
);
77 bool m_showSecondHand
;
79 bool m_showTimezoneString
;
88 RepaintCache m_repaintCache
;
92 qreal m_verticalTranslation
;
93 QTimer
*m_secondHandUpdateTimer
;
95 /// Designer Config file
99 K_EXPORT_PLASMA_APPLET(clock
, Clock
)