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

tdeio/tdefile

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

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.8.13
This website is maintained by Timothy Pearson.