/usr/include/kinputdialog.h is in kdelibs5-dev 4:4.14.2-5+deb8u2.
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 | /*
Copyright (C) 2003 Nadeem Hasan <nhasan@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 KINPUTDIALOG_H
#define KINPUTDIALOG_H
#include <QtCore/QStringList>
#include <kdeui_export.h>
#include <limits.h>
#include <float.h>
class QValidator;
/**
* The KInputDialog namespace provides simple dialogs to get a single value
* from the user. The value can be a string, a number (either an integer or
* a float) or an item from a list.
*
* @author Nadeem Hasan <nhasan@kde.org>
*/
namespace KInputDialog
{
/**
* Static convenience function to get a string from the user.
*
* caption is the text that is displayed in the title bar. label is the
* text that appears as a label for the line edit. value is the initial
* value of the line edit. ok will be set to true if user pressed Ok
* and false if user pressed Cancel.
*
* If you provide a validator, the Ok button is disabled as long as
* the validator doesn't return Acceptable. If there is no validator,
* the Ok button is enabled whenever the line edit isn't empty. If you
* want to accept empty input, create a trivial QValidator that
* always returns acceptable, e.g. QRegExpValidator with a regexp
* of ".*".
*
* @param caption Caption of the dialog
* @param label Text of the label for the line edit
* @param value Initial value of the line edit
* @param ok This bool would be set to true if user pressed Ok
* @param parent Parent of the dialog widget
* @param validator A @ref QValidator to be associated with the line edit
* @param mask Mask associated with the line edit. See the
* documentation for @ref QLineEdit about masks
* @param whatsThis a QWhatsThis text for the input widget.
* @param completionList a list of items which should be used for input completion
* @return String user entered if Ok was pressed, else a null string
*/
KDEUI_EXPORT QString getText( const QString &caption, const QString &label,
const QString &value=QString(), bool *ok=0, QWidget *parent=0,
QValidator *validator=0,
const QString &mask=QString(),
const QString& whatsThis=QString(),
const QStringList &completionList=QStringList() );
/**
* Static convenience function to get a multiline string from the user.
*
* caption is the text that is displayed in the title bar. label is the
* text that appears as a label for the line edit. value is the initial
* value of the line edit. ok will be set to true if user pressed Ok
* and false if user pressed Cancel.
*
* @param caption Caption of the dialog
* @param label Text of the label for the line edit
* @param value Initial value of the line edit
* @param ok This bool would be set to true if user pressed Ok
* @param parent Parent of the dialog widget
*
* @return String user entered if Ok was pressed, else a null string
*/
KDEUI_EXPORT QString getMultiLineText( const QString &caption,
const QString &label, const QString &value=QString(),
bool *ok=0, QWidget *parent=0 );
/**
* Static convenience function to get an integer from the user.
*
* caption is the text that is displayed in the title bar. label is the
* text that appears as the label for the spin box. value is the initial
* value for the spin box. minValue and maxValue are the minimum and
* maximum allowable values the user may choose. step is the amount by
* which the value will change as the user presses the increment and
* decrement buttons of the spin box. Base is the base of the number.
*
* @param caption Caption of the dialog
* @param label Text of the label for the spin box
* @param value Initial value of the spin box
* @param minValue Minimum value user can input
* @param maxValue Maximum value user can input
* @param step Amount by which value is incremented or decremented
* @param base Base of the number
* @param ok This bool would be set to true if user pressed Ok
* @param parent Parent of the dialog widget
*
* @return Number user entered if Ok was pressed, else 0
*/
KDEUI_EXPORT int getInteger( const QString &caption, const QString &label,
int value=0, int minValue=INT_MIN, int maxValue=INT_MAX,
int step=1, int base=10, bool *ok=0, QWidget *parent=0 );
/**
* This is an overloaded convenience function. It behaves exactly same as
* above except it assumes base to be 10, i.e. accepts decimal numbers.
*/
KDEUI_EXPORT int getInteger( const QString &caption, const QString &label,
int value=0, int minValue=INT_MIN, int maxValue=INT_MAX,
int step=1, bool *ok=0, QWidget *parent=0 );
/**
* Static convenience function to get a floating point number from the user.
*
* caption is the text that is displayed in the title bar. label is the
* text that appears as the label for the spin box. value is the initial
* value for the spin box. minValue and maxValue are the minimum and
* maximum allowable values the user may choose. step is the amount by
* which the value will change as the user presses the increment and
* decrement buttons of the spin box.
*
* @param caption Caption of the dialog
* @param label Text of the label for the spin box
* @param value Initial value of the spin box
* @param minValue Minimum value user can input
* @param maxValue Maximum value user can input
* @param step Amount by which value is incremented or decremented
* @param decimals Number of digits after the decimal point
* @param ok This bool would be set to true if user pressed Ok
* @param parent Parent of the dialog widget
*
* @return Number user entered if Ok was pressed, else 0
*/
KDEUI_EXPORT double getDouble( const QString &caption, const QString &label,
double value=0, double minValue=-DBL_MAX,
double maxValue=DBL_MAX, double step=0.1, int decimals=1,
bool *ok=0, QWidget *parent=0 );
/**
* This is an overloaded convenience function. It behaves exctly like
* the above function.
*/
KDEUI_EXPORT double getDouble( const QString &caption, const QString &label,
double value=0, double minValue=-DBL_MAX,
double maxValue=DBL_MAX, int decimals=1, bool *ok=0,
QWidget *parent=0 );
/**
* Static convenience function to let the user select an item from a
* list. caption is the text that is displayed in the title bar.
* label is the text that appears as the label for the list. list
* is the string list which is inserted into the list, and current
* is the number of the item which should be the selected item. If
* editable is true, the user can enter his own text.
*
* @param caption Caption of the dialog
* @param label Text of the label for the list
* @param list List of item for user to choose from
* @param current Index of the selected item
* @param editable If true, user can enter own text
* @param ok This bool would be set to true if user pressed Ok
* @param parent Parent of the dialog widget
*
* @return Text of the selected item. If @p editable is true this can be
* a text entered by the user.
*/
KDEUI_EXPORT QString getItem( const QString &caption, const QString &label,
const QStringList &list, int current=0, bool editable=false,
bool *ok=0, QWidget *parent=0 );
/**
* Static convenience function to let the user select one or more
* items from a listbox. caption is the text that is displayed in the
* title bar. label is the text that appears as the label for the listbox.
* list is the string list which is inserted into the listbox, select
* is the list of item(s) that should be the selected. If multiple is
* true, the user can select multiple items.
*
* @param caption Caption of the dialog
* @param label Text of the label for the list
* @param list List of item for user to choose from
* @param select List of item(s) that should be selected
* @param multiple If true, user can select multiple items
* @param ok This bool would be set to true if user pressed Ok
* @param parent Parent of the dialog widget
*
* @return List of selected items if multiple is true, else currently
* selected item as a QStringList
*/
KDEUI_EXPORT QStringList getItemList( const QString &caption,
const QString &label, const QStringList &list=QStringList(),
const QStringList &select=QStringList(), bool multiple=false,
bool *ok=0, QWidget *parent=0 );
}
#endif // KINPUTDIALOG_H
/* vim: set ai et sw=2 ts=2
*/
|