F:/KPlato/koffice/kplato/kptwbsdefinitionpanel.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 Dag Andersen <danders@get2net.dk>
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;
00007    version 2 of the License.
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 KPTWBSDEFINITIONPANEL_H
00021 #define KPTWBSDEFINITIONPANEL_H
00022 
00023 #include "ui_kptwbsdefinitionpanelbase.h"
00024 
00025 #include <QItemDelegate>
00026 #include <QWidget>
00027 
00028 class KMacroCommand;
00029 
00030 namespace KPlato
00031 {
00032 
00033 class Part;
00034 class WBSDefinition;
00035 
00036 class ComboBoxDelegate : public QItemDelegate
00037 {
00038     Q_OBJECT
00039 public:
00040     ComboBoxDelegate(QStringList &list, QObject *parent = 0);
00041 
00042     QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
00043                             const QModelIndex &index) const;
00044 
00045     void setEditorData(QWidget *editor, const QModelIndex &index) const;
00046     void setModelData(QWidget *editor, QAbstractItemModel *model,
00047                         const QModelIndex &index) const;
00048 
00049     void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00050 private:
00051     QStringList m_list;
00052 };
00053 
00054 //---------------
00055 class WBSDefinitionPanel : public QWidget, public Ui_WBSDefinitionPanelBase {
00056     Q_OBJECT
00057 public:
00058     WBSDefinitionPanel(WBSDefinition &def, QWidget *parent=0, const char *name=0);
00059 
00060     KMacroCommand *buildCommand(Part *part);
00061 
00062     bool ok();
00063 
00064     void setStartValues(Part *part);
00065 
00066 signals:
00067     void changed(bool enable);
00068     
00069 protected slots:
00070     void slotChanged();
00071     void slotSelectionChanged();
00072     void slotRemoveBtnClicked();
00073     void slotAddBtnClicked();
00074     void slotLevelChanged(int);
00075     void slotLevelsGroupToggled(bool on);
00076 private:
00077     int selectedRow;
00078     WBSDefinition &m_def;
00079 };
00080 
00081 } //KPlato namespace
00082 
00083 #endif // WBSDEFINITIONPANEL_H

Généré le Wed Nov 22 23:40:58 2006 pour KPlato par  doxygen 1.5.1-p1