• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KIO

  • sources
  • kde-4.12
  • kdelibs
  • kio
  • kfile
kicondialog.h
Go to the documentation of this file.
1 /* vi: ts=8 sts=4 sw=4
2  *
3  * This file is part of the KDE project, module kfile.
4  * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
5  * (C) 2000 Kurt Granroth <granroth@kde.org>
6  * (C) 1997 Christoph Neerfeld <chris@kde.org>
7  * (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
8  *
9  * This is free software; it comes under the GNU Library General
10  * Public License, version 2. See the file "COPYING.LIB" for the
11  * exact licensing terms.
12  */
13 
14 #ifndef KICONDIALOG_H
15 #define KICONDIALOG_H
16 
17 #include <kio/kio_export.h>
18 
19 #include <QtCore/QStringList>
20 #include <QtGui/QPushButton>
21 
22 #include <kdialog.h>
23 #include <klistwidget.h>
24 
25 class KIconLoader;
26 
30 class KIO_EXPORT KIconCanvas: public KListWidget
31 {
32  Q_OBJECT
33 
34 public:
40  explicit KIconCanvas(QWidget *parent=0L);
41 
45  ~KIconCanvas();
46 
50  void loadFiles(const QStringList& files);
51 
55  QString getCurrent() const;
56 
57 public Q_SLOTS:
61  void stopLoading();
62 
63 Q_SIGNALS:
67  void nameChanged(const QString&);
68 
75  void startLoading(int count);
76 
82  void progress(int number);
83 
88  void finished();
89 
90 private:
91  class KIconCanvasPrivate;
92  KIconCanvasPrivate* const d;
93 
94  Q_DISABLE_COPY(KIconCanvas)
95 
96  Q_PRIVATE_SLOT(d, void _k_slotLoadFiles())
97  Q_PRIVATE_SLOT(d, void _k_slotCurrentChanged(QListWidgetItem *item))
98 };
99 
100 
107 class KIO_EXPORT KIconDialog: public KDialog
108 {
109  Q_OBJECT
110 
111 public:
117  explicit KIconDialog(QWidget *parent=0L);
118 
125  explicit KIconDialog(KIconLoader *loader, QWidget *parent=0);
126 
130  ~KIconDialog();
131 
138  void setStrictIconSize(bool b);
142  bool strictIconSize() const;
146  void setCustomLocation( const QString& location );
147 
153  void setIconSize(int size);
154 
159  int iconSize() const;
160 
168  void setup( KIconLoader::Group group,
169  KIconLoader::Context context = KIconLoader::Application,
170  bool strictIconSize = false, int iconSize = 0,
171  bool user = false, bool lockUser = false,
172  bool lockCustomDir = false );
173 
180  QString openDialog();
181 
186  void showDialog();
187 
206  static QString getIcon(KIconLoader::Group group=KIconLoader::Desktop,
207  KIconLoader::Context context=KIconLoader::Application,
208  bool strictIconSize=false, int iconSize = 0,
209  bool user=false, QWidget *parent=0,
210  const QString &caption=QString());
211 
212 Q_SIGNALS:
213  void newIconName(const QString&);
214 
215 protected Q_SLOTS:
216  void slotOk();
217 
218 private:
219  class KIconDialogPrivate;
220  KIconDialogPrivate* const d;
221 
222  Q_DISABLE_COPY(KIconDialog)
223 
224  Q_PRIVATE_SLOT(d, void _k_slotContext(int))
225  Q_PRIVATE_SLOT(d, void _k_slotStartLoading(int))
226  Q_PRIVATE_SLOT(d, void _k_slotProgress(int))
227  Q_PRIVATE_SLOT(d, void _k_slotFinished())
228  Q_PRIVATE_SLOT(d, void _k_slotAcceptIcons())
229  Q_PRIVATE_SLOT(d, void _k_slotBrowse())
230  Q_PRIVATE_SLOT(d, void _k_slotOtherIconClicked())
231  Q_PRIVATE_SLOT(d, void _k_slotSystemIconClicked())
232 };
233 
234 
243 class KIO_EXPORT KIconButton: public QPushButton
244 {
245  Q_OBJECT
246  Q_PROPERTY( QString icon READ icon WRITE setIcon RESET resetIcon )
247  Q_PROPERTY( int iconSize READ iconSize WRITE setIconSize)
248  Q_PROPERTY( bool strictIconSize READ strictIconSize WRITE setStrictIconSize )
249 
250 public:
256  explicit KIconButton(QWidget *parent=0L);
257 
264  KIconButton(KIconLoader *loader, QWidget *parent);
268  ~KIconButton();
269 
275  void setStrictIconSize(bool b);
279  bool strictIconSize() const;
280 
285  void setIconType(KIconLoader::Group group, KIconLoader::Context context, bool user=false);
286 
290  void setIcon(const QString& icon);
291 
292  void setIcon(const QIcon& icon);
293 
297  void resetIcon();
298 
302  const QString &icon() const;
303 
309  void setIconSize( int size );
310 
315  int iconSize() const;
316 
323  void setButtonIconSize( int size );
324 
329  int buttonIconSize() const;
330 
331 
332 Q_SIGNALS:
336  void iconChanged(const QString &icon);
337 
338 private:
339  class KIconButtonPrivate;
340  KIconButtonPrivate* const d;
341 
342  Q_DISABLE_COPY(KIconButton)
343 
344  Q_PRIVATE_SLOT(d, void _k_slotChangeIcon())
345  Q_PRIVATE_SLOT(d, void _k_newIconName(const QString&))
346 };
347 
348 
349 #endif // KICONDIALOG_H
kio_export.h
kdialog.h
caption
QString caption()
group
QWidget
QPushButton
KDialog
KIconButton
A pushbutton for choosing an icon.
Definition: kicondialog.h:243
QString
KIconLoader::Desktop
KIconDialog
Dialog for interactive selection of icons.
Definition: kicondialog.h:107
KIconCanvas
Icon canvas for KIconDialog.
Definition: kicondialog.h:30
QStringList
KIconLoader::Application
KIconLoader::Context
Context
KIconLoader::Group
Group
KListWidget
klistwidget.h
KIconLoader
KIO::number
QString number(KIO::filesize_t size)
Converts a size to a string representation Not unlike QString::number(...)
Definition: global.cpp:63
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal