kate Library API Documentation

kateprojecttreeview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
00003    Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
00004    Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
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., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef __KATE_PROJECTTREEVIEW_H__
00022 #define __KATE_PROJECTTREEVIEW_H__
00023 
00024 #include "katemain.h"
00025 
00026 #include "../interfaces/project.h"
00027 
00028 #include <klistview.h>
00029 
00030 #include <qvbox.h>
00031 #include <qstringlist.h>
00032 #include <qdict.h>
00033 
00034 class KateProjectTreeView;
00035 
00036 class KateProjectTreeViewItem : public KListViewItem
00037 {
00038   public:
00039     KateProjectTreeViewItem (QDict<KateProjectTreeViewItem> *dict, KateProjectTreeView * parent, Kate::Project *prj, const QString &name, const QString &fullname, bool dir = false);
00040     KateProjectTreeViewItem (QDict<KateProjectTreeViewItem> *dict, KateProjectTreeViewItem * parent, Kate::Project *prj, const QString &name, const QString &fullname, bool dir = false);
00041     ~KateProjectTreeViewItem ();
00042 
00043     void init ();
00044 
00045     bool isDir () { return m_dir; };
00046 
00047     QString name () { return m_name; };
00048 
00049     QString fullName () { return m_fullName; };
00050 
00051     int compare ( QListViewItem *i, int, bool ) const;
00052 
00053   private:
00054     QString m_name;
00055     QString m_fullName;
00056     Kate::Project *m_project;
00057     bool m_dir;
00058     QDict<KateProjectTreeViewItem> *m_dict;
00059 };
00060 
00061 class KateProjectTreeView : public KListView
00062 {
00063   Q_OBJECT
00064 
00065   public:
00066     KateProjectTreeView (Kate::Project *project, class KateMainWindow *mainwin, QWidget *parent);
00067     ~KateProjectTreeView ();
00068 
00069     void addDir (KateProjectTreeViewItem *parent, const QString &dir);
00070 
00071   private slots:
00072     void slotDoubleClicked( QListViewItem *i, const QPoint &pos, int c );
00073 
00074     void dirsAdded (const QString &dir, const QStringList &dirs);
00075     void dirsRemoved (const QString &dir, const QStringList &dirs);
00076 
00077     void filesAdded (const QString &dir, const QStringList &files);
00078     void filesRemoved (const QString &dir, const QStringList &files);
00079 
00080     void slotContextMenuRequested ( QListViewItem * item, const QPoint & pos, int col );
00081 
00082     void removeIt ();
00083     void addIt ();
00084 
00085     // doubleclicked or return pressed
00086     void execute( QListViewItem * );
00087 
00088   private:
00089     Kate::Project *m_project;
00090     class KateMainWindow *m_mainWin;
00091     QDict<KateProjectTreeViewItem> m_dirDict;
00092 };
00093 
00094 class KateProjectTreeViewContainer : public QVBox
00095 {
00096   Q_OBJECT
00097   public:
00098     KateProjectTreeViewContainer( Kate::Project *project, class KateMainWindow *mainwin, QWidget*, const char* name=0 );
00099     ~KateProjectTreeViewContainer();
00100 
00101      KateProjectTreeView * tree();
00102 
00103   protected:
00104     bool eventFilter( QObject *, QEvent * );
00105 
00106   private slots:
00107     void qfTextChanged( const QString & );
00108 
00109   private:
00110     QString oldtext; //??
00111     class KLineEdit *m_leQF;
00112     KateProjectTreeView *m_tree;
00113 };
00114 
00115 #endif
KDE Logo
This file is part of the documentation for kate Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 4 11:21:45 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003