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

tdeio/tdefile

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

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.