• Skip to content
  • Skip to link menu
KDE 4.1 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.h>
00028 #include <plasma/dataengine.h>
00029 #include <plasma/dialog.h>
00030 
00031 #include "ui_clockConfig.h"
00032 #include "ui_calendar.h"
00033 #include "clockapplet.h"
00034 
00035 class Clock : public ClockApplet
00036 {
00037     Q_OBJECT
00038     public:
00039         Clock(QObject *parent, const QVariantList &args);
00040         ~Clock();
00041 
00042         void init();
00043         void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
00044         void setPath(const QString&);
00045 
00046     public slots:
00047         void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);
00048         void updateColors();
00049 
00050     protected slots:
00051         void configAccepted();
00052         void constraintsEvent(Plasma::Constraints constraints);
00053 
00054     protected:
00055         void createConfigurationInterface(KConfigDialog *parent);
00056 
00057     private:
00058         void updateToolTipContent();
00059         void updateSize();
00060         QRect preparePainter(QPainter *p, const QRect &rect, const QFont &font, const QString &text);
00061 
00062         QFont m_plainClockFont;
00063         bool m_useCustomColor;
00064         QColor m_plainClockColor;
00065         QRect m_dateRect;
00066 
00067         bool m_showDate;
00068         bool m_showYear;
00069         bool m_showDay;
00070         bool m_showSeconds;
00071         bool m_showTimezone;
00072 
00073         int updateInterval() const;
00074         Plasma::IntervalAlignment intervalAlignment() const;
00075 
00076         QStringList m_timeZones;
00077         QString m_prettyTimezone;
00078         QTime m_time;
00079         QDate m_date;
00080         Plasma::Dialog *m_calendar;
00081         QVBoxLayout *m_layout;
00082         QTime m_lastTimeSeen;
00083         QPixmap m_toolTipIcon;
00085         Ui::clockConfig ui;
00086         Ui::calendar m_calendarUi;
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
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
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