• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Applets

clock.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2007-2008 by Riccardo Iaconelli <riccardo@kde.org>      *
00003  *   Copyright (C) 2007-2008 by Sebastian Kuegler <sebas@kde.org>          *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
00019  ***************************************************************************/
00020 
00021 #ifndef CLOCK_H
00022 #define CLOCK_H
00023 
00024 #include <QtCore/QTime>
00025 #include <QtCore/QDate>
00026 
00027 #include <Plasma/Applet>
00028 #include <Plasma/DataEngine>
00029 #include <Plasma/Dialog>
00030 
00031 #include "ui_clockConfig.h"
00032 #include <plasmaclock/clockapplet.h>
00033 
00034 class Clock : public ClockApplet
00035 {
00036     Q_OBJECT
00037     public:
00038         Clock(QObject *parent, const QVariantList &args);
00039         ~Clock();
00040 
00041         void init();
00042         void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
00043 
00044     public slots:
00045         void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);
00046         void updateColors();
00047 
00048     protected slots:
00049         void clockConfigAccepted();
00050         void constraintsEvent(Plasma::Constraints constraints);
00051 
00052     protected:
00053         void createClockConfigurationInterface(KConfigDialog *parent);
00054         void changeEngineTimezone(const QString &oldTimezone, const QString &newTimezone);
00055 
00056     private:
00057         void updateSize();
00058         bool showTimezone() const;
00059         QRect preparePainter(QPainter *p, const QRect &rect, const QFont &font, const QString &text, bool singleline = false);
00060         QRectF normalLayout (int subtitleWidth, int subtitleHeight, const QRect &contentsRect);
00061         QRectF sideBySideLayout (int subtitleWidth, int subtitleHeight, const QRect &contentsRect);
00062 
00063         QFont m_plainClockFont;
00064         bool m_useCustomColor;
00065         QColor m_plainClockColor;
00066         QRect m_timeRect;
00067         QRect m_dateRect;
00068 
00069         bool m_showDate;
00070         bool m_showYear;
00071         bool m_showDay;
00072         bool m_showSeconds;
00073         bool m_showTimezone;
00074         bool m_dateTimezoneBesides;
00075 
00076         int updateInterval() const;
00077         Plasma::IntervalAlignment intervalAlignment() const;
00078 
00079         QTime m_time;
00080         QDate m_date;
00081         QString m_dateString;
00082         QVBoxLayout *m_layout;
00083         QTime m_lastTimeSeen;
00084         QPixmap m_toolTipIcon;
00086         Ui::clockConfig ui;
00087 };
00088 
00089 K_EXPORT_PLASMA_APPLET(dig_clock, Clock)
00090 
00091 #endif

Applets

Skip menu "Applets"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal