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

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 - 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 KPTREQUESTRESOURCESPANEL_H
00021 #define KPTREQUESTRESOURCESPANEL_H
00022 
00023 #include "ui_kpttaskresourcespanelbase.h"
00024 #include "kptduration.h"
00025 
00026 #include <QTreeWidgetItem>
00027 #include <QString>
00028 #include <QTableWidget>
00029 #include <QList>
00030 
00031 class QTableWidgetItem;
00032 
00033 class KCommand;
00034 class KMacroCommand;
00035 
00036 namespace KPlato
00037 {
00038 
00039 class Account;
00040 class Accounts;
00041 class Task;
00042 class ResourceGroup;
00043 class Resource;
00044 class ResourceGroupRequest;
00045 class ResourceRequest;
00046 class StandardWorktime;
00047 class Part;
00048 class Duration;
00049 
00050 class ResourceTableItem {
00051 public:
00052     ResourceTableItem(Resource *resource, ResourceRequest *request, bool check = false);
00053     ~ResourceTableItem() ;
00054 
00055     void update();
00056     void insert(QTableWidget *table, int row);
00057     void ok(ResourceGroupRequest *group);
00058 
00059     bool isChecked() const { return m_checked; }
00060     bool isOrigChecked() const { return m_origChecked; }
00061     Resource *resource() { return m_resource; }
00062     ResourceRequest *request() { return m_request; }
00063     int numRequests() const { return m_checked ? 1 : 0; }
00064     int units() const { return m_units; }
00065 
00066     Resource *m_resource;
00067     int m_units, m_origUnits;
00068     bool m_checked, m_origChecked;
00069     QTableWidgetItem *m_checkitem;
00070     ResourceRequest *m_request;
00071     int m_curAccountItem;
00072     QString m_curAccountText;
00073 };
00074 
00075 class GroupLVItem : public QTreeWidgetItem {
00076 public:
00077     GroupLVItem(QTreeWidget *parent, ResourceGroup *group, Task &task);
00078     ~GroupLVItem();
00079 
00080     void update();
00081     void insert(QTableWidget *table);
00082     const QList<ResourceTableItem*> &resources() const { return m_resources; }
00083     void ok(Task &task);
00084 
00085     int numRequests();
00086     bool isNull() const;
00087     
00088     ResourceGroup *m_group;
00089     int m_units;
00090     QList<ResourceTableItem*> m_resources;
00091     ResourceGroupRequest *m_request;
00092 };
00093 
00094 class TaskResourcesPanelBase : public QWidget, public Ui::TaskResourcesPanelBase
00095 {
00096 public:
00097   TaskResourcesPanelBase( QWidget *parent ) : QWidget( parent ) {
00098     setupUi( this );
00099   }
00100 };
00101 
00102 class RequestResourcesPanel : public TaskResourcesPanelBase {
00103     Q_OBJECT
00104 public:
00105     RequestResourcesPanel(QWidget *parent, Task &task, bool baseline=false);
00106 
00107     KCommand *buildCommand(Part *part);
00108     
00109     bool ok();
00110     
00111 private slots:
00112     void sendChanged();
00113 
00114     void groupChanged(QTreeWidgetItem *item);
00115     void groupChanged();
00116     void resourceChanged(int, int);
00117     void unitsChanged(int);
00118     
00119 signals:
00120     void changed();
00121 
00122 private:
00123     Task &m_task;
00124     StandardWorktime *m_worktime;
00125     GroupLVItem *selectedGroup;
00126     bool m_blockChanged;
00127     
00128 };
00129 
00130 }  //KPlato namespace
00131 
00132 #endif

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