kfilepreview.h
/* -*- c++ -*-
This file is part of the KDE libraries
Copyright (C) 1998 Stephan Kulow <coolo@kde.org>
1998 Daniel Grana <grana@ie.iwi.unibe.ch>
2000 Werner Trobin <wtrobin@carinthia.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KFILEPREVIEW_H
#define _KFILEPREVIEW_H
#include <qsplitter.h>
#include <qwidget.h>
#include <qstring.h>
#include <kurl.h>
#include <kfileitem.h>
#include <kfileiconview.h>
#include <kfiledetailview.h>
#include <kfile.h>
class KIO_EXPORT KFilePreview : public QSplitter, public KFileView
{
Q_OBJECT
public:
KFilePreview(QWidget *parent, const char *name);
KFilePreview(KFileView *view, QWidget *parent, const char *name);
virtual ~KFilePreview();
virtual QWidget *widget() { return this; }
virtual void clearView();
void setFileView(KFileView *view);
KFileView* fileView() const { return left; }
virtual void updateView( bool );
virtual void updateView(const KFileItem*);
virtual void removeItem(const KFileItem*);
virtual void listingCompleted();
virtual void setSelectionMode( KFile::SelectionMode sm );
virtual void setSelected(const KFileItem *, bool);
virtual bool isSelected( const KFileItem * ) const;
virtual void clearSelection();
virtual void selectAll();
virtual void invertSelection();
virtual void insertItem(KFileItem *);
virtual void clear();
virtual void setCurrentItem( const KFileItem * );
virtual KFileItem * currentFileItem() const;
virtual KFileItem * firstFileItem() const;
virtual KFileItem * nextItem( const KFileItem * ) const;
virtual KFileItem * prevItem( const KFileItem * ) const;
virtual void setSorting( QDir::SortSpec sort );
virtual void readConfig( KConfig *, const QString& group = QString::null );
virtual void writeConfig( KConfig *, const QString& group = QString::null);
virtual KActionCollection * actionCollection() const;
void ensureItemVisible(const KFileItem *);
void setPreviewWidget(const QWidget *w, const KURL &u);
protected slots:
virtual void slotHighlighted( const KFileItem * );
signals:
void showPreview(const KURL &);
void clearPreview();
private:
void init( KFileView *view );
KFileView *left;
QWidget *preview;
QString viewname;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KFilePreviewPrivate;
KFilePreviewPrivate *d;
};
#endif
KFileView::insertItem
virtual void insertItem(KFileItem *i)
The derived view must implement this function to add the file in the widget.
Definition: kfileview.cpp:147
KFileView::actionCollection
virtual KActionCollection * actionCollection() const
Definition: kfileview.cpp:365
KFilePreview
Definition: kfilepreview.h:39
KFileView
This class defines an interface to all file views.
Definition: kfileview.h:98
KFileView::clear
virtual void clear()
Clears the view and all item lists.
Definition: kfileview.cpp:156
KFileView::clearSelection
virtual void clearSelection()=0
Clears any selection, unhighlights everything.
KFileView::selectAll
virtual void selectAll()
Selects all items.
Definition: kfileview.cpp:312
KFileView::currentFileItem
virtual KFileItem * currentFileItem() const =0
KFilePreview::fileView
KFileView * fileView() const
Definition: kfilepreview.h:60
KFileView::setSelected
virtual void setSelected(const KFileItem *, bool enable)=0
Tells the view that it should highlight the item.
KFileView::setSorting
virtual void setSorting(QDir::SortSpec sort)
Sets the sorting order of the view.
Definition: kfileview.cpp:151
KFilePreview::widget
virtual QWidget * widget()
a pure virtual function to get a QWidget, that can be added to other widgets.
Definition: kfilepreview.h:48
KFileView::isSelected
virtual bool isSelected(const KFileItem *) const =0
KFileView::removeItem
virtual void removeItem(const KFileItem *item)
Removes an item from the list; has to be implemented by the view.
Definition: kfileview.cpp:346
KFileView::invertSelection
virtual void invertSelection()
Inverts the current selection, i.e.
Definition: kfileview.cpp:323
KFileView::updateView
virtual void updateView(bool f=true)
does a repaint of the view.
Definition: kfileview.cpp:259
KFileView::ensureItemVisible
virtual void ensureItemVisible(const KFileItem *i)=0
pure virtual function, that should be implemented to make item i visible, i.e.
KFileView::clearView
virtual void clearView()=0
pure virtual function, that should be implemented to clear the view.
KFileView::listingCompleted
virtual void listingCompleted()
This hook is called when all items of the currently listed directory are listed and inserted into the...
Definition: kfileview.cpp:360
KFileView::setCurrentItem
void setCurrentItem(const QString &filename)
Sets filename the current item in the view, if available.
Definition: kfileview.cpp:268

KDE Home | KDE Accessibility Home | Description of Access Keys