# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# kurlbar.h

    00001 /* This file is part of the KDE libraries
    00002     Copyright (C) 2001,2002 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 as published by the Free Software Foundation, version 2.
    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 #ifndef KURLBAR_H
    00020 #define KURLBAR_H
    00021
    00022 #include <qevent.h>
    00023 #include <qframe.h>
    00024 #include <qtooltip.h>
    00025
    00026 #include <kdialogbase.h>
    00027 #include <kicontheme.h>
    00028 #include <klistbox.h>
    00029 #include <kurl.h>
    00030
    00031 class KConfig;
    00032 class KURLBar;
    00033
    00042 class KURLBarItem : public QListBoxPixmap
    00043 {
    00044 public:
    00055     KURLBarItem( KURLBar *parent, const KURL& url,
    00056                  const QString& description = QString::null,
    00057                  const QString& icon = QString::null,
    00058                  KIcon::Group group = KIcon::Panel );
    00062     ~KURLBarItem();
    00063
    00069     void setURL( const KURL& url );
    00075     void setIcon( const QString& icon, KIcon::Group group = KIcon::Panel );
    00080     void setDescription( const QString& desc );
    00085     void setToolTip( const QString& tip );
    00086
    00091     QSize sizeHint() const;
    00092
    00096     virtual int width( const QListBox * ) const;
    00100     virtual int height( const QListBox * ) const;
    00101
    00106     const KURL& url() const                     { return m_url; }
    00111     const QString& description() const          { return m_description; }
    00116     const QString& icon() const                 { return m_icon; }
    00121     QString toolTip() const;
    00126     KIcon::Group iconGroup() const              { return m_group; }
    00130     virtual const QPixmap * pixmap() const      { return &m_pixmap; }
    00131
    00136     void setApplicationLocal( bool local )      { m_appLocal = local; }
    00143     bool applicationLocal() const               { return m_appLocal; }
    00144
    00145
    00146 protected:
    00147     virtual void paint( QPainter *p );
    00148
    00149 private:
    00150     int iconSize() const;
    00151
    00152     KURL m_url;
    00153     QString m_description;
    00154     QString m_icon;
    00155     QString m_toolTip;
    00156     QPixmap m_pixmap;
    00157     KIcon::Group m_group;
    00158     KURLBar *m_parent;
    00159     bool m_appLocal :1;
    00160
    00161 protected:
    00162     virtual void virtual_hook( int id, void* data );
    00163 private:
    00164     class KURLBarItemPrivate;
    00165     KURLBarItemPrivate *d;
    00166 };
    00167
    00168
    00171
    00172
    00173 class KURLBarListBox;
    00174
    00198 class KURLBar : public QFrame
    00199 {
    00200     Q_OBJECT
    00201
    00202 public:
    00207     KURLBar( bool useGlobalItems,
    00208              QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
    00212     ~KURLBar();
    00213
    00224     virtual KURLBarItem * insertItem( const KURL& url,
    00225                                       const QString& description,
    00226                                       bool applicationLocal = true,
    00227                                       const QString& icon = QString::null,
    00228                                       KIcon::Group group = KIcon::Panel );
    00234     virtual void setOrientation( Qt::Orientation orient );
    00239     Orientation orientation() const;
    00240
    00247     virtual void setListBox( KURLBarListBox * );
    00252     KURLBarListBox *listBox() const { return m_listBox; }
    00253
    00259     virtual void setIconSize( int size );
    00265     int iconSize() const { return m_iconSize; }
    00266
    00270     virtual void clear();
    00271
    00276     virtual QSize sizeHint() const;
    00280     virtual QSize minimumSizeHint() const;
    00281
    00287     virtual void readConfig(  KConfig *config, const QString& itemGroup );
    00293     virtual void writeConfig( KConfig *config, const QString& itemGroup );
    00294
    00300     virtual void readItem( int i, KConfig *config, bool applicationLocal );
    00307     virtual void writeItem( KURLBarItem *item, int i, KConfig *, bool global );
    00308
    00314     KURLBarItem * currentItem() const;
    00321     KURL currentURL() const;
    00322
    00328     bool isModified() const             { return m_isModified; }
    00329
    00333     bool isImmutable() const             { return m_isImmutable; }
    00334
    00338     bool isVertical() const { return orientation() == Vertical; }
    00339
    00340 public slots:
    00347     virtual void setCurrentItem( const KURL& url );
    00348
    00349 signals:
    00354     void activated( const KURL& url );
    00355
    00356 protected:
    00362     virtual bool addNewItem();
    00370     virtual bool editItem( KURLBarItem *item );
    00374     virtual void resizeEvent( QResizeEvent * );
    00375
    00379     KURLBarItem * m_activeItem;
    00383     bool m_useGlobal  :1;
    00384
    00389     bool m_isModified :1;
    00390
    00395     bool m_isImmutable :1;
    00396
    00397 protected slots:
    00402     virtual void slotContextMenuRequested( QListBoxItem *, const QPoint& pos );
    00407     virtual void slotSelected( QListBoxItem * );
    00408
    00413     virtual void slotDropped( QDropEvent * );
    00414
    00415 private slots:
    00416     void slotSelected( int button, QListBoxItem * );
    00417
    00418 private:
    00419     KURLBarListBox *m_listBox;
    00420     int m_iconSize;
    00421
    00422
    00423 protected:
    00424     virtual void virtual_hook( int id, void* data );
    00425 private:
    00426     class KURLBarPrivate;
    00427     KURLBarPrivate *d;
    00428 };
    00429
    00430
    00433
    00434
    00435 class QDragObject;
    00436 class KURLBarToolTip;
    00437
    00446 class KURLBarListBox : public KListBox
    00447 {
    00448     Q_OBJECT
    00449
    00450 public:
    00454     KURLBarListBox( QWidget *parent = 0, const char *name = 0 );
    00458     ~KURLBarListBox();
    00459
    00466     virtual void setOrientation( Qt::Orientation orient );
    00471     Qt::Orientation orientation() const { return m_orientation; }
    00472
    00473     bool isVertical() const { return m_orientation == Qt::Vertical; }
    00474
    00475 signals:
    00479     void dropped( QDropEvent *e );
    00480
    00481 protected:
    00485     virtual QDragObject * dragObject();
    00489     virtual void contentsDragEnterEvent( QDragEnterEvent * );
    00493     virtual void contentsDropEvent( QDropEvent * );
    00494
    00495 private:
    00496     Qt::Orientation m_orientation;
    00497     KURLBarToolTip *m_toolTip;
    00498
    00499 protected:
    00500     virtual void virtual_hook( int id, void* data );
    00501 private:
    00502     class KURLBarListBoxPrivate;
    00503     KURLBarListBoxPrivate *d;
    00504 };
    00505
    00506
    00509
    00510
    00511 class QCheckBox;
    00512 class KIconButton;
    00513 class KLineEdit;
    00514 class KURLRequester;
    00515
    00523 class KURLBarItemDialog : public KDialogBase
    00524 {
    00525     Q_OBJECT
    00526
    00527 public:
    00535     static bool getInformation( bool allowGlobal, KURL& url,
    00536                                 QString& description, QString& icon,
    00537                                 bool& appLocal, int iconSize,
    00538                                 QWidget *parent = 0 );
    00539
    00557     KURLBarItemDialog( bool allowGlobal, const KURL& url,
    00558                        const QString& description, QString icon,
    00559                        bool appLocal = true,
    00560                        int iconSize = KIcon::SizeMedium,
    00561                        QWidget *parent = 0, const char *name = 0 );
    00565     ~KURLBarItemDialog();
    00566
    00570     KURL url() const;
    00571
    00575     QString description() const;
    00576
    00580     QString icon() const;
    00581
    00587     bool applicationLocal() const;
    00588
    00589 protected:
    00593     KURLRequester * m_urlEdit;
    00597     KLineEdit     * m_edit;
    00601     KIconButton   * m_iconButton;
    00605     QCheckBox     * m_appLocal;
    00606
    00607 public slots:
    00608     void urlChanged(const QString & );
    00609
    00610 private:
    00611     class KURLBarItemDialogPrivate;
    00612     KURLBarItemDialogPrivate *d;
    00613 };
    00614
    00615
    00616 #endif // KURLBAR_H

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:14:32 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001