birthdaydlg.h 2.94 KB
Newer Older
1 2 3
/*
 *  birthdaydlg.h  -  dialog to pick birthdays from address book
 *  Program:  kalarm
4
 *  Copyright © 2002-2005,2007-2011 by David Jarvie <djarvie@kde.org>
5 6 7 8 9 10 11 12 13 14 15
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
David Jarvie's avatar
David Jarvie committed
16 17 18
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 20 21 22
 */
#ifndef BIRTHDAYDLG_H
#define BIRTHDAYDLG_H

Laurent Montel's avatar
Laurent Montel committed
23
#include <kalarmcal/kaevent.h>
24

25
#include <QDialog>
26
#include <QVector>
27
#include <QLineEdit>
28

David Jarvie's avatar
David Jarvie committed
29
class QFocusEvent;
30
class QTreeView;
31
class CheckBox;
32
class FontColourButton;
33
class SoundPicker;
34
class SpecialActionsButton;
35 36
class RepetitionButton;
class LateCancelSelector;
37
class Reminder;
38
class BLineEdit;
39
class BirthdaySortModel;
40
class QDialogButtonBox;
41

42
using namespace KAlarmCal;
43

44
class BirthdayDlg : public QDialog
45
{
46 47
        Q_OBJECT
    public:
Laurent Montel's avatar
Laurent Montel committed
48
        explicit BirthdayDlg(QWidget* parent = nullptr);
49
        QVector<KAEvent> events() const;
50

Laurent Montel's avatar
Laurent Montel committed
51
    protected Q_SLOTS:
52
        virtual void   slotOk();
53

Laurent Montel's avatar
Laurent Montel committed
54
    private Q_SLOTS:
55 56 57 58
        void           slotSelectionChanged();
        void           slotTextLostFocus();
        void           resizeViewColumns();
        void           setColours(const QColor& fg, const QColor& bg);
59

60 61 62 63 64 65 66 67 68 69 70 71
    private:
        BirthdaySortModel*    mBirthdaySortModel;
        QTreeView*            mListView;
        BLineEdit*            mPrefix;
        BLineEdit*            mSuffix;
        Reminder*             mReminder;
        SoundPicker*          mSoundPicker;
        FontColourButton*     mFontColourButton;
        CheckBox*             mConfirmAck;
        LateCancelSelector*   mLateCancel;
        SpecialActionsButton* mSpecialActionsButton;
        RepetitionButton*     mSubRepetition;
72
        QDialogButtonBox *    mButtonBox;
73 74
        QString               mPrefixText;   // last entered value of prefix text
        QString               mSuffixText;   // last entered value of suffix text
75
        KAEvent::Flags        mFlags;        // event flag bits
76 77
};

78

Laurent Montel's avatar
Laurent Montel committed
79
class BLineEdit : public QLineEdit
80
{
81 82
        Q_OBJECT
    public:
Laurent Montel's avatar
Laurent Montel committed
83 84
        explicit BLineEdit(QWidget* parent = nullptr)                       : QLineEdit(parent) {}
        explicit BLineEdit(const QString& text, QWidget* parent = nullptr)  : QLineEdit(text, parent) {}
85

Laurent Montel's avatar
Laurent Montel committed
86
    Q_SIGNALS:
87 88 89
        void         focusLost();

    protected:
90
        void         focusOutEvent(QFocusEvent*) override { Q_EMIT focusLost(); }
91
};
92

93
#endif // BIRTHDAYDLG_H
94 95

// vim: et sw=4: