20 #ifndef __konq_iconviewwidget_h__
21 #define __konq_iconviewwidget_h__
23 #include <kiconloader.h>
24 #include <kiconview.h>
26 #include <tqguardedptr.h>
27 #include <tdefileitem.h>
28 #include <tdeio/jobclasses.h>
29 #include <libkonq_export.h>
34 namespace TDEIO {
class Job; }
45 TQ_PROPERTY(
bool sortDirectoriesFirst READ sortDirectoriesFirst WRITE setSortDirectoriesFirst )
46 TQ_PROPERTY( TQRect iconArea READ iconArea WRITE setIconArea )
47 TQ_PROPERTY(
int lineupMode READ lineupMode WRITE setLineupMode )
48 TQ_PROPERTY( TQString url READ urlString WRITE setNewURL )
54 enum LineupMode { LineupHorizontal=1, LineupVertical, LineupBoth };
59 KonqIconViewWidget( TQWidget *parent = 0L,
const char *name = 0L, WFlags f = 0,
bool kdesktop = FALSE );
70 bool initConfig(
bool bInit );
77 void setIconArea(
const TQRect &rect );
82 virtual void focusOutEvent( TQFocusEvent * );
87 TQRect iconArea()
const;
93 void setLineupMode(
int mode);
98 int lineupMode()
const;
114 void lineupIcons( TQIconView::Arrangement arrangement );
126 void setIcons(
int size,
const TQStringList& stopImagePreviewFor = TQStringList() );
131 void refreshMimeTypes();
135 void calculateGridX();
140 int gridXValue()
const;
153 void gridValues(
int* x,
int* y,
int* dx,
int* dy,
int* nx,
int* ny );
163 void startImagePreview(
const TQStringList &ignored,
bool force );
164 void stopImagePreview();
165 bool isPreviewRunning()
const;
168 void disableSoundPreviews();
170 void setURL (
const KURL & kurl );
172 const KURL & url() {
return m_url; }
173 TQString urlString()
const {
return m_url.url(); }
174 void setRootItem (
const KFileItem *
item ) { m_rootItem =
item; }
179 KFileItemList selectedFileItems();
181 void setItemColor(
const TQColor &c );
182 TQColor itemColor()
const;
184 virtual void cutSelection();
185 virtual void copySelection();
186 virtual void pasteSelection();
187 virtual KURL::List selectedUrls();
188 enum UrlFlags { UserVisibleUrls = 0, MostLocalUrls = 1 };
189 KURL::List selectedUrls( UrlFlags flags )
const;
190 void paste(
const KURL &url );
192 bool sortDirectoriesFirst()
const;
193 void setSortDirectoriesFirst(
bool b );
195 void setCaseInsensitiveSort(
bool b );
196 bool caseInsensitiveSort()
const;
201 const KURL::List &
dragURLs() {
return m_lstDragURLs; }
206 virtual void clear();
211 virtual void takeItem( TQIconViewItem *
item );
216 virtual void insertInGrid( TQIconViewItem *
item );
221 virtual void setItemTextPos( ItemTextPos pos );
226 virtual void visualActivate(TQIconViewItem *);
228 bool isDesktop()
const {
return m_bDesktop; }
235 bool maySetWallpaper();
236 void setMaySetWallpaper(
bool b);
238 void disableIcons(
const KURL::List & lst );
240 TQString iconPositionGroupPrefix()
const {
return m_iconPositionGroupPrefix; }
241 TQString dotDirectoryPath()
const {
return m_dotDirectoryPath; }
243 void setPreviewSettings(
const TQStringList& mimeTypes);
244 const TQStringList& previewSettings();
245 void setNewURL(
const TQString& url );
251 virtual void slotSelectionChanged();
253 void slotSaveIconPositions();
255 void renameSelectedItem();
256 void renameCurrentItem();
258 void slotToolTipPreview(
const KFileItem *,
const TQPixmap & );
259 void slotToolTipPreviewResult() ;
268 void imagePreviewFinished();
279 void dragMove(
bool accepted );
287 virtual void slotDropped( TQDropEvent *e,
const TQValueList<TQIconDragItem> & );
289 void slotItemRenamed(TQIconViewItem *
item,
const TQString &name);
291 void slotIconChanged(
int);
292 void slotOnItem(TQIconViewItem *);
293 void slotOnViewport();
294 void slotStartSoundPreview();
295 void slotPreview(
const KFileItem *,
const TQPixmap &);
296 void slotPreviewResult();
298 void slotMovieUpdate(
const TQRect& rect );
299 void slotMovieStatus(
int status );
300 void slotReenableAnimation();
302 void slotAboutToCreate(
const TQPoint &pos,
const TQValueList<TDEIO::CopyInfo> &files);
303 void doubleClickTimeout();
306 virtual TQDragObject *dragObject();
307 KonqIconDrag *konqDragObject( TQWidget * dragSource = 0L );
308 bool mimeTypeMatch(
const TQString& mimeType,
const TQStringList& mimeList )
const;
310 virtual void drawBackground( TQPainter *p,
const TQRect &r );
316 virtual void drawBackground( TQPainter *p,
const TQRect &r,
318 virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
319 virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e );
320 virtual void contentsDragMoveEvent( TQDragMoveEvent *e );
321 virtual void contentsDropEvent( TQDropEvent *e );
322 virtual void contentsMousePressEvent( TQMouseEvent *e );
323 virtual void contentsMouseReleaseEvent ( TQMouseEvent * e );
324 virtual void contentsMouseMoveEvent( TQMouseEvent *e );
325 virtual void backgroundPixmapChange(
const TQPixmap & );
326 virtual void wheelEvent( TQWheelEvent* );
327 virtual void leaveEvent( TQEvent *e );
329 void readAnimatedIconsConfig();
330 void mousePressChangeValue();
332 bool boostPreview()
const;
333 int previewIconSize(
int size )
const;
334 int largestPreviewIconSize(
int size )
const;
335 bool canPreview( KFileItem*
item );
336 void updatePreviewMimeTypes();
340 const KFileItem * m_rootItem;
342 KURL::List m_lstDragURLs;
349 bool m_bMousePressed;
354 bool m_bSortDirsFirst;
356 TQString m_iconPositionGroupPrefix;
357 TQString m_dotDirectoryPath;
366 struct KonqIconViewWidgetPrivate *d;
KFileIVI (short form of "Konq - File - IconViewItem") is, as expected, an improved TDEIconViewItem,...
void setThumbnailPixmap(const TQPixmap &pixmap)
Set this when the thumbnail was loaded.
int iconSize() const
Return the theorical size of the icon.
The class KonqFMSettings holds the general settings for the icon/tree views in konqueror/kdesktop.