2024-04-04 11:29:52 +03:00
|
|
|
/*
|
|
|
|
This file is part of the KDE project
|
|
|
|
Copyright (C) 2024 Ivailo Monev <xakepa10@gmail.com>
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License version 2, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public License
|
|
|
|
along with this library; see the file COPYING.LIB. If not, write to
|
|
|
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
2014-11-13 19:30:51 +02:00
|
|
|
|
2024-04-04 11:38:00 +03:00
|
|
|
#ifndef CALENDAR_H
|
|
|
|
#define CALENDAR_H
|
2014-11-13 19:30:51 +02:00
|
|
|
|
2019-05-17 18:06:38 +00:00
|
|
|
#include <QTimer>
|
2024-04-03 23:22:38 +03:00
|
|
|
#include <KConfigDialog>
|
|
|
|
#include <KCModuleProxy>
|
2024-04-03 15:26:39 +03:00
|
|
|
#include <Plasma/PopupApplet>
|
|
|
|
#include <Plasma/Svg>
|
2019-05-17 18:06:38 +00:00
|
|
|
|
2024-04-03 15:26:39 +03:00
|
|
|
class CalendarWidget;
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
class CalendarApplet : public Plasma::PopupApplet
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2024-04-03 15:26:39 +03:00
|
|
|
public:
|
|
|
|
CalendarApplet(QObject *parent, const QVariantList &args);
|
2014-11-13 19:30:51 +02:00
|
|
|
|
2024-04-03 15:26:39 +03:00
|
|
|
void init() final;
|
|
|
|
QGraphicsWidget *graphicsWidget() final;
|
2024-04-03 23:22:38 +03:00
|
|
|
void createConfigurationInterface(KConfigDialog *parent) final;
|
2024-04-11 04:35:08 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void constraintsEvent(Plasma::Constraints constraints) final;
|
2024-04-03 15:26:39 +03:00
|
|
|
void popupEvent(bool show) final;
|
2014-11-13 19:30:51 +02:00
|
|
|
|
2024-04-03 15:26:39 +03:00
|
|
|
private slots:
|
2024-04-11 12:05:06 +03:00
|
|
|
void slotTimeout();
|
2024-04-03 23:22:38 +03:00
|
|
|
void slotConfigAccepted();
|
2024-04-20 06:59:41 +03:00
|
|
|
void slotLocaleChanged();
|
2014-11-13 19:30:51 +02:00
|
|
|
|
2024-04-03 15:26:39 +03:00
|
|
|
private:
|
2024-04-20 06:59:41 +03:00
|
|
|
void updateIcon();
|
|
|
|
void updateToolTip();
|
2014-11-13 19:30:51 +02:00
|
|
|
|
2024-04-04 17:00:34 +03:00
|
|
|
CalendarWidget* m_calendarwidget;
|
|
|
|
Plasma::Svg* m_svg;
|
|
|
|
QTimer* m_timer;
|
2024-04-03 15:26:39 +03:00
|
|
|
int m_day;
|
2024-04-20 06:59:41 +03:00
|
|
|
int m_utcday;
|
2024-04-03 23:22:38 +03:00
|
|
|
KCModuleProxy* m_kcmclockproxy;
|
2014-11-13 19:30:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
K_EXPORT_PLASMA_APPLET(calendar, CalendarApplet)
|
|
|
|
|
2024-04-04 11:38:00 +03:00
|
|
|
#endif // CALENDAR_H
|