Warning, file /pim/kalarm/src/latecancel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  *  latecancel.h  -  widget to specify cancellation if late
0003  *  Program:  kalarm
0004  *  SPDX-FileCopyrightText: 2004-2023 David Jarvie <djarvie@kde.org>
0005  *
0006  *  SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #pragma once
0010 
0011 #include "timeselector.h"
0012 #include "lib/timeperiod.h"
0013 
0014 #include <QFrame>
0015 
0016 class QStackedWidget;
0017 class CheckBox;
0018 class QHBoxLayout;
0019 
0020 
0021 class LateCancelSelector : public QFrame
0022 {
0023     Q_OBJECT
0024 public:
0025     LateCancelSelector(bool allowHourMinute, QWidget* parent);
0026     int             minutes() const;
0027     void            setMinutes(int Minutes, bool dateOnly, TimePeriod::Units defaultUnits);
0028     void            setDateOnly(bool dateOnly);
0029     void            showAutoClose(bool show);
0030     bool            isAutoClose() const;
0031     void            setAutoClose(bool autoClose);
0032     bool            isReadOnly() const     { return mReadOnly; }
0033     void            setReadOnly(bool);
0034     /** Add a widget, right adjusted, beside Auto-close checkbox. */
0035     void            addWidget(QWidget*);
0036 
0037     static QString  i18n_chk_CancelIfLate();     // text of 'Cancel if late' checkbox
0038     static QString  i18n_chk_AutoCloseWin();     // text of 'Auto-close window after this time' checkbox
0039     static QString  i18n_chk_AutoCloseWinLC();   // text of 'Auto-close window after late-cancellation time' checkbox
0040 
0041 Q_SIGNALS:
0042     void            changed();          // emitted whenever any change occurs
0043 
0044 private Q_SLOTS:
0045     void            slotToggled(bool);
0046 
0047 private:
0048     QStackedWidget* mStack;             // contains mCheckboxFrame and mTimeSelectorFrame
0049     QFrame*         mCheckboxFrame;
0050     CheckBox*       mCheckbox;          // displayed when late cancellation is not selected
0051     QFrame*         mTimeSelectorFrame;
0052     TimeSelector*   mTimeSelector;      // displayed when late cancellation is selected
0053     CheckBox*       mAutoClose;
0054     QHBoxLayout*    mAutoCloseLayout;   // layout containing auto-close checkbox
0055     bool            mDateOnly {false};  // hours/minutes units not allowed
0056     bool            mReadOnly {false};  // widget is read-only
0057     bool            mAutoCloseShown {false};  // auto-close checkbox is visible
0058 };
0059 
0060 // vim: et sw=4: