kio Library API Documentation

kurlrequester.h

00001 /* This file is part of the KDE libraries
00002     Copyright (C) 1999,2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
00003 
00004     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., 59 Temple Place - Suite 330,
00016     Boston, MA 02111-1307, USA.
00017 */
00018 
00019 
00020 #ifndef KURLREQUESTER_H
00021 #define KURLREQUESTER_H
00022 
00023 #include <qhbox.h>
00024 
00025 #include <keditlistbox.h>
00026 #include <kfile.h>
00027 #include <kpushbutton.h>
00028 #include <kurl.h>
00029 
00030 class KComboBox;
00031 class KFileDialog;
00032 class KLineEdit;
00033 class KURLCompletion;
00034 class KURLDragPushButton;
00035 
00036 class QString;
00037 class QTimer;
00038 
00056 class KURLRequester : public QHBox
00057 {
00058     Q_OBJECT
00059     Q_PROPERTY( QString url READ url WRITE setURL )
00060     Q_PROPERTY( bool showLocalProtocol READ showLocalProtocol WRITE setShowLocalProtocol )
00061     Q_PROPERTY( QString filter READ filter WRITE setFilter )
00062     Q_PROPERTY( uint mode READ mode WRITE setMode )
00063 
00064 public:
00068     KURLRequester( QWidget *parent=0, const char *name=0 );
00069 
00073     KURLRequester( const QString& url, QWidget *parent=0, const char *name=0 );
00074 
00083     KURLRequester( QWidget *editWidget, QWidget *parent, const char *name=0 );
00087     ~KURLRequester();
00088 
00094     QString url() const;
00095 
00102     void setShowLocalProtocol( bool b );
00103 
00110     void setMode( uint m );
00111 
00117     uint mode() const;
00118 
00123     void setFilter( const QString& filter );
00124 
00130     QString filter() const;
00131 
00137     bool showLocalProtocol() const { return myShowLocalProt; }
00138 
00147     virtual KFileDialog * fileDialog() const;
00148 
00156     KLineEdit * lineEdit() const;
00157 
00162     KComboBox * comboBox() const;
00163 
00168     KPushButton * button() const;
00169 
00173     KURLCompletion *completionObject() const { return myCompletion; }
00174 
00186     KEditListBox::CustomEditor customEditor();
00187 
00188 public slots:
00194     void setURL( const QString& url );
00195 
00200     virtual void setCaption( const QString& caption );
00201 
00205     void clear();
00206 
00207 signals:
00208     // forwards from LineEdit
00214     void textChanged( const QString& );
00215 
00219     void returnPressed();
00220 
00225     void returnPressed( const QString& );
00226 
00238     void openFileDialog( KURLRequester * );
00239 
00244     void urlSelected( const QString& );
00245 
00246 protected:
00247     void        init();
00248 
00249     KURLCompletion *    myCompletion;
00250 
00251 
00252 private:
00253     KURLDragPushButton * myButton;
00254     bool        myShowLocalProt;
00255     mutable KFileDialog * myFileDialog;
00256 
00257 
00258 protected slots:
00263     void slotOpenDialog();
00264 
00265 private slots:
00266     void slotUpdateURL();
00267 
00268 protected:
00269     virtual void virtual_hook( int id, void* data );
00270 private:
00271     class KURLRequesterPrivate;
00272     KURLRequesterPrivate *d;
00273 };
00274 
00275 class KURLComboRequester : public KURLRequester // For use in Qt Designer
00276 {
00277     Q_OBJECT
00278 public:
00282     KURLComboRequester( QWidget *parent=0, const char *name=0 );
00283 };
00284 
00285 
00286 #endif // KURLREQUESTER_H
KDE Logo
This file is part of the documentation for kio Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Nov 27 13:45:41 2004 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003