• 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
247 bool isRenaming() const; // reimplemented from TQIconView
248
249public slots:
253 virtual void slotSelectionChanged();
254
255 void slotSaveIconPositions();
256
257 void renameSelectedItem();
258 void renameCurrentItem();
259
260 void slotToolTipPreview( const KFileItem *, const TQPixmap & ); // ### unused - remove for KDE4
261 void slotToolTipPreviewResult() ; // ### unused - remove for KDE4
262
263signals:
267 void enableAction( const char * name, bool enabled );
268
269 void dropped();
270 void imagePreviewFinished();
271
272 void incIconSize();
273 void decIconSize();
274
278 void dragEntered( bool accepted );
279 void dragLeft();
280
281 void dragMove( bool accepted );
286 void dragFinished();
287
288protected slots:
289 virtual void slotDropped( TQDropEvent *e, const TQValueList<TQIconDragItem> & );
290
291 void slotItemRenamed(TQIconViewItem *item, const TQString &name);
292
293 void slotIconChanged(int);
294 void slotOnItem(TQIconViewItem *);
295 void slotOnViewport();
296 void slotStartSoundPreview();
297 void slotPreview(const KFileItem *, const TQPixmap &);
298 void slotPreviewResult();
299
300 void slotMovieUpdate( const TQRect& rect );
301 void slotMovieStatus( int status );
302 void slotReenableAnimation();
303
304 void slotAboutToCreate(const TQPoint &pos, const TQValueList<TDEIO::CopyInfo> &files);
305 void doubleClickTimeout();
306
307protected:
308 virtual TQDragObject *dragObject();
309 KonqIconDrag *konqDragObject( TQWidget * dragSource = 0L );
310 bool mimeTypeMatch( const TQString& mimeType, const TQStringList& mimeList ) const;
311
312 virtual void drawBackground( TQPainter *p, const TQRect &r );
318 virtual void drawBackground( TQPainter *p, const TQRect &r,
319 const TQPoint &pt );
320 virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
321 virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e );
322 virtual void contentsDragMoveEvent( TQDragMoveEvent *e );
323 virtual void contentsDropEvent( TQDropEvent *e );
324 virtual void contentsMousePressEvent( TQMouseEvent *e );
325 virtual void contentsMouseReleaseEvent ( TQMouseEvent * e );
326 virtual void contentsMouseMoveEvent( TQMouseEvent *e );
327 virtual void backgroundPixmapChange( const TQPixmap & );
328 virtual void wheelEvent( TQWheelEvent* );
329 virtual void leaveEvent( TQEvent *e );
330
331 void readAnimatedIconsConfig();
332 void mousePressChangeValue();
333
334 bool boostPreview() const;
335 int previewIconSize( int size ) const;
336 int largestPreviewIconSize( int size ) const;
337 bool canPreview( KFileItem* item );
338 void updatePreviewMimeTypes();
339
340 const KFileIVI* renamingItem();
341 void setRenamingItem(KFileIVI *theItem);
342
343private:
344 KURL m_url;
345 const KFileItem * m_rootItem;
346
347 KURL::List m_lstDragURLs;
348
349 int m_size;
350
352 KonqFMSettings * m_pSettings;
353
354 bool m_bMousePressed;
355 TQPoint m_mousePos;
356
357 TQColor iColor;
358
359 bool m_bSortDirsFirst;
360
361 TQString m_iconPositionGroupPrefix;
362 TQString m_dotDirectoryPath;
363
364 int m_LineupMode;
365 TQRect m_IconRect;
366
367 bool m_bDesktop;
368 bool m_bSetGridX;
369
370private:
371 struct KonqIconViewWidgetPrivate *d;
372
373};
374
375#endif
KFileIVI
KFileIVI (short form of "Konq - File - IconViewItem") is, as expected, an improved TDEIconViewItem,...
Definition: tdefileivi.h:41
KFileIVI::item
KFileItem * item() const
Definition: tdefileivi.h:63
KFileIVI::setThumbnailPixmap
void setThumbnailPixmap(const TQPixmap &pixmap)
Set this when the thumbnail was loaded.
Definition: tdefileivi.cpp:244
KFileIVI::iconSize
int iconSize() const
Return the theorical size of the icon.
Definition: tdefileivi.h:122
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.