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 #ifndef __kfileivi_h__
00021 #define __kfileivi_h__
00022 
00023 #include <kiconview.h>
00024 #include <kiconloader.h>
00025 
00026 class KFileItem;
00027 class KonqIconViewWidget;
00028 class KIVDirectoryOverlay;
00029 
00037 class KFileIVI : public KIconViewItem
00038 {
00039 public:
00046     KFileIVI( KonqIconViewWidget *iconview, KFileItem* fileitem, int size );
00047     virtual ~KFileIVI();
00048 
00053     virtual void returnPressed();
00054 
00058     KFileItem * item() const { return m_fileitem; }
00059 
00064     virtual bool acceptDrop( const QMimeSource *mime ) const;
00065 
00073     virtual void setIcon( int size,
00074                           int state=KIcon::DefaultState,
00075                           bool recalc=false,
00076                           bool redraw=false);
00077 
00085     void setPixmapDirect( const QPixmap & pixmap,
00086                           bool recalc=false,
00087                           bool redraw=false);
00088 
00097     void invalidateThumb( int state, bool redraw = false );
00098 
00103     void invalidateThumbnail();
00104     bool isThumbnailInvalid() const;
00105 
00106     bool hasValidThumbnail() const { return isThumbnail() && !isThumbnailInvalid(); }
00107 
00112     int state() const { return m_state; }
00113 
00117     int iconSize() const { return m_size; }
00118 
00122     void setDisabled( bool disabled );
00123 
00127     void setThumbnailPixmap( const QPixmap & pixmap );
00128 
00133     void setEffect( /*int group,*/ int state );
00134 
00138     bool isThumbnail() const { return m_bThumbnail; }
00139 
00145     void setOverlay( const QString & iconName);
00146 
00151     virtual void refreshIcon( bool redraw );
00152 
00153     virtual void setKey( const QString &key );
00154 
00159     virtual void paintItem( QPainter *p, const QColorGroup &cg );
00160 
00161     virtual bool move( int x, int y );
00162 
00168     void setMouseOverAnimation( const QString& movieFileName );
00169     QString mouseOverAnimation() const;
00170 
00177     bool hasAnimation() const;
00178 
00180     bool isAnimated() const;
00181     void setAnimated( bool );
00182 
00184     void setActive( bool active );
00185 
00190     KIVDirectoryOverlay* setShowDirectoryOverlay( bool );
00191     bool showDirectoryOverlay( );
00192 
00193     virtual int compare( QIconViewItem *i ) const;
00194 
00195 protected:
00196     virtual void dropped( QDropEvent *e, const QValueList<QIconDragItem> &  );
00197 
00201     void paintOverlay( QPainter *p ) const;
00202 
00206     QColorGroup updateColors(const QColorGroup &c) const;
00207 
00211     void paintFontUpdate( QPainter *p ) const;
00212 
00213 private:
00216     virtual void setPixmap ( const QPixmap & icon ) { KIconViewItem::setPixmap( icon ); }
00217     virtual void setPixmap ( const QPixmap & icon, bool recalc, bool redraw = TRUE )
00218         { KIconViewItem::setPixmap( icon, recalc, redraw ); }
00219 
00221     void updatePixmapSize();
00222     
00223     int m_size, m_state;
00224     bool m_bDisabled;
00225     bool m_bThumbnail;
00227     KFileItem* m_fileitem;
00228 
00233     struct Private;
00234 
00235     Private *d;
00236 };
00237 
00238 #endif
KDE Logo
This file is part of the documentation for libkonq Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 8 02:43:06 2005 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003