KDevelop API Documentation

kapplicationtree.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2000 David Faure <faure@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017     Boston, MA 02111-1307, USA.
00018 */
00019 #ifndef __KDevApplicationTree_h__
00020 #define __KDevApplicationTree_h__
00021 
00022 #include <kurl.h>
00023 #include <klistview.h>
00024 
00025 class KURLRequester;
00026 
00027 class QWidget;
00028 class QCheckBox;
00029 class QPushButton;
00030 class QLabel;
00031 class QStringList;
00032 
00033 
00034 /* ------------------------------------------------------------------------- */
00035 
00039 class KDevAppTreeListItem : public QListViewItem
00040 {
00041     bool parsed;
00042     bool directory;
00043     QString path;
00044     QString exec;
00045     QString dEntry;
00046 
00047 protected:
00048     QString key(int column, bool ascending) const;
00049 
00050     void init(const QPixmap& pixmap, bool parse, bool dir, const QString& _path, const QString& _exec, const QString& _dEntry);
00051 
00052 public:
00053     KDevAppTreeListItem( KListView* parent, const QString & name, const QPixmap& pixmap,
00054                       bool parse, bool dir, const QString& p, const QString& c, const QString& dE );
00055     KDevAppTreeListItem( QListViewItem* parent, const QString & name, const QPixmap& pixmap,
00056                       bool parse, bool dir, const QString& p, const QString& c, const QString& dE );
00057     bool isDirectory();
00058 
00059     QString desktopEntryPath() const { return dEntry; }
00060     QString executable() const { return exec; }
00061 
00062 protected:
00063     virtual void activate();
00064     virtual void setOpen( bool o );
00065 
00066     friend class KDevApplicationTree;
00067 };
00068 
00069 /* ------------------------------------------------------------------------- */
00070 
00074 class KDevApplicationTree : public KListView
00075 {
00076     Q_OBJECT
00077 public:
00078     KDevApplicationTree( QWidget *parent, const char* name = 0 );
00079 
00083     void addDesktopGroup( QString relPath, KDevAppTreeListItem *item = 0 );
00084 
00085     bool isDirSel();
00086 
00087 protected:
00088     void resizeEvent( QResizeEvent *_ev );
00089     KDevAppTreeListItem* currentitem;
00090 
00091 public slots:
00092     void slotItemHighlighted(QListViewItem* i);
00093     void slotSelectionChanged(QListViewItem* i);
00094 
00095 signals:
00096     void selected( const QString& _name, const QString& _exec );
00097     void highlighted( const QString& _name, const  QString& _exec );
00098 };
00099 
00100 /* ------------------------------------------------------------------------- */
00101 
00102 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:58 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003