• 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 <tqt.h>
24 
25 #include <kiconview.h>
26 #include <kiconloader.h>
27 #include <tdefileview.h>
28 #include <kmimetyperesolver.h>
29 #include <tdefile.h>
30 
31 class KFileItem;
32 class TQWidget;
33 class TQLabel;
34 
39 class TDEIO_EXPORT KFileIconViewItem : public TDEIconViewItem
40 {
41 public:
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 
61 private:
62  KFileItem *inf;
63 
64 private:
65  class KFileIconViewItemPrivate;
66  KFileIconViewItemPrivate *d;
67 
68 };
69 
70 namespace TDEIO {
71  class Job;
72 }
73 
82 class TDEIO_EXPORT KFileIconView : public TDEIconView, public KFileView
83 {
84  Q_OBJECT
85 
86 public:
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 
156 public slots:
163  void showPreviews();
164 
165  void zoomIn();
166 
167  void zoomOut();
168 
173  virtual void arrangeItemsInGrid( bool updated = true );
174 
175 protected:
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 
201 private 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 
218 signals:
225  void dropped(TQDropEvent *event, KFileItem *fileItem);
232  void dropped(TQDropEvent *event, const KURL::List &urls, const KURL &url);
233 
234 private:
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 
259 protected:
260  virtual void virtual_hook( int id, void* data );
261 private:
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:39
KFileView::setCurrentItem
void setCurrentItem(const TQString &filename)
Sets filename the current item in the view, if available.
Definition: tdefileview.cpp:268
KFileIconView::widget
virtual TQWidget * widget()
a pure virtual function to get a TQWidget, that can be added to other widgets.
Definition: tdefileiconview.h:90
KFileIconViewItem::KFileIconViewItem
KFileIconViewItem(TQIconView *parent, KFileItem *fi)
Definition: tdefileiconview.h:49
KFileView::insertItem
virtual void insertItem(KFileItem *i)
The derived view must implement this function to add the file in the widget.
Definition: tdefileview.cpp:147
TDEIO
Definition: kimagefilepreview.h:26
KFileView
This class defines an interface to all file views.
Definition: tdefileview.h:97
KFileView::clearSelection
virtual void clearSelection()=0
Clears any selection, unhighlights everything.
KFileView::selectAll
virtual void selectAll()
Selects all items.
Definition: tdefileview.cpp:312
KFileView::currentFileItem
virtual KFileItem * currentFileItem() const =0
KFileView::setSelected
virtual void setSelected(const KFileItem *, bool enable)=0
Tells the view that it should highlight the item.
KFileIconView::iconSize
int iconSize() const
Definition: tdefileiconview.h:137
KFileView::isSelected
virtual bool isSelected(const KFileItem *) const =0
KFileView::removeItem
virtual void removeItem(const KFileItem *item)
Removes an item from the list; has to be implemented by the view.
Definition: tdefileview.cpp:346
KFileView::invertSelection
virtual void invertSelection()
Inverts the current selection, i.e.
Definition: tdefileview.cpp:323
KFileIconViewItem::fileInfo
KFileItem * fileInfo() const
Definition: tdefileiconview.h:57
KFileView::setSorting
virtual void setSorting(TQDir::SortSpec sort)
Sets the sorting order of the view.
Definition: tdefileview.cpp:151
KFileView::updateView
virtual void updateView(bool f=true)
does a repaint of the view.
Definition: tdefileview.cpp:259
KFileView::ensureItemVisible
virtual void ensureItemVisible(const KFileItem *i)=0
pure virtual function, that should be implemented to make item i visible, i.e.
KFileView::clearView
virtual void clearView()=0
pure virtual function, that should be implemented to clear the view.
KFileIconView
An icon-view capable of showing KFileItem's.
Definition: tdefileiconview.h:82
KFileView::listingCompleted
virtual void listingCompleted()
This hook is called when all items of the currently listed directory are listed and inserted into the...
Definition: tdefileview.cpp:360

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdefile by doxygen 1.8.8
This website is maintained by Timothy Pearson.