KIO
kurlcombobox.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2, as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 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
KDE 4.6 API Reference