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
00047 class KIO_EXPORT KUrlComboBox : public KComboBox
00048 {
00049 Q_OBJECT
00050 Q_PROPERTY(QStringList urls READ urls WRITE setUrls DESIGNABLE true)
00051 Q_PROPERTY(int maxItems READ maxItems WRITE setMaxItems DESIGNABLE true)
00052
00053 public:
00057 enum Mode { Files = -1, Directories = 1, Both = 0 };
00065 enum OverLoadResolving { RemoveTop, RemoveBottom };
00066
00081 explicit KUrlComboBox(Mode mode, QWidget *parent = 0);
00082 KUrlComboBox( Mode mode, bool rw, QWidget *parent=0);
00086 ~KUrlComboBox();
00087
00100 void setUrl( const KUrl& url );
00101
00109 void setUrls( const QStringList &urls );
00110
00118 void setUrls( const QStringList &urls, OverLoadResolving remove );
00119
00130 QStringList urls() const;
00131
00136 void setMaxItems( int );
00137
00142 int maxItems() const;
00143
00152 void addDefaultUrl( const KUrl& url, const QString& text = QString() );
00153
00162 void addDefaultUrl( const KUrl& url, const QIcon& icon,
00163 const QString& text = QString() );
00164
00170 void setDefaults();
00171
00176 void removeUrl( const KUrl& url, bool checkDefaultURLs = true );
00177
00182 virtual void setCompletionObject(KCompletion* compObj, bool hsig = true);
00183
00184 Q_SIGNALS:
00190 void urlActivated( const KUrl& url );
00191
00192 protected:
00193 virtual void mousePressEvent(QMouseEvent *event);
00194 virtual void mouseMoveEvent(QMouseEvent *event);
00195
00196 private:
00197 class KUrlComboBoxPrivate;
00198 KUrlComboBoxPrivate* const d;
00199
00200 Q_DISABLE_COPY(KUrlComboBox)
00201
00202 Q_PRIVATE_SLOT( d, void _k_slotActivated( int ) )
00203 };
00204
00205
00206 #endif // KURLCOMBOBOX_H