Use qtpaths directly
[kdepim.git] / kalarm / editdlg_p.h
blobca77c2debe479426efbb3c1383086eebb9071903
1 /*
2 * editdlg_p.h - private classes for editdlg.cpp
3 * Program: kalarm
4 * Copyright © 2003-2005,2007-2009 by David Jarvie <djarvie@kde.org>
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.
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.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef EDITDLG_P_H
22 #define EDITDLG_P_H
24 #include <ktextedit.h>
25 #include <QFrame>
26 class QDragEnterEvent;
27 class QShowEvent;
28 class CheckBox;
29 class LineEdit;
32 class PageFrame : public QFrame
34 Q_OBJECT
35 public:
36 explicit PageFrame(QWidget* parent = nullptr) : QFrame(parent) { }
38 protected:
39 void showEvent(QShowEvent*) override { emit shown(); }
41 Q_SIGNALS:
42 void shown();
45 class TextEdit : public KTextEdit
47 Q_OBJECT
48 public:
49 explicit TextEdit(QWidget* parent);
50 QSize sizeHint() const override { return minimumSizeHint(); }
51 QSize minimumSizeHint() const override { return minimumSize(); }
53 protected:
54 void dragEnterEvent(QDragEnterEvent*) override;
57 class CommandEdit : public QWidget
59 Q_OBJECT
60 public:
61 explicit CommandEdit(QWidget* parent);
62 bool isScript() const;
63 void setScript(bool);
64 QString text() const;
65 QString text(EditAlarmDlg*, bool showErrorMessage) const;
66 void setText(const AlarmText&);
67 void setReadOnly(bool);
68 QSize minimumSizeHint() const override;
69 QSize sizeHint() const override { return minimumSizeHint(); }
71 Q_SIGNALS:
72 void scriptToggled(bool);
73 void changed(); // emitted when any changes occur
75 private Q_SLOTS:
76 void slotCmdScriptToggled(bool);
78 private:
79 CheckBox* mTypeScript; // entering a script
80 LineEdit* mCommandEdit; // command line edit box
81 TextEdit* mScriptEdit; // script edit box
84 #endif // EDITDLG_P_H
86 // vim: et sw=4: