libkonq Library API Documentation

KFileIVI Class Reference

KFileIVI (short form of "Konq - File - IconViewItem") is, as expected, an improved KIconViewItem, because it represents a file. More...

#include <kfileivi.h>

List of all members.

Public Member Functions

 KFileIVI (KonqIconViewWidget *iconview, KFileItem *fileitem, int size)
 Create an icon, within a qlistview, representing a file.

virtual void returnPressed ()
 Handler for return (or single/double click) on ONE icon.

KFileItem * item () const
virtual bool acceptDrop (const QMimeSource *mime) const
virtual void setIcon (int size, int state=KIcon::DefaultState, bool recalc=false, bool redraw=false)
 Changes the icon for this item.

void setPixmapDirect (const QPixmap &pixmap, bool recalc=false, bool redraw=false)
 Bypass setIcon.

void invalidateThumb (int state, bool redraw=false)
 Notifies that all icon effects on thumbs should be invalidated, e.g.

void invalidateThumbnail ()
 Our current thumbnail is not longer "current".

bool isThumbnailInvalid () const
bool hasValidThumbnail () const
int state () const
 Return the current state of the icon (KIcon::DefaultState, KIcon::ActiveState etc.).

int iconSize () const
 Return the theorical size of the icon.

void setDisabled (bool disabled)
 Set to true when this icon is 'cut'.

void setThumbnailPixmap (const QPixmap &pixmap)
 Set this when the thumbnail was loaded.

void setEffect (int state)
 Set the icon to use the specified KIconEffect See the docs for KIconEffect for details.

bool isThumbnail () const
void setOverlay (const QString &iconName)
 Sets an icon to be shown over the bottom left corner of the icon.

virtual void refreshIcon (bool redraw)
 Redetermines the icon (useful if KFileItem might return another icon).

virtual void setKey (const QString &key)
virtual void paintItem (QPainter *p, const QColorGroup &cg)
 Paints this item.

virtual bool move (int x, int y)
void setMouseOverAnimation (const QString &movieFileName)
 Enable an animation on mouseover, if there is an available mng.

QString mouseOverAnimation () const
bool hasAnimation () const
 Return true if the icon _might_ have an animation available.

bool isAnimated () const
 Return true if we are currently animating this icon.

void setAnimated (bool)
void setActive (bool active)
 Called when the mouse is over the icon.

KIVDirectoryOverlay * setShowDirectoryOverlay (bool)
 Sets showing of directory overlays.

bool showDirectoryOverlay ()

Protected Member Functions

virtual void dropped (QDropEvent *e, const QValueList< QIconDragItem > &)


Detailed Description

KFileIVI (short form of "Konq - File - IconViewItem") is, as expected, an improved KIconViewItem, because it represents a file.

All the information about the file is contained in the KFileItem pointer.

Definition at line 39 of file kfileivi.h.


Constructor & Destructor Documentation

KFileIVI::KFileIVI KonqIconViewWidget iconview,
KFileItem *  fileitem,
int  size
 

Create an icon, within a qlistview, representing a file.

Parameters:
parent the parent widget
fileitem the file item created by KDirLister
size the icon size

Definition at line 49 of file kfileivi.cc.

References setMouseOverAnimation().


Member Function Documentation

void KFileIVI::returnPressed  )  [virtual]
 

Handler for return (or single/double click) on ONE icon.

Runs the file through KRun.

Definition at line 332 of file kfileivi.cc.

KFileItem* KFileIVI::item  )  const [inline]
 

Returns:
the file item held by this instance

Definition at line 60 of file kfileivi.h.

Referenced by KonqIconViewWidget::setIcons().

bool KFileIVI::acceptDrop const QMimeSource *  mime  )  const [virtual]
 

Returns:
true if dropping on this file is allowed Overloads QIconView::acceptDrop()

Definition at line 291 of file kfileivi.cc.

void KFileIVI::setIcon int  size,
int  state = KIcon::DefaultState,
bool  recalc = false,
bool  redraw = false
[virtual]
 

Changes the icon for this item.

Parameters:
size the icon size (0 for default, otherwise size in pixels)
state the state of the icon (enum in KIcon)
recalc whether to update the layout of the icon view when setting the icon
redraw whether to redraw the item after setting the icon

Definition at line 106 of file kfileivi.cc.

References setPixmapDirect().

Referenced by refreshIcon(), and KonqIconViewWidget::setIcons().

void KFileIVI::setPixmapDirect const QPixmap &  pixmap,
bool  recalc = false,
bool  redraw = false
 

Bypass setIcon.

This is for animated icons, you should use setIcon in all other cases.

Parameters:
pixmap the pixmap to set - it SHOULD really have the right icon size!
recalc whether to update the layout of the icon view when setting the icon
redraw whether to redraw the item after setting the icon

Definition at line 159 of file kfileivi.cc.

Referenced by setIcon().

void KFileIVI::invalidateThumb int  state,
bool  redraw = false
 

Notifies that all icon effects on thumbs should be invalidated, e.g.

because the effect settings have been changed. The thumb itself is assumed to be still valid (use setThumbnailPixmap() instead otherwise).

Parameters:
state the state of the icon (enum in KIcon)
redraw whether to redraw the item after setting the icon

Definition at line 80 of file kfileivi.cc.

Referenced by KonqIconViewWidget::setIcons().

void KFileIVI::invalidateThumbnail  ) 
 

Our current thumbnail is not longer "current".

Called when the file contents have changed.

Definition at line 281 of file kfileivi.cc.

int KFileIVI::state  )  const [inline]
 

Return the current state of the icon (KIcon::DefaultState, KIcon::ActiveState etc.).

Definition at line 114 of file kfileivi.h.

Referenced by KonqIconViewWidget::setIcons().

int KFileIVI::iconSize  )  const [inline]
 

Return the theorical size of the icon.

Definition at line 119 of file kfileivi.h.

void KFileIVI::setDisabled bool  disabled  ) 
 

Set to true when this icon is 'cut'.

Definition at line 185 of file kfileivi.cc.

References isThumbnail().

void KFileIVI::setThumbnailPixmap const QPixmap &  pixmap  ) 
 

Set this when the thumbnail was loaded.

Definition at line 196 of file kfileivi.cc.

void KFileIVI::setEffect int  state  ) 
 

Set the icon to use the specified KIconEffect See the docs for KIconEffect for details.

Definition at line 222 of file kfileivi.cc.

Referenced by setActive().

bool KFileIVI::isThumbnail  )  const [inline]
 

Returns:
true if this item is a thumbnail

Definition at line 140 of file kfileivi.h.

Referenced by refreshIcon(), setDisabled(), and KonqIconViewWidget::setIcons().

void KFileIVI::setOverlay const QString &  iconName  ) 
 

Sets an icon to be shown over the bottom left corner of the icon.

Currently used for directory overlays. setOverlay(QString::null) to remove icon.

Definition at line 130 of file kfileivi.cc.

References refreshIcon().

Referenced by setShowDirectoryOverlay().

void KFileIVI::refreshIcon bool  redraw  )  [virtual]
 

Redetermines the icon (useful if KFileItem might return another icon).

Does nothing with thumbnails

Definition at line 275 of file kfileivi.cc.

References isThumbnail(), and setIcon().

Referenced by setOverlay().

void KFileIVI::paintItem QPainter *  p,
const QColorGroup &  cg
[virtual]
 

Paints this item.

Takes care of using the normal or alpha blending methods depending on the configuration.

Definition at line 337 of file kfileivi.cc.

void KFileIVI::setMouseOverAnimation const QString &  movieFileName  ) 
 

Enable an animation on mouseover, if there is an available mng.

Parameters:
movieFileName the base name for the mng, e.g. "folder". Nothing happens if there is no animation available.

Definition at line 385 of file kfileivi.cc.

Referenced by KFileIVI().

bool KFileIVI::hasAnimation  )  const
 

Return true if the icon _might_ have an animation available.

This doesn't mean the .mng exists (only determined when hovering on the icon - and if it doesn't exist setMouseOverAnimation(QString::null) is called), and it doesn't mean that it's currently running either.

Definition at line 380 of file kfileivi.cc.

bool KFileIVI::isAnimated  )  const
 

Return true if we are currently animating this icon.

Definition at line 399 of file kfileivi.cc.

void KFileIVI::setActive bool  active  ) 
 

Called when the mouse is over the icon.

Definition at line 214 of file kfileivi.cc.

References setEffect().

KIVDirectoryOverlay * KFileIVI::setShowDirectoryOverlay bool   ) 
 

Sets showing of directory overlays.

Does nothing if this does not represent a folder.

Definition at line 137 of file kfileivi.cc.

References setOverlay().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Thu Jan 29 23:03:28 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001