/usr/include/KF5/KWidgetsAddons/kpagedialog.h is in libkf5widgetsaddons-dev 5.44.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | /*
* This file is part of the KDE Libraries
* Copyright (C) 1999-2001 Mirko Boehm (mirko@kde.org) and
* Espen Sand (espen@kde.org)
* Holger Freyther <freyther@kde.org>
* 2005-2006 Olivier Goffart <ogoffart at kde.org>
* 2006 Tobias Koenig <tokoe@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef KPAGEDIALOG_H
#define KPAGEDIALOG_H
#include <QDialog>
#include <QDialogButtonBox>
#include <kpagewidget.h>
class KPageDialogPrivate;
/**
* @class KPageDialog kpagedialog.h KPageDialog
*
* @short A dialog base class which can handle multiple pages.
*
* This class provides a dialog base class which handles multiple
* pages and allows the user to switch between these pages in
* different ways.
*
* Currently, @p Auto, @p Plain, @p List, @p Tree and @p Tabbed face
* types are available (cmp. KPageView).
*
* <b>Example:</b>\n
*
* \code
* UrlDialog::UrlDialog( QWidget *parent )
* : KPageDialog( parent )
* {
* setFaceType( List );
*
* QLabel *label = new QLabel( "Test Page" );
* addPage( label, i18n( "My Test Page" ) );
*
* label = new QLabel( "Second Test Page" );
* KPageWidgetItem *page = new KPageWidgetItem( label, i18n( "My Second Test Page" ) );
* page->setHeader( i18n( "My header string" ) );
* page->setIcon( QIcon::fromTheme( "file" ) );
*
* addPage( page );
* }
* \endcode
*
* @author Tobias Koenig (tokoe@kde.org)
*/
class KWIDGETSADDONS_EXPORT KPageDialog : public QDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(KPageDialog)
public:
/**
* The face types supported.
*/
enum FaceType {
/**
* A dialog with a face based on the structure of the available pages.
* If only a single page is added, the dialog behaves like
* in @c Plain mode, with multiple pages without sub pages
* it behaves like in @c List mode and like in @c Tree mode otherwise.
*/
Auto = KPageView::Auto,
/**
* A normal dialog
*/
Plain = KPageView::Plain,
/**
* A dialog with an icon list on the left side and a
* representation of the contents on the right side
*/
List = KPageView::List,
/**
* A dialog with a tree on the left side and a
* representation of the contents on the right side
*/
Tree = KPageView::Tree,
/**
* A dialog with a tab bar above the representation
* of the contents
*/
Tabbed = KPageView::Tabbed
};
public:
/**
* Creates a new page dialog.
*/
explicit KPageDialog(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
/**
* Destroys the page dialog.
*/
~KPageDialog();
/**
* Sets the face type of the dialog.
*/
void setFaceType(FaceType faceType);
/**
* Adds a new top level page to the dialog.
*
* @param widget The widget of the page.
* @param name The name which is displayed in the navigation view.
*
* @returns The associated KPageWidgetItem.
*/
KPageWidgetItem *addPage(QWidget *widget, const QString &name);
/**
* Adds a new top level page to the dialog.
*
* @param item The KPageWidgetItem which describes the page.
*/
void addPage(KPageWidgetItem *item);
/**
* Inserts a new page in the dialog.
*
* @param before The new page will be insert before this KPageWidgetItem
* on the same level in hierarchy.
* @param widget The widget of the page.
* @param name The name which is displayed in the navigation view.
*
* @returns The associated KPageWidgetItem.
*/
KPageWidgetItem *insertPage(KPageWidgetItem *before, QWidget *widget, const QString &name);
/**
* Inserts a new page in the dialog.
*
* @param before The new page will be insert before this KPageWidgetItem
* on the same level in hierarchy.
*
* @param item The KPageWidgetItem which describes the page.
*/
void insertPage(KPageWidgetItem *before, KPageWidgetItem *item);
/**
* Inserts a new sub page in the dialog.
*
* @param parent The new page will be insert as child of this KPageWidgetItem.
* @param widget The widget of the page.
* @param name The name which is displayed in the navigation view.
*
* @returns The associated KPageWidgetItem.
*/
KPageWidgetItem *addSubPage(KPageWidgetItem *parent, QWidget *widget, const QString &name);
/**
* Inserts a new sub page in the dialog.
*
* @param parent The new page will be insert as child of this KPageWidgetItem.
*
* @param item The KPageWidgetItem which describes the page.
*/
void addSubPage(KPageWidgetItem *parent, KPageWidgetItem *item);
/**
* Removes the page associated with the given KPageWidgetItem.
*/
void removePage(KPageWidgetItem *item);
/**
* Sets the page which is associated with the given KPageWidgetItem to
* be the current page and emits the currentPageChanged() signal.
*/
void setCurrentPage(KPageWidgetItem *item);
/**
* Returns the KPageWidgetItem for the current page or a null pointer if there is no
* current page.
*/
KPageWidgetItem *currentPage() const;
/**
* Sets the collection of standard buttons displayed by this dialog.
*/
void setStandardButtons(QDialogButtonBox::StandardButtons buttons);
/**
* Returns the QPushButton corresponding to the standard button which, or a null pointer if the standard
* button doesn't exist in this dialog.
*/
QPushButton *button(QDialogButtonBox::StandardButton which) const;
/**
* Set an action button.
*/
void addActionButton(QAbstractButton *button);
Q_SIGNALS:
/**
* This signal is emitted whenever the current page has changed.
*
* @param current The new current page or a null pointer if no current page is available.
* @param before The page that was current before the new current page has changed.
*/
void currentPageChanged(KPageWidgetItem *current, KPageWidgetItem *before);
/**
* This signal is emitted whenever a page has been removed.
*
* @param page The page which has been removed
**/
void pageRemoved(KPageWidgetItem *page);
protected:
/**
* This constructor can be used by subclasses to provide a custom page widget.
*
* \param widget The KPageWidget object will be reparented to this object, so you can create
* it without parent and you are not allowed to delete it.
*/
KPageDialog(KPageWidget *widget, QWidget *parent, Qt::WindowFlags flags = Qt::WindowFlags());
KPageDialog(KPageDialogPrivate &dd, KPageWidget *widget, QWidget *parent, Qt::WindowFlags flags = Qt::WindowFlags());
/**
* Returns the page widget of the dialog or a null pointer if no page widget is set.
*/
KPageWidget *pageWidget();
/**
* Returns the page widget of the dialog or a null pointer if no page widget is set.
*/
const KPageWidget *pageWidget() const;
/**
* Set the page widget of the dialog.
*
* @note the previous pageWidget will be deleted.
*
* @param widget The KPageWidget object will be reparented to this object, so you can create
* it without parent and you are not allowed to delete it.
*/
void setPageWidget(KPageWidget *widget);
/**
* Returns the button box of the dialog or a null pointer if no button box is set.
*/
QDialogButtonBox *buttonBox();
/**
* Returns the button box of the dialog or a null pointer if no button box is set.
*/
const QDialogButtonBox *buttonBox() const;
/**
* Set the button box of the dialog
*
* @note the previous buttonBox will be deleted.
*
* @param box The QDialogButtonBox object will be reparented to this object, so you can create
* it without parent and you are not allowed to delete it.
*/
void setButtonBox(QDialogButtonBox *box);
protected:
KPageDialogPrivate *const d_ptr;
};
#endif
|