File indexing completed on 2024-05-12 05:14:56

0001 /*
0002  *  reminder.h  -  reminder setting widget
0003  *  Program:  kalarm
0004  *  SPDX-FileCopyrightText: 2003-2019 David Jarvie <djarvie@kde.org>
0005  *
0006  *  SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #pragma once
0010 
0011 #include <QFrame>
0012 
0013 namespace KAlarmCal { class KADateTime; }
0014 class TimeSelector;
0015 class CheckBox;
0016 class ComboBox;
0017 
0018 
0019 class Reminder : public QFrame
0020 {
0021     Q_OBJECT
0022 public:
0023     Reminder(const QString& reminderWhatsThis, const QString& valueWhatsThis,
0024              const QString& beforeAfterWhatsThis, bool allowHourMinute,
0025              bool showOnceOnly, QWidget* parent);
0026     void           setAfterOnly(bool after);
0027     bool           isReminder() const;
0028     bool           isOnceOnly() const;
0029     int            minutes() const;
0030     void           setMinutes(int minutes, bool dateOnly);
0031     void           setReadOnly(bool);
0032     void           setDateOnly(bool dateOnly);
0033     void           setMaximum(int hourmin, int days);
0034     void           setFocusOnCount();
0035     void           setOnceOnly(bool);
0036     void           enableOnceOnly(bool enable);
0037 
0038     static QString i18n_chk_FirstRecurrenceOnly();    // text of 'Reminder for first recurrence only' checkbox
0039 
0040 public Q_SLOTS:
0041     void           setDefaultUnits(const KAlarmCal::KADateTime&);
0042 
0043 Q_SIGNALS:
0044     void           changed();
0045 
0046 private Q_SLOTS:
0047     void           slotReminderToggled(bool);
0048 
0049 private:
0050     TimeSelector*  mTime;
0051     CheckBox*      mOnceOnly;
0052     ComboBox*      mTimeSignCombo;
0053     bool           mReadOnly {false};   // the widget is read only
0054     bool           mOnceOnlyEnabled;    // 'mOnceOnly' checkbox is allowed to be enabled
0055 };
0056 
0057 // vim: et sw=4: