1/* This file is part of the KDE project
2 Copyright (C) 2005, 2007 Dag Andersen <danders@get2net.dk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20
21#ifndef KPTCONTEXT_H
22#define KPTCONTEXT_H
23
24#include <QDateTime>
25#include <QString>
26#include <QStringList>
27
28#include <KoXmlReader.h>
29
30namespace KPlato
31{
32
33class View;
34
35class Context {
36public:
37 Context();
38 virtual ~Context();
39
40 virtual bool load( const KoXmlDocument &doc );
41 virtual QDomDocument save( const View *view ) const;
42 const KoXmlElement &context() const;
43 bool isLoaded() const { return m_contextLoaded; }
44
45 bool setContent( const QString &str );
46
47 // View
48 QString currentView;
49 int currentEstimateType;
50 long currentSchedule;
51 bool actionViewExpected;
52 bool actionViewOptimistic;
53 bool actionViewPessimistic;
54
55 struct Ganttview {
56 int ganttviewsize;
57 int taskviewsize;
58 QString currentNode;
59 bool showResources;
60 bool showTaskName;
61 bool showTaskLinks;
62 bool showProgress;
63 bool showPositiveFloat;
64 bool showCriticalTasks;
65 bool showCriticalPath;
66 bool showNoInformation;
67 QStringList closedNodes;
68 } ganttview;
69
70 struct Pertview {
71 } pertview;
72
73 struct Resourceview {
74 } resourceview;
75
76 struct Accountsview {
77 int accountsviewsize;
78 int periodviewsize;
79 QDate date;
80 int period;
81 bool cumulative;
82 QStringList closedItems;
83 } accountsview;
84
85 struct Reportview {
86 } reportview;
87
88private:
89 bool m_contextLoaded;
90 KoXmlElement m_context;
91 KoXmlDocument m_document;
92};
93
94} //KPlato namespace
95
96#endif //CONTEXT_H
97