1/* This file is part of the KDE project
2 Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17
18*/
19
20#ifndef KDEUI_KDIALOG_P_H
21#define KDEUI_KDIALOG_P_H
22
23#include "kdialog.h"
24#include <QtCore/QPointer>
25#include <QtCore/QSignalMapper>
26#include <QtCore/QSize>
27#include <QtCore/QHash>
28
29class QBoxLayout;
30class KPushButton;
31class KUrlLabel;
32class KSeparator;
33class QDialogButtonBox;
34
35class KDialogPrivate
36{
37 Q_DECLARE_PUBLIC(KDialog)
38 protected:
39 KDialogPrivate()
40 : mDetailsVisible(false), mSettingDetails(false), mDeferredDelete(false),
41 mDetailsWidget(0),
42 mTopLayout(0), mMainWidget(0), mUrlHelp(0), mActionSeparator(0),
43 mButtonOrientation(Qt::Horizontal),
44 mDefaultButton(KDialog::NoDefault),
45 mButtonBox(0)
46 {
47 }
48
49 virtual ~KDialogPrivate() {}
50
51 KDialog *q_ptr;
52
53 void setupLayout();
54 void appendButton( KDialog::ButtonCode code , const KGuiItem &item );
55 KPushButton *button( KDialog::ButtonCode code ) const;
56
57
58 bool mDetailsVisible;
59 bool mSettingDetails;
60 bool mDeferredDelete;
61 QWidget *mDetailsWidget;
62 QSize mIncSize;
63 QSize mMinSize;
64 QString mDetailsButtonText;
65
66 QBoxLayout *mTopLayout;
67 QPointer<QWidget> mMainWidget;
68 KUrlLabel *mUrlHelp;
69 KSeparator *mActionSeparator;
70
71 QString mAnchor;
72 QString mHelpApp;
73 QString mHelpLinkText;
74
75 Qt::Orientation mButtonOrientation;
76 KDialog::ButtonCode mDefaultButton;
77 KDialog::ButtonCode mEscapeButton;
78
79 QDialogButtonBox *mButtonBox;
80 QHash<int, KPushButton*> mButtonList;
81 QSignalMapper mButtonSignalMapper;
82
83 protected Q_SLOTS:
84 void queuedLayoutUpdate();
85 void helpLinkClicked();
86
87 private:
88 void init(KDialog *);
89 bool dirty: 1;
90};
91
92#endif // KDEUI_KDIALOG_P_H
93