summaryrefslogtreecommitdiffstats
path: root/karm/plannerparser.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /karm/plannerparser.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'karm/plannerparser.h')
-rw-r--r--karm/plannerparser.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/karm/plannerparser.h b/karm/plannerparser.h
new file mode 100644
index 00000000..a626d6f0
--- /dev/null
+++ b/karm/plannerparser.h
@@ -0,0 +1,62 @@
+//
+// C++ Interface: plannerparser
+//
+// Description:
+//
+//
+// Author: Thorsten Staerk <Thorsten@Staerk.de>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef PLANNERPARSER_H
+#define PLANNERPARSER_H
+
+/**
+this class is here to import tasks from a planner project file to karm.
+the import shall not be limited to karm (kPlaTo sends greetings)
+it imports planner's top-level-tasks on the same level-depth as current_item.
+if there is no current_item, planner's top-level-tasks will become top-level-tasks in karm.
+it imports as well the level-depth of each task, as its name, as its percent-complete.
+test cases:
+ - deleting all tasks away, then import!
+ - having started with an empty ics, import!
+ - with current_item being a top-level-task, import!
+ - with current_item being a subtask, import!
+
+@author Thorsten Staerk
+*/
+
+#include <qxml.h>
+#include <klocale.h>
+#include "taskview.h"
+#include "task.h"
+#include "karmstorage.h"
+#include "kapplication.h"
+
+class PlannerParser : public QXmlDefaultHandler
+{
+public:
+
+ /** Stores the active TaskView in this parser. Returns error code (not always, hopefully) */
+ PlannerParser(TaskView * tv);
+
+ /** given by the framework from qxml. Called when parsing the xml-document starts. */
+ bool startDocument();
+
+ /** given by the framework from qxml. Called when the reader occurs an open tag (e.g. \<b\> ) */
+ bool startElement( const QString&, const QString&, const QString& qName, const QXmlAttributes& att );
+
+ /** given by the framework from qxml. Called when the reader occurs a closed tag (e.g. \</b\> )*/
+ bool endElement( const QString&, const QString&, const QString& qName);
+
+private:
+ bool withInTasks; // within <tasks> ?
+ TaskView *_taskView;
+ Task *task;
+ Task *parentTask;
+ int level; // level=1: task is top-level-task
+};
+
+
+#endif