kio Library API Documentation

kfilepreview.h

00001 /*  -*- c++ -*-
00002     This file is part of the KDE libraries
00003     Copyright (C) 1998 Stephan Kulow <coolo@kde.org>
00004                   1998 Daniel Grana <grana@ie.iwi.unibe.ch>
00005                   2000 Werner Trobin <wtrobin@carinthia.com>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020     Boston, MA 02111-1307, USA.
00021 */
00022 
00023 #ifndef _KFILEPREVIEW_H
00024 #define _KFILEPREVIEW_H
00025 
00026 #include <kfileitem.h>
00027 #include <kfilepreview.h>
00028 #include <kfileiconview.h>
00029 #include <kfiledetailview.h>
00030 #include <kfile.h>
00031 
00032 #include <qsplitter.h>
00033 #include <qwidget.h>
00034 
00035 #include <qstring.h>
00036 
00037 #include <kurl.h>
00038 
00042 class KFilePreview : public QSplitter, public KFileView
00043 {
00044     Q_OBJECT
00045 
00046 public:
00047     KFilePreview(QWidget *parent, const char *name);
00048     KFilePreview(KFileView *view, QWidget *parent, const char *name);
00049     virtual ~KFilePreview();
00050 
00051     virtual QWidget *widget() { return this; }
00052     virtual void clearView();
00053 
00058     void setFileView(KFileView *view);
00059 
00063     KFileView* fileView() const { return left; }
00064 
00065     virtual void updateView( bool );
00066     virtual void updateView(const KFileItem*);
00067     virtual void removeItem(const KFileItem*);
00068     virtual void listingCompleted();
00069 
00070     virtual void setSelectionMode( KFile::SelectionMode sm );
00071 
00072     virtual void setSelected(const KFileItem *, bool);
00073     virtual bool isSelected( const KFileItem * ) const;
00074     virtual void clearSelection();
00075     virtual void selectAll();
00076     virtual void invertSelection();
00077 
00078     virtual void insertItem(KFileItem *);
00079     virtual void clear();
00080 
00081     virtual void setCurrentItem( const KFileItem * );
00082     virtual KFileItem * currentFileItem() const;
00083     virtual KFileItem * firstFileItem() const;
00084     virtual KFileItem * nextItem( const KFileItem * ) const;
00085     virtual KFileItem * prevItem( const KFileItem * ) const;
00086 
00087     virtual void setSorting( QDir::SortSpec sort );
00088 
00089     virtual void readConfig( KConfig *, const QString& group = QString::null );
00090     virtual void writeConfig( KConfig *, const QString& group = QString::null);
00091 
00098     virtual KActionCollection * actionCollection() const;
00099 
00100     void ensureItemVisible(const KFileItem *);
00101 
00102     void setPreviewWidget(const QWidget *w, const KURL &u);
00103 
00104 protected slots:
00105     virtual void slotHighlighted( const KFileItem * );
00106 
00107 signals:
00108     void showPreview(const KURL &);
00109     void clearPreview();
00110 
00111 private:
00112     void init( KFileView *view );
00113 
00114     KFileView *left;
00115     QWidget *preview;
00116     QString viewname;
00117 
00118 protected:
00120     virtual void virtual_hook( int id, void* data );
00121 private:
00122     class KFilePreviewPrivate;
00123     KFilePreviewPrivate *d;
00124 };
00125 #endif
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:26 2004 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003