~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to libs/plasmaclock/clockapplet.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2007-2008 by Riccardo Iaconelli <riccardo@kde.org>      *
 
3
 *   Copyright (C) 2007-2008 by Sebastian Kuegler <sebas@kde.org>          *
 
4
 *   Copyright (C) 2009 by John Layt <john@layt.net>                       *
 
5
 *                                                                         *
 
6
 *   This program is free software; you can redistribute it and/or modify  *
 
7
 *   it under the terms of the GNU General Public License as published by  *
 
8
 *   the Free Software Foundation; either version 2 of the License, or     *
 
9
 *   (at your option) any later version.                                   *
 
10
 *                                                                         *
 
11
 *   This program is distributed in the hope that it will be useful,       *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
 *   GNU General Public License for more details.                          *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU General Public License     *
 
17
 *   along with this program; if not, write to the                         *
 
18
 *   Free Software Foundation, Inc.,                                       *
 
19
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 
20
 ***************************************************************************/
 
21
 
 
22
#ifndef CLOCKAPPLET_H
 
23
#define CLOCKAPPLET_H
 
24
 
 
25
#include <QtCore/QTime>
 
26
#include <QtCore/QDate>
 
27
 
 
28
#include <KDE/Plasma/DataEngine>
 
29
#include <KDE/Plasma/Dialog>
 
30
#include <KDE/Plasma/PopupApplet>
 
31
#include <KDE/Plasma/ToolTipManager>
 
32
 
 
33
#include "plasmaclock_export.h"
 
34
 
 
35
class KDialog;
 
36
class KConfigDialog;
 
37
 
 
38
namespace Plasma
 
39
{
 
40
    class Svg;
 
41
}
 
42
 
 
43
class PLASMACLOCK_EXPORT ClockApplet : public Plasma::PopupApplet
 
44
{
 
45
    Q_OBJECT
 
46
    public:
 
47
        ClockApplet(QObject *parent, const QVariantList &args);
 
48
        ~ClockApplet();
 
49
 
 
50
        void init();
 
51
 
 
52
        QString currentTimezone() const;
 
53
        QString prettyTimezone() const;
 
54
        bool isLocalTimezone() const;
 
55
        QStringList getSelectedTimezones() const;
 
56
        bool shouldDisplayTimezone() const;
 
57
        QList<QAction*> contextualActions();
 
58
 
 
59
        static QString localTimezone();
 
60
        static QString localTimezoneUntranslated();
 
61
 
 
62
        const KCalendarSystem *calendar () const;
 
63
 
 
64
    public Q_SLOTS:
 
65
        void configChanged();
 
66
        void toolTipAboutToShow();
 
67
        void toolTipHidden();
 
68
 
 
69
    protected:
 
70
        virtual void createClockConfigurationInterface(KConfigDialog *parent);
 
71
        virtual void clockConfigChanged();
 
72
        virtual void clockConfigAccepted();
 
73
        virtual void changeEngineTimezone(const QString &oldTimezone, const QString &newTimezone);
 
74
        virtual Plasma::ToolTipContent toolTipContent();
 
75
        void wheelEvent(QGraphicsSceneWheelEvent *event);
 
76
        void createConfigurationInterface(KConfigDialog *parent);
 
77
        void initExtenderItem(Plasma::ExtenderItem *item);
 
78
        void updateTipContent();
 
79
        void updateClockApplet();
 
80
        void updateClockApplet(const Plasma::DataEngine::Data &data);
 
81
        void popupEvent(bool show);
 
82
        void constraintsEvent(Plasma::Constraints constraints);
 
83
        QTime lastTimeSeen() const;
 
84
        void resetLastTimeSeen();
 
85
        void focusInEvent(QFocusEvent * event);
 
86
 
 
87
    protected Q_SLOTS:
 
88
        void setCurrentTimezone(const QString &tz);
 
89
        void configAccepted();
 
90
        void updateClockDefaultsTo();
 
91
        void speakTime(const QTime &);
 
92
        void launchTimeControlPanel();
 
93
 
 
94
    private Q_SLOTS:
 
95
        void updateClipboardMenu();
 
96
        void copyToClipboard(QAction* action);
 
97
 
 
98
    private:
 
99
        class Private;
 
100
        Private * const d;
 
101
 
 
102
        Q_PRIVATE_SLOT(d, void createCalendarExtender())
 
103
        Q_PRIVATE_SLOT(d, void createToday())
 
104
};
 
105
 
 
106
#endif