• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/kfile
 

kio/kfile

  • kio
  • kfile
kfiledetailview.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 KFILEDETAILVIEW_H
22 #define KFILEDETAILVIEW_H
23 
24 class KFileItem;
25 class TQWidget;
26 class TQKeyEvent;
27 
28 #include <klistview.h>
29 #include <kmimetyperesolver.h>
30 
31 #include "kfileview.h"
32 
37 class KIO_EXPORT KFileListViewItem : public KListViewItem
38 {
39 public:
40  KFileListViewItem( TQListView *parent, const TQString &text,
41  const TQPixmap &icon, KFileItem *fi )
42  : KListViewItem( parent, text ), inf( fi ) {
43  setPixmap( 0, icon );
44  setText( 0, text );
45  }
46 
50  KFileListViewItem( TQListView *parent, KFileItem *fi )
51  : KListViewItem( parent ), inf( fi ) {
52  init();
53  }
54 
55  KFileListViewItem( TQListView *parent, const TQString &text,
56  const TQPixmap &icon, KFileItem *fi,
57  TQListViewItem *after)
58  : KListViewItem( parent, after ), inf( fi ) {
59  setPixmap( 0, icon );
60  setText( 0, text );
61  }
62  ~KFileListViewItem() {
63  inf->removeExtraData( listView() );
64  }
65 
69  KFileItem *fileInfo() const {
70  return inf;
71  }
72 
73  virtual TQString key( int /*column*/, bool /*ascending*/ ) const {
74  return m_key;
75  }
76 
77  void setKey( const TQString& key ) { m_key = key; }
78 
79  TQRect rect() const
80  {
81  TQRect r = listView()->itemRect(this);
82  return TQRect( listView()->viewportToContents( r.topLeft() ),
83  TQSize( r.width(), r.height() ) );
84  }
85 
89  void init();
90 
91 private:
92  KFileItem *inf;
93  TQString m_key;
94 
95 private:
96  class KFileListViewItemPrivate;
97  KFileListViewItemPrivate *d;
98 
99 };
100 
109 class KIO_EXPORT KFileDetailView : public KListView, public KFileView
110 {
111  Q_OBJECT
112 
113 public:
114  KFileDetailView(TQWidget *parent, const char *name);
115  virtual ~KFileDetailView();
116 
117  virtual TQWidget *widget() { return this; }
118  virtual void clearView();
119  virtual void setAutoUpdate( bool ) {} // ### unused. remove in KDE4
120 
121  virtual void setSelectionMode( KFile::SelectionMode sm );
122 
123  virtual void updateView( bool );
124  virtual void updateView(const KFileItem*);
125  virtual void removeItem( const KFileItem *);
126  virtual void listingCompleted();
127 
128  virtual void setSelected(const KFileItem *, bool);
129  virtual bool isSelected(const KFileItem *i) const;
130  virtual void clearSelection();
131  virtual void selectAll();
132  virtual void invertSelection();
133 
134  virtual void setCurrentItem( const KFileItem * );
135  virtual KFileItem * currentFileItem() const;
136  virtual KFileItem * firstFileItem() const;
137  virtual KFileItem * nextItem( const KFileItem * ) const;
138  virtual KFileItem * prevItem( const KFileItem * ) const;
139 
140  virtual void insertItem( KFileItem *i );
141 
142  // implemented to get noticed about sorting changes (for sortingIndicator)
143  virtual void setSorting( TQDir::SortSpec );
144 
145  void ensureItemVisible( const KFileItem * );
146 
147  // for KMimeTypeResolver
148  void mimeTypeDeterminationFinished();
149  void determineIcon( KFileListViewItem *item );
150  TQScrollView *scrollWidget() const { return (TQScrollView*) this; }
151 
152  virtual void readConfig( KConfig *, const TQString& group = TQString::null );
153  virtual void writeConfig( KConfig *, const TQString& group = TQString::null);
154 
155 signals:
162  void dropped(TQDropEvent *event, KFileItem *fileItem);
169  void dropped(TQDropEvent *event, const KURL::List &urls, const KURL &url);
170 
171 protected:
172  virtual void keyPressEvent( TQKeyEvent * );
173 
174  // DND support
175  virtual TQDragObject *dragObject();
176  virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
177  virtual void contentsDragMoveEvent( TQDragMoveEvent *e );
178  virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e );
179  virtual void contentsDropEvent( TQDropEvent *ev );
180  virtual bool acceptDrag(TQDropEvent* e ) const;
181 
182  int m_sortingCol;
183 
184 protected slots:
185  void slotSelectionChanged();
186 
187 private slots:
188  void slotSortingChanged( int );
189  void selected( TQListViewItem *item );
190  void slotActivate( TQListViewItem *item );
191  void highlighted( TQListViewItem *item );
192  void slotActivateMenu ( TQListViewItem *item, const TQPoint& pos );
193  void slotAutoOpen();
194 
195 private:
196  virtual void insertItem(TQListViewItem *i) { KListView::insertItem(i); }
197  virtual void setSorting(int i, bool b) { KListView::setSorting(i, b); }
198  virtual void setSelected(TQListViewItem *i, bool b) { KListView::setSelected(i, b); }
199 
200  inline KFileListViewItem * viewItem( const KFileItem *item ) const {
201  if ( item )
202  return (KFileListViewItem *) item->extraData( this );
203  return 0L;
204  }
205 
206  void setSortingKey( KFileListViewItem *item, const KFileItem *i );
207 
208 
209  bool m_blockSortingSignal;
210  KMimeTypeResolver<KFileListViewItem,KFileDetailView> *m_resolver;
211 
212 protected:
213  virtual void virtual_hook( int id, void* data );
214 private:
215  class KFileDetailViewPrivate;
216  KFileDetailViewPrivate *d;
217 };
218 
219 #endif // KFILEDETAILVIEW_H

kio/kfile

Skip menu "kio/kfile"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kio/kfile

Skip menu "kio/kfile"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kfile by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |