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

tdeio/tdefile

tdefiledetailview.h
00001 // -*- c++ -*-
00002 /* This file is part of the KDE libraries
00003     Copyright (C) 1997 Stephan Kulow <coolo@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef TDEFILEDETAILVIEW_H
00022 #define TDEFILEDETAILVIEW_H
00023 
00024 class KFileItem;
00025 class TQWidget;
00026 class TQKeyEvent;
00027 
00028 #include <tdelistview.h>
00029 #include <kmimetyperesolver.h>
00030 
00031 #include "tdefileview.h"
00032 
00037 class TDEIO_EXPORT KFileListViewItem : public TDEListViewItem
00038 {
00039 public:
00040     KFileListViewItem( TQListView *parent, const TQString &text,
00041                const TQPixmap &icon, KFileItem *fi )
00042     : TDEListViewItem( parent, text ), inf( fi ) {
00043         setPixmap( 0, icon );
00044         setText( 0, text );
00045     }
00046 
00050     KFileListViewItem( TQListView *parent, KFileItem *fi )
00051         : TDEListViewItem( parent ), inf( fi ) {
00052         init();
00053     }
00054 
00055     KFileListViewItem( TQListView *parent, const TQString &text,
00056                const TQPixmap &icon, KFileItem *fi,
00057                TQListViewItem *after)
00058     : TDEListViewItem( parent, after ), inf( fi ) {
00059         setPixmap( 0, icon );
00060         setText( 0, text );
00061     }
00062     ~KFileListViewItem() {
00063         inf->removeExtraData( listView() );
00064     }
00065 
00069     KFileItem *fileInfo() const {
00070     return inf;
00071     }
00072 
00073     virtual TQString key( int /*column*/, bool /*ascending*/ ) const {
00074         return m_key;
00075     }
00076 
00077     void setKey( const TQString& key ) { m_key = key; }
00078 
00079     TQRect rect() const
00080     {
00081         TQRect r = listView()->itemRect(this);
00082         return TQRect( listView()->viewportToContents( r.topLeft() ),
00083                       TQSize( r.width(), r.height() ) );
00084     }
00085 
00089     void init();
00090 
00091 private:
00092     KFileItem *inf;
00093     TQString m_key;
00094 
00095 private:
00096     class KFileListViewItemPrivate;
00097     KFileListViewItemPrivate *d;
00098 
00099 };
00100 
00109 class TDEIO_EXPORT KFileDetailView : public TDEListView, public KFileView
00110 {
00111     Q_OBJECT
00112 
00113 public:
00114     KFileDetailView(TQWidget *parent, const char *name);
00115     virtual ~KFileDetailView();
00116 
00117     virtual TQWidget *widget() { return this; }
00118     virtual void clearView();
00119     virtual void setAutoUpdate( bool ) {} // ### unused. remove in KDE4
00120 
00121     virtual void setSelectionMode( KFile::SelectionMode sm );
00122 
00123     virtual void updateView( bool );
00124     virtual void updateView(const KFileItem*);
00125     virtual void removeItem( const KFileItem *);
00126     virtual void listingCompleted();
00127 
00128     virtual void setSelected(const KFileItem *, bool);
00129     virtual bool isSelected(const KFileItem *i) const;
00130     virtual void clearSelection();
00131     virtual void selectAll();
00132     virtual void invertSelection();
00133 
00134     virtual void setCurrentItem( const KFileItem * );
00135     virtual KFileItem * currentFileItem() const;
00136     virtual KFileItem * firstFileItem() const;
00137     virtual KFileItem * nextItem( const KFileItem * ) const;
00138     virtual KFileItem * prevItem( const KFileItem * ) const;
00139 
00140     virtual void insertItem( KFileItem *i );
00141 
00142     // implemented to get noticed about sorting changes (for sortingIndicator)
00143     virtual void setSorting( TQDir::SortSpec );
00144 
00145     void ensureItemVisible( const KFileItem * );
00146 
00147     // for KMimeTypeResolver
00148     void mimeTypeDeterminationFinished();
00149     void determineIcon( KFileListViewItem *item );
00150     TQScrollView *scrollWidget() const { return (TQScrollView*) this; }
00151 
00152     virtual void readConfig( TDEConfig *, const TQString& group = TQString::null );
00153     virtual void writeConfig( TDEConfig *, const TQString& group = TQString::null);
00154 
00155 signals:
00162     void dropped(TQDropEvent *event, KFileItem *fileItem);
00169     void dropped(TQDropEvent *event, const KURL::List &urls, const KURL &url);
00170 
00171 protected:
00172     virtual void keyPressEvent( TQKeyEvent * );
00173 
00174     // DND support
00175     virtual TQDragObject *dragObject();
00176     virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
00177     virtual void contentsDragMoveEvent( TQDragMoveEvent *e );
00178     virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e );
00179     virtual void contentsDropEvent( TQDropEvent *ev );
00180     virtual bool acceptDrag(TQDropEvent* e ) const;
00181 
00182     int m_sortingCol;
00183 
00184 protected slots:
00185     void slotSelectionChanged();
00186 
00187 private slots:
00188     void slotSortingChanged( int );
00189     void selected( TQListViewItem *item );
00190     void slotActivate( TQListViewItem *item );
00191     void highlighted( TQListViewItem *item );
00192     void slotActivateMenu ( TQListViewItem *item, const TQPoint& pos );
00193     void slotAutoOpen();
00194 
00195 private:
00196     virtual void insertItem(TQListViewItem *i) { TDEListView::insertItem(i); }
00197     virtual void setSorting(int i, bool b) { TDEListView::setSorting(i, b); }
00198     virtual void setSelected(TQListViewItem *i, bool b) { TDEListView::setSelected(i, b); }
00199 
00200     inline KFileListViewItem * viewItem( const KFileItem *item ) const {
00201         if ( item )
00202             return (KFileListViewItem *) item->extraData( this );
00203         return 0L;
00204     }
00205 
00206     void setSortingKey( KFileListViewItem *item, const KFileItem *i );
00207 
00208 
00209     bool m_blockSortingSignal;
00210     KMimeTypeResolver<KFileListViewItem,KFileDetailView> *m_resolver;
00211 
00212 protected:
00213     virtual void virtual_hook( int id, void* data );
00214 private:
00215     class KFileDetailViewPrivate;
00216     KFileDetailViewPrivate *d;
00217 };
00218 
00219 #endif // TDEFILEDETAILVIEW_H

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