1 /***************************************************************************
2 * Copyright (C) 2007-2008 by Riccardo Iaconelli <riccardo@kde.org> *
3 * Copyright (C) 2007-2008 by Sebastian Kuegler <sebas@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 ***************************************************************************/
24 #include <QtCore/QTime>
25 #include <QtCore/QDate>
27 #include <Plasma/Applet>
28 #include <Plasma/DataEngine>
29 #include <Plasma/Dialog>
31 #include "ui_clockConfig.h"
32 #include <plasmaclock/clockapplet.h>
34 class Clock
: public ClockApplet
38 Clock(QObject
*parent
, const QVariantList
&args
);
42 void paintInterface(QPainter
*painter
, const QStyleOptionGraphicsItem
*option
, const QRect
&contentsRect
);
45 void dataUpdated(const QString
&name
, const Plasma::DataEngine::Data
&data
);
49 void clockConfigAccepted();
50 void constraintsEvent(Plasma::Constraints constraints
);
53 void createClockConfigurationInterface(KConfigDialog
*parent
);
54 void changeEngineTimezone(const QString
&oldTimezone
, const QString
&newTimezone
);
58 bool showTimezone() const;
59 QRect
preparePainter(QPainter
*p
, const QRect
&rect
, const QFont
&font
, const QString
&text
, bool singleline
= false);
60 QRectF
normalLayout (int subtitleWidth
, int subtitleHeight
, const QRect
&contentsRect
);
61 QRectF
sideBySideLayout (int subtitleWidth
, int subtitleHeight
, const QRect
&contentsRect
);
63 QFont m_plainClockFont
;
64 bool m_useCustomColor
;
65 QColor m_plainClockColor
;
74 bool m_dateTimezoneBesides
;
76 int updateInterval() const;
77 Plasma::IntervalAlignment
intervalAlignment() const;
82 QVBoxLayout
*m_layout
;
84 QPixmap m_toolTipIcon
;
85 /// Designer Config files
89 K_EXPORT_PLASMA_APPLET(dig_clock
, Clock
)