kicondialog.h
/* 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 <qstring.h>
#include <qstringlist.h>
#include <qpushbutton.h>
#include <kicontheme.h>
#include <kdialogbase.h>
#include <kiconview.h>
class QComboBox;
class QTimer;
class QKeyEvent;
class QRadioButton;
class KProgress;
class KIconLoader;
class KIO_EXPORT KIconCanvas: public KIconView
{
Q_OBJECT
public:
KIconCanvas(QWidget *parent=0L, const char *name=0L);
~KIconCanvas();
void loadFiles(const QStringList& files);
QString getCurrent() const;
public slots:
void stopLoading();
signals:
void nameChanged(QString);
/* KDE 4: Make it const QString & */
void startLoading(int);
void progress(int);
void finished();
private slots:
void slotLoadFiles();
void slotCurrentChanged(QIconViewItem *item);
private:
QStringList mFiles;
QTimer *mpTimer;
KIconLoader *mpLoader; // unused
protected:
virtual void virtual_hook( int id, void* data );
private:
class KIconCanvasPrivate;
KIconCanvasPrivate *d;
};
class KIO_EXPORT KIconDialog: public KDialogBase
{
Q_OBJECT
public:
KIconDialog(QWidget *parent=0L, const char *name=0L);
KIconDialog(KIconLoader *loader, QWidget *parent=0,
const char *name=0);
~KIconDialog();
void setStrictIconSize(bool b);
bool strictIconSize() const;
void setCustomLocation( const QString& location );
void setIconSize(int size);
int iconSize() const;
#ifndef KDE_NO_COMPAT
QString selectIcon(KIcon::Group group=KIcon::Desktop, KIcon::Context
context=KIcon::Application, bool user=false);
#endif
void setup( KIcon::Group group,
KIcon::Context context = KIcon::Application,
bool strictIconSize = false, int iconSize = 0,
bool user = false );
void setup( KIcon::Group group, KIcon::Context context,
bool strictIconSize, int iconSize, bool user, bool lockUser,
bool lockCustomDir );
QString openDialog();
void showDialog();
static QString getIcon(KIcon::Group group=KIcon::Desktop,
KIcon::Context context=KIcon::Application,
bool strictIconSize=false, int iconSize = 0,
bool user=false, QWidget *parent=0,
const QString &caption=QString::null);
signals:
void newIconName(const QString&);
protected slots:
void slotOk();
private slots:
void slotButtonClicked(int);
void slotContext(int);
void slotStartLoading(int);
void slotProgress(int);
void slotFinished();
void slotAcceptIcons();
private:
void init();
void showIcons();
void setContext( KIcon::Context context );
int mGroupOrSize;
KIcon::Context mContext;
int mType;
QStringList mFileList;
QComboBox *mpCombo;
QPushButton *mpBrowseBut;
QRadioButton *mpRb1, *mpRb2;
KProgress *mpProgress;
KIconLoader *mpLoader;
KIconCanvas *mpCanvas;
int mNumContext;
KIcon::Context mContextMap[ 12 ]; // must match KIcon::Context size, code has assert
protected:
virtual void virtual_hook( int id, void* data );
private:
class KIconDialogPrivate;
KIconDialogPrivate *d;
};
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:
KIconButton(QWidget *parent=0L, const char *name=0L);
KIconButton(KIconLoader *loader, QWidget *parent, const char *name=0L);
~KIconButton();
void setStrictIconSize(bool b);
bool strictIconSize() const;
void setIconType(KIcon::Group group, KIcon::Context context, bool user=false);
void setIcon(const QString& icon);
void resetIcon();
QString icon() const { return mIcon; }
void setIconSize( int size );
int iconSize() const;
signals:
void iconChanged(QString icon);
/* KDE 4: Make it const QString & */
private slots:
void slotChangeIcon();
void newIconName(const QString& name);
private:
void init( KIconLoader *loader );
bool mbUser;
KIcon::Group mGroup;
KIcon::Context mContext;
QString mIcon;
KIconDialog *mpDialog;
KIconLoader *mpLoader;
class KIconButtonPrivate;
KIconButtonPrivate *d;
};
#endif // __KIconDialog_h__
KIconButton
A pushbutton for choosing an icon.
Definition: kicondialog.h:257
KIconDialog
Dialog for interactive selection of icons.
Definition: kicondialog.h:91
KIconCanvas
Icon canvas for KIconDialog.
Definition: kicondialog.h:35
KIconButton::icon
QString icon() const
Returns the name of the selected icon.
Definition: kicondialog.h:309

KDE Home | KDE Accessibility Home | Description of Access Keys