• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdefile
 

tdeio/tdefile

  • tdeio
  • tdefile
tdefileiconview.h
1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Stephan Kulow <coolo@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef TDEFILEICONVIEW_H
21#define TDEFILEICONVIEW_H
22
23#include <tqglobal.h>
24
25#include <kiconview.h>
26#include <kiconloader.h>
27#include <tdefileview.h>
28#include <kmimetyperesolver.h>
29#include <tdefile.h>
30
31class KFileItem;
32class TQWidget;
33class TQLabel;
34
39class TDEIO_EXPORT KFileIconViewItem : public TDEIconViewItem
40{
41public:
42 KFileIconViewItem( TQIconView *parent, const TQString &text,
43 const TQPixmap &pixmap,
44 KFileItem *fi )
45 : TDEIconViewItem( parent, text, pixmap ), inf( fi ) {}
49 KFileIconViewItem( TQIconView *parent, KFileItem *fi )
50 : TDEIconViewItem( parent ), inf( fi ) {}
51
52 virtual ~KFileIconViewItem();
53
57 KFileItem *fileInfo() const {
58 return inf;
59 }
60
61private:
62 KFileItem *inf;
63
64private:
65 class KFileIconViewItemPrivate;
66 KFileIconViewItemPrivate *d;
67
68};
69
70namespace TDEIO {
71 class Job;
72}
73
82class TDEIO_EXPORT KFileIconView : public TDEIconView, public KFileView
83{
84 TQ_OBJECT
85
86public:
87 KFileIconView(TQWidget *parent, const char *name);
88 virtual ~KFileIconView();
89
90 virtual TQWidget *widget() { return this; }
91 virtual void clearView();
92 virtual void setAutoUpdate( bool ) {} // ### unused. remove in KDE4
93
94 virtual void updateView( bool );
95 virtual void updateView(const KFileItem*);
96 virtual void removeItem(const KFileItem*);
97
98 virtual void listingCompleted();
99
100 virtual void insertItem( KFileItem *i );
101 virtual void setSelectionMode( KFile::SelectionMode sm );
102
103 virtual void setSelected(const KFileItem *, bool);
104 virtual bool isSelected(const KFileItem *i) const;
105 virtual void clearSelection();
106 virtual void selectAll();
107 virtual void invertSelection();
108
109 virtual void setCurrentItem( const KFileItem * );
110 virtual KFileItem * currentFileItem() const;
111 virtual KFileItem * firstFileItem() const;
112 virtual KFileItem * nextItem( const KFileItem * ) const;
113 virtual KFileItem * prevItem( const KFileItem * ) const;
114
118 void setIconSize( int size );
119
123 void setPreviewSize( int size );
124
132 void setIgnoreMaximumSize(bool ignoreSize=true);
133
137 int iconSize() const { return myIconSize; }
138
139 void ensureItemVisible( const KFileItem * );
140
141 virtual void setSorting(TQDir::SortSpec sort);
142
143 virtual void readConfig( TDEConfig *, const TQString& group = TQString::null );
144 virtual void writeConfig( TDEConfig *, const TQString& group = TQString::null);
145
146 // for KMimeTypeResolver
147 void mimeTypeDeterminationFinished();
148 void determineIcon( KFileIconViewItem *item );
149 TQScrollView *scrollWidget() const { return (TQScrollView*) this; }
150 void setAcceptDrops(bool b)
151 {
152 TDEIconView::setAcceptDrops(b);
153 viewport()->setAcceptDrops(b);
154 }
155
156public slots:
163 void showPreviews();
164
165 void zoomIn();
166
167 void zoomOut();
168
173 virtual void arrangeItemsInGrid( bool updated = true );
174
175protected:
179 virtual void keyPressEvent( TQKeyEvent * );
180
184 virtual void hideEvent( TQHideEvent * );
185
186 // ### workaround for Qt3 bug (see #35080)
187 virtual void showEvent( TQShowEvent * );
188
189 virtual bool eventFilter( TQObject *o, TQEvent *e );
190
191 // DND support
192 virtual TQDragObject *dragObject();
193 virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
194 virtual void contentsDragMoveEvent( TQDragMoveEvent *e );
195 virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e );
196 virtual void contentsDropEvent( TQDropEvent *ev );
197
198 // KDE4: Make virtual
199 bool acceptDrag(TQDropEvent* e ) const;
200
201private slots:
202 void selected( TQIconViewItem *item );
203 void slotActivate( TQIconViewItem * );
204 void highlighted( TQIconViewItem *item );
205 void showToolTip( TQIconViewItem *item );
206 void removeToolTip();
207 void slotActivateMenu( TQIconViewItem *, const TQPoint& );
208 void slotSelectionChanged();
209
210 void slotSmallColumns();
211 void slotLargeRows();
212 void slotPreviewsToggled( bool );
213
214 void slotPreviewResult( TDEIO::Job * );
215 void gotPreview( const KFileItem *item, const TQPixmap& pix );
216 void slotAutoOpen();
217
218signals:
225 void dropped(TQDropEvent *event, KFileItem *fileItem);
232 void dropped(TQDropEvent *event, const KURL::List &urls, const KURL &url);
233
234private:
235 KMimeTypeResolver<KFileIconViewItem,KFileIconView> *m_resolver;
236
237 TQLabel *toolTip;
238 int th;
239 int myIconSize;
240
241 virtual void insertItem(TQIconViewItem *a, TQIconViewItem *b) { TDEIconView::insertItem(a, b); }
242 virtual void setSelectionMode(TQIconView::SelectionMode m) { TDEIconView::setSelectionMode(m); }
243 virtual void setSelected(TQIconViewItem *i, bool a, bool b) { TDEIconView::setSelected(i, a, b); }
244
245 bool canPreview( const KFileItem * ) const;
246 void stopPreview();
247
248 void updateIcons();
249
250 inline KFileIconViewItem * viewItem( const KFileItem *item ) const {
251 if ( item )
252 return (KFileIconViewItem *) item->extraData( this );
253 return 0L;
254 }
255
256 void initItem(KFileIconViewItem *item, const KFileItem *i,
257 bool updateTextAndPixmap );
258
259protected:
260 virtual void virtual_hook( int id, void* data );
261private:
262 class KFileIconViewPrivate;
263 KFileIconViewPrivate *d;
264};
265
266#endif // TDEFILESIMPLEVIEW_H
KFileIconViewItem
An item for the iconview, that has a reference to its corresponding KFileItem.
Definition: tdefileiconview.h:40
KFileIconViewItem::KFileIconViewItem
KFileIconViewItem(TQIconView *parent, KFileItem *fi)
Definition: tdefileiconview.h:49
KFileIconViewItem::fileInfo
KFileItem * fileInfo() const
Definition: tdefileiconview.h:57
KFileIconView
An icon-view capable of showing KFileItem's.
Definition: tdefileiconview.h:83
KFileIconView::dropped
void dropped(TQDropEvent *event, KFileItem *fileItem)
The user dropped something.
KFileIconView::iconSize
int iconSize() const
Definition: tdefileiconview.h:137
KFileIconView::widget
virtual TQWidget * widget()
a pure virtual function to get a TQWidget, that can be added to other widgets.
Definition: tdefileiconview.h:90
KFileIconView::dropped
void dropped(TQDropEvent *event, const KURL::List &urls, const KURL &url)
The user dropped the URLs urls.
KFileView
This class defines an interface to all file views.
Definition: tdefileview.h:97

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdefile by doxygen 1.9.4
This website is maintained by Timothy Pearson.