/usr/include/kicondialog.h is in kdelibs5-dev 4:4.8.5-0ubuntu0.6.
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 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | /* vi: ts=8 sts=4 sw=4
*
* This file is part of the KDE project, module kfile.
* Copyright (C) 2000 Geert Jansen <jansen@kde.org>
* (C) 2000 Kurt Granroth <granroth@kde.org>
* (C) 1997 Christoph Neerfeld <chris@kde.org>
* (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
*
* This is free software; it comes under the GNU Library General
* Public License, version 2. See the file "COPYING.LIB" for the
* exact licensing terms.
*/
#ifndef KICONDIALOG_H
#define KICONDIALOG_H
#include <kio/kio_export.h>
#include <QtCore/QStringList>
#include <QtGui/QPushButton>
#include <kdialog.h>
#include <klistwidget.h>
class KIconLoader;
/**
* Icon canvas for KIconDialog.
*/
class KIO_EXPORT KIconCanvas: public KListWidget
{
Q_OBJECT
public:
/**
* Creates a new icon canvas.
*
* @param parent The parent widget.
*/
explicit KIconCanvas(QWidget *parent=0L);
/**
* Destroys the icon canvas.
*/
~KIconCanvas();
/**
* Load icons into the canvas.
*/
void loadFiles(const QStringList& files);
/**
* Returns the current icon.
*/
QString getCurrent() const;
public Q_SLOTS:
/**
* Call this slot to stop the loading of the icons.
*/
void stopLoading();
Q_SIGNALS:
/**
* Emitted when the current icon has changed.
*/
void nameChanged(const QString&);
/**
* This signal is emitted when the loading of the icons
* has started.
*
* @param count The number of icons to be loaded.
*/
void startLoading(int count);
/**
* This signal is emitted whenever an icon has been loaded.
*
* @param number The number of the currently loaded item.
*/
void progress(int number);
/**
* This signal is emitted when the loading of the icons
* has been finished.
*/
void finished();
private:
class KIconCanvasPrivate;
KIconCanvasPrivate* const d;
Q_DISABLE_COPY(KIconCanvas)
Q_PRIVATE_SLOT(d, void _k_slotLoadFiles())
Q_PRIVATE_SLOT(d, void _k_slotCurrentChanged(QListWidgetItem *item))
};
/**
* Dialog for interactive selection of icons. Use the function
* getIcon() let the user select an icon.
*
* @short An icon selection dialog.
*/
class KIO_EXPORT KIconDialog: public KDialog
{
Q_OBJECT
public:
/**
* Constructs an icon selection dialog using the global iconloader.
*
* @param parent The parent widget.
*/
explicit KIconDialog(QWidget *parent=0L);
/**
* Constructs an icon selection dialog using a specific iconloader.
*
* @param loader The icon loader to use.
* @param parent The parent widget.
*/
explicit KIconDialog(KIconLoader *loader, QWidget *parent=0);
/**
* Destructs the dialog.
*/
~KIconDialog();
/**
* Sets a strict icon size policy for allowed icons. When true,
* only icons of the specified group's size in getIcon() are shown.
* When false, icons not available at the desired group's size will
* also be selectable.
*/
void setStrictIconSize(bool b);
/**
* Returns true if a strict icon size policy is set.
*/
bool strictIconSize() const;
/**
* sets a custom icon directory
*/
void setCustomLocation( const QString& location );
/**
* Sets the size of the icons to be shown / selected.
* @see KIconLoader::StdSizes
* @see iconSize
*/
void setIconSize(int size);
/**
* Returns the iconsize set via setIconSize() or 0, if the default
* iconsize will be used.
*/
int iconSize() const;
/**
* Allows you to set the same parameters as in the class method
* getIcon(), as well as two additional parameters to lock
* the choice between system and user dirs and to lock the custom user
* dir itself.
*/
void setup( KIconLoader::Group group,
KIconLoader::Context context = KIconLoader::Application,
bool strictIconSize = false, int iconSize = 0,
bool user = false, bool lockUser = false,
bool lockCustomDir = false );
/**
* exec()utes this modal dialog and returns the name of the selected icon,
* or QString() if the dialog was aborted.
* @returns the name of the icon, suitable for loading with KIconLoader.
* @see getIcon
*/
QString openDialog();
/**
* show()es this dialog and emits a newIcon(const QString&) signal when
* successful. QString() will be emitted if the dialog was aborted.
*/
void showDialog();
/**
* Pops up the dialog an lets the user select an icon.
*
* @param group The icon group this icon is intended for. Providing the
* group shows the icons in the dialog with the same appearance as when
* used outside the dialog.
* @param context The initial icon context. Initially, the icons having
* this context are shown in the dialog. The user can change this.
* @param strictIconSize When true, only icons of the specified group's size
* are shown, otherwise icon not available in the desired group's size
* will also be selectable.
* @param iconSize the size of the icons -- the default of the icongroup
* if set to 0
* @param user Begin with the "user icons" instead of "system icons".
* @param parent The parent widget of the dialog.
* @param caption The caption to use for the dialog.
* @return The name of the icon, suitable for loading with KIconLoader.
*/
static QString getIcon(KIconLoader::Group group=KIconLoader::Desktop,
KIconLoader::Context context=KIconLoader::Application,
bool strictIconSize=false, int iconSize = 0,
bool user=false, QWidget *parent=0,
const QString &caption=QString());
Q_SIGNALS:
void newIconName(const QString&);
protected Q_SLOTS:
void slotOk();
private:
class KIconDialogPrivate;
KIconDialogPrivate* const d;
Q_DISABLE_COPY(KIconDialog)
Q_PRIVATE_SLOT(d, void _k_slotContext(int))
Q_PRIVATE_SLOT(d, void _k_slotStartLoading(int))
Q_PRIVATE_SLOT(d, void _k_slotProgress(int))
Q_PRIVATE_SLOT(d, void _k_slotFinished())
Q_PRIVATE_SLOT(d, void _k_slotAcceptIcons())
Q_PRIVATE_SLOT(d, void _k_slotBrowse())
Q_PRIVATE_SLOT(d, void _k_slotOtherIconClicked())
Q_PRIVATE_SLOT(d, void _k_slotSystemIconClicked())
};
/**
* A pushbutton for choosing an icon. Pressing on the button will open a
* KIconDialog for the user to select an icon. The current icon will be
* displayed on the button.
*
* @see KIconDialog
* @short A push button that allows selection of an icon.
*/
class KIO_EXPORT KIconButton: public QPushButton
{
Q_OBJECT
Q_PROPERTY( QString icon READ icon WRITE setIcon RESET resetIcon )
Q_PROPERTY( int iconSize READ iconSize WRITE setIconSize)
Q_PROPERTY( bool strictIconSize READ strictIconSize WRITE setStrictIconSize )
public:
/**
* Constructs a KIconButton using the global iconloader.
*
* @param parent The parent widget.
*/
explicit KIconButton(QWidget *parent=0L);
/**
* Constructs a KIconButton using a specific KIconLoader.
*
* @param loader The icon loader to use.
* @param parent The parent widget.
*/
KIconButton(KIconLoader *loader, QWidget *parent);
/**
* Destructs the button.
*/
~KIconButton();
/**
* Sets a strict icon size policy for allowed icons. When true,
* only icons of the specified group's size in setIconType are allowed,
* and only icons of that size will be shown in the icon dialog.
*/
void setStrictIconSize(bool b);
/**
* Returns true if a strict icon size policy is set.
*/
bool strictIconSize() const;
/**
* Sets the icon group and context. Use KIconLoader::NoGroup if you want to
* allow icons for any group in the given context.
*/
void setIconType(KIconLoader::Group group, KIconLoader::Context context, bool user=false);
/**
* Sets the button's initial icon.
*/
void setIcon(const QString& icon);
void setIcon(const QIcon& icon);
/**
* Resets the icon (reverts to an empty button).
*/
void resetIcon();
/**
* Returns the name of the selected icon.
*/
const QString &icon() const;
/**
* Sets the size of the icon to be shown / selected.
* @see KIconLoader::StdSizes
* @see iconSize
*/
void setIconSize( int size );
/**
* Returns the iconsize set via setIconSize() or 0, if the default
* iconsize will be used.
*/
int iconSize() const;
/**
* Sets the size of the icon to be shown on the button
* @see KIconLoader::StdSizes
* @see buttonIconSize
* @since 4.1
*/
void setButtonIconSize( int size );
/**
* Returns the Button's Icon-Size
* @since 4.1
*/
int buttonIconSize() const;
Q_SIGNALS:
/**
* Emitted when the icon has changed.
*/
void iconChanged(const QString &icon);
private:
class KIconButtonPrivate;
KIconButtonPrivate* const d;
Q_DISABLE_COPY(KIconButton)
Q_PRIVATE_SLOT(d, void _k_slotChangeIcon())
Q_PRIVATE_SLOT(d, void _k_newIconName(const QString&))
};
#endif // KICONDIALOG_H
|