• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkonq
 

libkonq

  • libkonq
konq_iconviewwidget.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 Copyright (C) 2000, 2001, 2002 David Faure <david@mandrakesoft.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __konq_iconviewwidget_h__
21#define __konq_iconviewwidget_h__
22
23#include <kiconloader.h>
24#include <kiconview.h>
25#include <kurl.h>
26#include <tqguardedptr.h>
27#include <tdefileitem.h>
28#include <tdeio/jobclasses.h>
29#include <libkonq_export.h>
30
31class KonqFMSettings;
32class KFileIVI;
33class KonqIconDrag;
34namespace TDEIO { class Job; }
35
42class LIBKONQ_EXPORT KonqIconViewWidget : public TDEIconView
43{
44 TQ_OBJECT
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 )
49
50 friend class KFileIVI;
51
52public:
53
54 enum LineupMode { LineupHorizontal=1, LineupVertical, LineupBoth };
55
59 KonqIconViewWidget( TQWidget *parent = 0L, const char *name = 0L, WFlags f = 0, bool kdesktop = FALSE );
60 virtual ~KonqIconViewWidget();
61
70 bool initConfig( bool bInit );
71
77 void setIconArea( const TQRect &rect );
78
82 virtual void focusOutEvent( TQFocusEvent * /* ev */ );
83
87 TQRect iconArea() const;
88
93 void setLineupMode(int mode);
94
98 int lineupMode() const;
99
105 void lineupIcons();
106
114 void lineupIcons( TQIconView::Arrangement arrangement );
115
126 void setIcons( int size, const TQStringList& stopImagePreviewFor = TQStringList() );
127
131 void refreshMimeTypes();
132
133 int iconSize() { return m_size; }
134
135 void calculateGridX();
140 int gridXValue() const;
141
153 void gridValues( int* x, int* y, int* dx, int* dy, int* nx, int* ny );
154
163 void startImagePreview( const TQStringList &ignored, bool force );
164 void stopImagePreview();
165 bool isPreviewRunning() const;
166 // unused
167 void setThumbnailPixmap( KFileIVI * item, const TQPixmap & pixmap );
168 void disableSoundPreviews();
169
170 void setURL ( const KURL & kurl );
171 // ### KDE4: make const
172 const KURL & url() { return m_url; }
173 TQString urlString() const { return m_url.url(); }
174 void setRootItem ( const KFileItem * item ) { m_rootItem = item; }
175
179 KFileItemList selectedFileItems();
180
181 void setItemColor( const TQColor &c );
182 TQColor itemColor() const;
183
184 virtual void cutSelection();
185 virtual void copySelection();
186 virtual void pasteSelection();
187 virtual KURL::List selectedUrls(); // KDE4: remove virtual + add const
188 enum UrlFlags { UserVisibleUrls = 0, MostLocalUrls = 1 };
189 KURL::List selectedUrls( UrlFlags flags ) const; // KDE4: merge with above, default is == UserVisibleUrls
190 void paste( const KURL &url );
191
192 bool sortDirectoriesFirst() const;
193 void setSortDirectoriesFirst( bool b );
194
195 void setCaseInsensitiveSort( bool b );
196 bool caseInsensitiveSort() const;
197
201 const KURL::List & dragURLs() { return m_lstDragURLs; }
202
206 virtual void clear();
207
211 virtual void takeItem( TQIconViewItem *item );
212
216 virtual void insertInGrid( TQIconViewItem *item );
217
221 virtual void setItemTextPos( ItemTextPos pos );
222
226 virtual void visualActivate(TQIconViewItem *);
227
228 bool isDesktop() const { return m_bDesktop; }
229
233 virtual void setWallpaper(const KURL&) { }
234
235 bool maySetWallpaper();
236 void setMaySetWallpaper(bool b);
237
238 void disableIcons( const KURL::List & lst );
239
240 TQString iconPositionGroupPrefix() const { return m_iconPositionGroupPrefix; }
241 TQString dotDirectoryPath() const { return m_dotDirectoryPath; }
242
243 void setPreviewSettings(const TQStringList& mimeTypes);
244 const TQStringList& previewSettings();
245 void setNewURL( const TQString& url );
246
247public slots:
251 virtual void slotSelectionChanged();
252
253 void slotSaveIconPositions();
254
255 void renameSelectedItem();
256 void renameCurrentItem();
257
258 void slotToolTipPreview( const KFileItem *, const TQPixmap & ); // ### unused - remove for KDE4
259 void slotToolTipPreviewResult() ; // ### unused - remove for KDE4
260
261signals:
265 void enableAction( const char * name, bool enabled );
266
267 void dropped();
268 void imagePreviewFinished();
269
270 void incIconSize();
271 void decIconSize();
272
276 void dragEntered( bool accepted );
277 void dragLeft();
278
279 void dragMove( bool accepted );
284 void dragFinished();
285
286protected slots:
287 virtual void slotDropped( TQDropEvent *e, const TQValueList<TQIconDragItem> & );
288
289 void slotItemRenamed(TQIconViewItem *item, const TQString &name);
290
291 void slotIconChanged(int);
292 void slotOnItem(TQIconViewItem *);
293 void slotOnViewport();
294 void slotStartSoundPreview();
295 void slotPreview(const KFileItem *, const TQPixmap &);
296 void slotPreviewResult();
297
298 void slotMovieUpdate( const TQRect& rect );
299 void slotMovieStatus( int status );
300 void slotReenableAnimation();
301
302 void slotAboutToCreate(const TQPoint &pos, const TQValueList<TDEIO::CopyInfo> &files);
303 void doubleClickTimeout();
304
305protected:
306 virtual TQDragObject *dragObject();
307 KonqIconDrag *konqDragObject( TQWidget * dragSource = 0L );
308 bool mimeTypeMatch( const TQString& mimeType, const TQStringList& mimeList ) const;
309
310 virtual void drawBackground( TQPainter *p, const TQRect &r );
316 virtual void drawBackground( TQPainter *p, const TQRect &r,
317 const TQPoint &pt );
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 );
328
329 void readAnimatedIconsConfig();
330 void mousePressChangeValue();
331
332 bool boostPreview() const;
333 int previewIconSize( int size ) const;
334 int largestPreviewIconSize( int size ) const;
335 bool canPreview( KFileItem* item );
336 void updatePreviewMimeTypes();
337
338private:
339 KURL m_url;
340 const KFileItem * m_rootItem;
341
342 KURL::List m_lstDragURLs;
343
344 int m_size;
345
347 KonqFMSettings * m_pSettings;
348
349 bool m_bMousePressed;
350 TQPoint m_mousePos;
351
352 TQColor iColor;
353
354 bool m_bSortDirsFirst;
355
356 TQString m_iconPositionGroupPrefix;
357 TQString m_dotDirectoryPath;
358
359 int m_LineupMode;
360 TQRect m_IconRect;
361
362 bool m_bDesktop;
363 bool m_bSetGridX;
364
365private:
366 struct KonqIconViewWidgetPrivate *d;
367
368};
369
370#endif
KFileIVI
KFileIVI (short form of "Konq - File - IconViewItem") is, as expected, an improved TDEIconViewItem,...
Definition: tdefileivi.h:40
KFileIVI::item
KFileItem * item() const
Definition: tdefileivi.h:60
KFileIVI::setThumbnailPixmap
void setThumbnailPixmap(const TQPixmap &pixmap)
Set this when the thumbnail was loaded.
Definition: tdefileivi.cpp:241
KFileIVI::iconSize
int iconSize() const
Return the theorical size of the icon.
Definition: tdefileivi.h:119
KonqFMSettings
The class KonqFMSettings holds the general settings for the icon/tree views in konqueror/kdesktop.
Definition: konq_settings.h:45
KonqIconViewWidget
A file-aware icon view, implementing drag'n'drop, KDE icon sizes, user settings, animated icons....
Definition: konq_iconviewwidget.h:43
KonqIconViewWidget::dragEntered
void dragEntered(bool accepted)
We need to track drag in icon views for the spring loading folders.
KonqIconViewWidget::dragURLs
const KURL::List & dragURLs()
Cache of the dragged URLs over the icon view, used by KFileIVI.
Definition: konq_iconviewwidget.h:201
KonqIconViewWidget::enableAction
void enableAction(const char *name, bool enabled)
For cut/copy/paste/move/delete (see tdeparts/browserextension.h)
KonqIconViewWidget::dragFinished
void dragFinished()
Emited after the dropped() event.
KonqIconViewWidget::setWallpaper
virtual void setWallpaper(const KURL &)
Provided for KDesktop.
Definition: konq_iconviewwidget.h:233

libkonq

Skip menu "libkonq"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkonq

Skip menu "libkonq"
  • kate
  • libkonq
  • twin
  •   lib
Generated for libkonq by doxygen 1.9.4
This website is maintained by Timothy Pearson.