kplato

kptresourcespanel.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Thomas Zander <zander@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., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KPTPRESOURCESPANEL_H
00021 #define KPTPRESOURCESPANEL_H
00022 
00023 #include "kptresource.h"
00024 #include "resourcespanelbase.h"
00025 
00026 #include <qlistbox.h>
00027 #include <qstring.h>
00028 
00029 class QListViewItem;
00030 class KCommand;
00031 
00032 namespace KPlato
00033 {
00034 
00035 class Project;
00036 class GroupItem;
00037 class ResourcesPanelResourceItem;
00038 class ResourcesPanelGroupLVItem;
00039 class Part;
00040 
00041 class ResourcesPanel : public ResourcesPanelBase {
00042     Q_OBJECT
00043 public:
00044     ResourcesPanel (QWidget *parent, Project *project);
00045     
00046     bool ok();
00047     KCommand *buildCommand(Part *part);
00048 
00049     void sendChanged();
00050 
00051     void renameStopped(QListViewItem* item);
00052     
00053 protected slots:
00054     void slotAddGroup();
00055     void slotDeleteGroup();
00056 
00057     void slotAddResource();
00058     void slotEditResource();
00059     void slotDeleteResource();
00060 
00061     void slotGroupChanged(QListViewItem *item);
00062     void slotGroupChanged();
00063     void slotResourceRename(const QString &newName);
00064     void slotResourceChanged( QListBoxItem*);
00065     void slotCurrentChanged( QListBoxItem*);
00066 
00067     void slotListDoubleClicked(QListViewItem*, const QPoint&, int);
00068     void slotItemRenamed(QListViewItem *item, int col);
00069     void slotRenameStarted(QListViewItem *item, int col);
00070     void slotStartRename(QListViewItem *item, int col);
00071 signals:
00072     void changed();
00073     void selectionChanged();
00074     void startRename(QListViewItem *item, int col);
00075     void renameStarted(QListViewItem *item, int col);
00076     
00077 private:
00078     Project *project;
00079     ResourcesPanelGroupLVItem *m_groupItem;
00080 
00081     QPtrList<GroupItem> m_groupItems;
00082     QPtrList<GroupItem> m_deletedGroupItems;
00083 
00084     bool m_blockResourceRename;
00085     QListViewItem *m_renameItem;
00086 };
00087 
00088 } //KPlato namespace
00089 
00090 #endif // PRESOURCESPANEL_H
KDE Home | KDE Accessibility Home | Description of Access Keys