KIO
kurlcombobox.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KURLCOMBOBOX_H
00020 #define KURLCOMBOBOX_H
00021
00022 #include <kio/kio_export.h>
00023
00024 #include <QtCore/QList>
00025 #include <QtCore/QMap>
00026 #include <QtCore/QStringList>
00027 #include <QtGui/QIcon>
00028
00029 #include <kcombobox.h>
00030 #include <kurl.h>
00031
00042 class KIO_EXPORT KUrlComboBox : public KComboBox
00043 {
00044 Q_OBJECT
00045 Q_PROPERTY(QStringList urls READ urls WRITE setUrls DESIGNABLE true)
00046 Q_PROPERTY(int maxItems READ maxItems WRITE setMaxItems DESIGNABLE true)
00047
00048 public:
00052 enum Mode { Files = -1, Directories = 1, Both = 0 };
00060 enum OverLoadResolving { RemoveTop, RemoveBottom };
00061
00076 explicit KUrlComboBox(Mode mode, QWidget *parent = 0);
00077 KUrlComboBox( Mode mode, bool rw, QWidget *parent=0);
00081 ~KUrlComboBox();
00082
00095 void setUrl( const KUrl& url );
00096
00104 void setUrls( const QStringList &urls );
00105
00113 void setUrls( const QStringList &urls, OverLoadResolving remove );
00114
00125 QStringList urls() const;
00126
00131 void setMaxItems( int );
00132
00137 int maxItems() const;
00138
00147 void addDefaultUrl( const KUrl& url, const QString& text = QString() );
00148
00157 void addDefaultUrl( const KUrl& url, const QIcon& icon,
00158 const QString& text = QString() );
00159
00165 void setDefaults();
00166
00171 void removeUrl( const KUrl& url, bool checkDefaultURLs = true );
00172
00173 Q_SIGNALS:
00179 void urlActivated( const KUrl& url );
00180
00181 protected:
00182 virtual void mousePressEvent(QMouseEvent *event);
00183 virtual void mouseMoveEvent(QMouseEvent *event);
00184
00185 private:
00186 class KUrlComboBoxPrivate;
00187 KUrlComboBoxPrivate* const d;
00188
00189 Q_DISABLE_COPY(KUrlComboBox)
00190
00191 Q_PRIVATE_SLOT( d, void _k_slotActivated( int ) )
00192 };
00193
00194
00195 #endif // KURLCOMBOBOX_H