libkonq Library API Documentation

KonqIconViewWidget Class Reference

A file-aware icon view, implementing drag'n'drop, KDE icon sizes, user settings, animated icons... More...

#include <konq_iconviewwidget.h>

List of all members.

Public Types

enum  LineupMode { LineupHorizontal = 1, LineupVertical, LineupBoth }

Public Slots

virtual void slotSelectionChanged ()
 Checks the new selection and emits enableAction() signals.

void slotSaveIconPositions ()
void renameSelectedItem ()
void slotToolTipPreview (const KFileItem *, const QPixmap &)
void slotToolTipPreviewResult ()

Signals

void enableAction (const char *name, bool enabled)
 For cut/copy/paste/move/delete (see kparts/browserextension.h).

void dropped ()
void imagePreviewFinished ()

Public Member Functions

 KonqIconViewWidget (QWidget *parent=0L, const char *name=0L, WFlags f=0, bool kdesktop=FALSE)
 Constructor.

bool initConfig (bool bInit)
 Read the configuration and apply it.

void setIconArea (const QRect &rect)
 Set the area that will be occupied by icons.

virtual void focusOutEvent (QFocusEvent *)
 Reimplemented to make the slotOnItem highlighting work.

QRect iconArea () const
 Returns the icon area.

void setLineupMode (int mode)
 Set the lineup mode.

int lineupMode () const
 Returns the lineup mode.

void lineupIcons ()
 Line up the icons to a regular grid.

void setIcons (int size, const QStringList &stopImagePreviewFor=QStringList())
 Sets the icons of all items, and stores the size This doesn't touch thumbnails, except if stopImagePreviewFor is set.

void refreshMimeTypes ()
 Called on databaseChanged.

int iconSize ()
void calculateGridX ()
int gridXValue () const
 The horizontal distance between two icons (whether or not a grid has been given to QIconView).

void startImagePreview (const QStringList &ignored, bool force)
 Start generating the previews.

void stopImagePreview ()
bool isPreviewRunning () const
void setThumbnailPixmap (KFileIVI *item, const QPixmap &pixmap)
void disableSoundPreviews ()
void setURL (const KURL &kurl)
const KURL & url ()
QString urlString () const
void setRootItem (const KFileItem *item)
KFileItemList selectedFileItems ()
 Get list of selected KFileItems.

void setItemColor (const QColor &c)
QColor itemColor () const
virtual void cutSelection ()
virtual void copySelection ()
virtual void pasteSelection ()
virtual KURL::List selectedUrls ()
void paste (const KURL &url)
bool sortDirectoriesFirst () const
void setSortDirectoriesFirst (bool b)
const KURL::List & dragURLs ()
 Cache of the dragged URLs over the icon view, used by KFileIVI.

virtual void clear ()
 Reimplemented from QIconView.

virtual void takeItem (QIconViewItem *item)
 Reimplemented from QIconView.

virtual void insertInGrid (QIconViewItem *item)
 Reimplemented from QIconView to take into account iconArea.

virtual void setItemTextPos (ItemTextPos pos)
 Reimplemented from QIconView to update the gridX.

virtual void visualActivate (QIconViewItem *)
 Give feedback when item is activated.

bool isDesktop () const
virtual void setWallpaper (const KURL &)
 Provided for KDesktop.

bool maySetWallpaper ()
void setMaySetWallpaper (bool b)
void disableIcons (const KURL::List &lst)
QString iconPositionGroupPrefix () const
QString dotDirectoryPath () const
void setPreviewSettings (const QStringList &mimeTypes)
const QStringList & previewSettings ()
void setNewURL (const QString &url)

Protected Slots

virtual void slotDropped (QDropEvent *e, const QValueList< QIconDragItem > &)
void slotItemRenamed (QIconViewItem *item, const QString &name)
void slotIconChanged (int)
void slotOnItem (QIconViewItem *)
void slotOnViewport ()
void slotStartSoundPreview ()
void slotPreview (const KFileItem *, const QPixmap &)
void slotPreviewResult ()
void slotMovieUpdate (const QRect &rect)
void slotMovieStatus (int status)
void slotReenableAnimation ()

Protected Member Functions

virtual QDragObject * dragObject ()
KonqIconDrag * konqDragObject (QWidget *dragSource=0L)
bool mimeTypeMatch (const QString &mimeType, const QStringList &mimeList) const
virtual void drawBackground (QPainter *p, const QRect &r)
virtual void drawBackground (QPainter *p, const QRect &r, const QPoint &pt)
 r is the rectangle which you want to paint from the background.

virtual void contentsDragEnterEvent (QDragEnterEvent *e)
virtual void contentsDropEvent (QDropEvent *e)
virtual void contentsMousePressEvent (QMouseEvent *e)
virtual void contentsMouseReleaseEvent (QMouseEvent *e)
virtual void backgroundPixmapChange (const QPixmap &)
void readAnimatedIconsConfig ()


Detailed Description

A file-aware icon view, implementing drag'n'drop, KDE icon sizes, user settings, animated icons...

Used by kdesktop and konq_iconview.

Definition at line 40 of file konq_iconviewwidget.h.


Constructor & Destructor Documentation

KonqIconViewWidget::KonqIconViewWidget QWidget *  parent = 0L,
const char *  name = 0L,
WFlags  f = 0,
bool  kdesktop = FALSE
 

Constructor.

Parameters:
settings An instance of KonqFMSettings, see static methods in konq_settings.h

Definition at line 359 of file konq_iconviewwidget.cc.

References setItemTextPos(), and slotSelectionChanged().


Member Function Documentation

bool KonqIconViewWidget::initConfig bool  bInit  ) 
 

Read the configuration and apply it.

Call this in the inherited constructor with bInit=true, and in some reparseConfiguration() slot with bInit=false. Returns true if the font was changed (which means something has to be done so that the icon's texts don't run into each other). However Konq and KDesktop handle this differently.

Definition at line 767 of file konq_iconviewwidget.cc.

References KonqFMSettings::itemTextBackground(), KonqFMSettings::normalTextColor(), KonqFMSettings::numFileTips(), KonqFMSettings::settings(), KonqFMSettings::showFileTips(), KonqFMSettings::showPreviewsInFileTips(), KonqFMSettings::standardFont(), KonqFMSettings::underlineLink(), and KonqFMSettings::wordWrapText().

void KonqIconViewWidget::setIconArea const QRect &  rect  ) 
 

Set the area that will be occupied by icons.

It is still possible to drag icons outside this area; this only applies to automatically placed icons.

Definition at line 1234 of file konq_iconviewwidget.cc.

void KonqIconViewWidget::focusOutEvent QFocusEvent *   )  [virtual]
 

Reimplemented to make the slotOnItem highlighting work.

Definition at line 414 of file konq_iconviewwidget.cc.

QRect KonqIconViewWidget::iconArea  )  const
 

Returns the icon area.

Definition at line 1229 of file konq_iconviewwidget.cc.

void KonqIconViewWidget::setLineupMode int  mode  ) 
 

Set the lineup mode.

This determines in which direction(s) icons are moved when lineing them up.

Definition at line 1244 of file konq_iconviewwidget.cc.

int KonqIconViewWidget::lineupMode  )  const
 

Returns the lineup mode.

Definition at line 1239 of file konq_iconviewwidget.cc.

void KonqIconViewWidget::lineupIcons  ) 
 

Line up the icons to a regular grid.

The outline of the grid is specified by iconArea. The two length parameters are gridX and gridY.

Definition at line 1531 of file konq_iconviewwidget.cc.

References gridXValue().

void KonqIconViewWidget::setIcons int  size,
const QStringList &  stopImagePreviewFor = QStringList()
 

Sets the icons of all items, and stores the size This doesn't touch thumbnails, except if stopImagePreviewFor is set.

Takes care of the grid, when changing the size.

Parameters:
stopImagePreviewFor set to a list of mimetypes which should be made normal again. For instance "text/plain,image/wmf". Can be set to "*" for "all mimetypes" and to "image/"+"*" for "all images".

Definition at line 821 of file konq_iconviewwidget.cc.

References KFileIVI::invalidateThumb(), KFileIVI::isThumbnail(), KFileIVI::item(), KFileIVI::setIcon(), and KFileIVI::state().

Referenced by refreshMimeTypes().

void KonqIconViewWidget::refreshMimeTypes  ) 
 

Called on databaseChanged.

Definition at line 904 of file konq_iconviewwidget.cc.

References setIcons().

int KonqIconViewWidget::gridXValue  )  const
 

The horizontal distance between two icons (whether or not a grid has been given to QIconView).

Definition at line 896 of file konq_iconviewwidget.cc.

Referenced by lineupIcons().

void KonqIconViewWidget::startImagePreview const QStringList &  ignored,
bool  force
 

Start generating the previews.

Parameters:
previewSettings 
force if true, all files are looked at. Otherwise, only those which are not a thumbnail already.

Definition at line 921 of file konq_iconviewwidget.cc.

References KonqFMSettings::textPreviewIconTransparency().

KFileItemList KonqIconViewWidget::selectedFileItems  ) 
 

Get list of selected KFileItems.

Definition at line 1007 of file konq_iconviewwidget.cc.

Referenced by slotSelectionChanged().

const KURL::List& KonqIconViewWidget::dragURLs  )  [inline]
 

Cache of the dragged URLs over the icon view, used by KFileIVI.

Definition at line 169 of file konq_iconviewwidget.h.

void KonqIconViewWidget::clear  )  [virtual]
 

Reimplemented from QIconView.

Definition at line 726 of file konq_iconviewwidget.cc.

void KonqIconViewWidget::takeItem QIconViewItem *  item  )  [virtual]
 

Reimplemented from QIconView.

Definition at line 734 of file konq_iconviewwidget.cc.

void KonqIconViewWidget::insertInGrid QIconViewItem *  item  )  [virtual]
 

Reimplemented from QIconView to take into account iconArea.

Definition at line 1351 of file konq_iconviewwidget.cc.

void KonqIconViewWidget::setItemTextPos ItemTextPos  pos  )  [virtual]
 

Reimplemented from QIconView to update the gridX.

Definition at line 873 of file konq_iconviewwidget.cc.

Referenced by KonqIconViewWidget().

void KonqIconViewWidget::visualActivate QIconViewItem *   )  [virtual]
 

Give feedback when item is activated.

Definition at line 1789 of file konq_iconviewwidget.cc.

virtual void KonqIconViewWidget::setWallpaper const KURL &   )  [inline, virtual]
 

Provided for KDesktop.

Definition at line 201 of file konq_iconviewwidget.h.

void KonqIconViewWidget::slotSelectionChanged  )  [virtual, slot]
 

Checks the new selection and emits enableAction() signals.

Definition at line 1142 of file konq_iconviewwidget.cc.

References enableAction(), and selectedFileItems().

Referenced by KonqIconViewWidget().

void KonqIconViewWidget::enableAction const char *  name,
bool  enabled
[signal]
 

For cut/copy/paste/move/delete (see kparts/browserextension.h).

Referenced by slotSelectionChanged().

void KonqIconViewWidget::drawBackground QPainter *  p,
const QRect &  r,
const QPoint &  pt
[protected, virtual]
 

r is the rectangle which you want to paint from the background.

pt is the upper left point in the painter device where you want to paint the rectangle r.

Definition at line 1031 of file konq_iconviewwidget.cc.


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:29 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001