libkonq Library API Documentation

kfileivi.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1999, 2000, 2001, 2002 David Faure <faure@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 as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 // $Id: kfileivi.h,v 1.23 2000/06/29 19:45:34 faure Exp
00021 
00022 #ifndef __kfileivi_h__
00023 #define __kfileivi_h__
00024 
00025 #include <kiconview.h>
00026 #include <kiconloader.h>
00027 
00028 class KFileItem;
00029 class KonqIconViewWidget;
00030 class KIVDirectoryOverlay;
00031 
00039 class KFileIVI : public KIconViewItem
00040 {
00041 public:
00048     KFileIVI( KonqIconViewWidget *iconview, KFileItem* fileitem, int size );
00049     virtual ~KFileIVI();
00050 
00055     virtual void returnPressed();
00056 
00060     KFileItem * item() const { return m_fileitem; }
00061 
00066     virtual bool acceptDrop( const QMimeSource *mime ) const;
00067 
00075     virtual void setIcon( int size,
00076                           int state=KIcon::DefaultState,
00077                           bool recalc=false,
00078                           bool redraw=false);
00079 
00087     void setPixmapDirect( const QPixmap & pixmap,
00088                           bool recalc=false,
00089                           bool redraw=false);
00090 
00099     void invalidateThumb( int state, bool redraw = false );
00100 
00105     void invalidateThumbnail();
00106     bool isThumbnailInvalid() const;
00107 
00108     bool hasValidThumbnail() const { return isThumbnail() && !isThumbnailInvalid(); }
00109 
00114     int state() const { return m_state; }
00115 
00119     int iconSize() const { return m_size; }
00120 
00124     void setDisabled( bool disabled );
00125 
00129     void setThumbnailPixmap( const QPixmap & pixmap );
00130 
00135     void setEffect( /*int group,*/ int state );
00136 
00140     bool isThumbnail() const { return m_bThumbnail; }
00141 
00147     void setOverlay( const QString & iconName);
00148 
00153     virtual void refreshIcon( bool redraw );
00154 
00155     virtual void setKey( const QString &key );
00156 
00161     virtual void paintItem( QPainter *p, const QColorGroup &cg );
00162 
00163     virtual bool move( int x, int y );
00164 
00170     void setMouseOverAnimation( const QString& movieFileName );
00171     QString mouseOverAnimation() const;
00172 
00179     bool hasAnimation() const;
00180 
00182     bool isAnimated() const;
00183     void setAnimated( bool );
00184 
00186     void setActive( bool active );
00187 
00192     KIVDirectoryOverlay* setShowDirectoryOverlay( bool );
00193     bool showDirectoryOverlay( );
00194 
00195     virtual int compare( QIconViewItem *i ) const;
00196 
00197 protected:
00198     virtual void dropped( QDropEvent *e, const QValueList<QIconDragItem> &  );
00199 
00203     void paintOverlay( QPainter *p ) const;
00204 
00208     QColorGroup updateColors(const QColorGroup &c) const;
00209 
00213     void paintFontUpdate( QPainter *p ) const;
00214 
00215 private:
00218     virtual void setPixmap ( const QPixmap & icon ) { KIconViewItem::setPixmap( icon ); }
00219     virtual void setPixmap ( const QPixmap & icon, bool recalc, bool redraw = TRUE )
00220         { KIconViewItem::setPixmap( icon, recalc, redraw ); }
00221     int m_size, m_state;
00222     bool m_bDisabled;
00223     bool m_bThumbnail;
00225     KFileItem* m_fileitem;
00226 
00231     struct Private;
00232 
00233     Private *d;
00234 };
00235 
00236 #endif
KDE Logo
This file is part of the documentation for libkonq Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 29 21:20:28 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003