summaryrefslogtreecommitdiffstats
path: root/part/dcopiface_part_ro.h
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-03-26 13:50:43 +0100
committerSlávek Banko <slavek.banko@axis.cz>2016-03-26 13:50:43 +0100
commitd62c8c002c51fb7c36487839eeeb4ac89f044dee (patch)
treebb4d1f5c631ab1f22a3018ba39e6a806035f80fd /part/dcopiface_part_ro.h
downloadkxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.tar.gz
kxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.zip
Initial import of kxmleditor 1.1.4
Diffstat (limited to 'part/dcopiface_part_ro.h')
-rw-r--r--part/dcopiface_part_ro.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/part/dcopiface_part_ro.h b/part/dcopiface_part_ro.h
new file mode 100644
index 0000000..90f5982
--- /dev/null
+++ b/part/dcopiface_part_ro.h
@@ -0,0 +1,124 @@
+/***************************************************************************
+ dcopiface_part_ro.h - description
+ -------------------
+ begin : Tue Oct 23 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef DCOPIFACE_PART_RO_H
+#define DCOPIFACE_PART_RO_H
+
+#include <dcopobject.h>
+
+
+class KXMLEditorPart;
+ /**
+ * Allows perform action on represetntaion of XML file via DCOP protocol.
+ * behavies as interface to @ref KXMLEditorPart and to it adresses most of requestests received by DCOP
+ *
+ *@see KXMLEditorPart
+ *
+ *@short Read only DCOP interface for XML document Kpart based kxmleditor.
+ *
+ *@author The KXMLEditor Team (matkor@users.sourceforge.net)
+ **/
+
+class KXMLEditorPartIfaceReadOnly
+ :virtual public DCOPObject
+{
+ K_DCOP
+
+protected:
+ /** @ref KXMLEditorPart which Iface represensts **/
+ KXMLEditorPart * m_pKXEPart;
+
+public:
+ /**
+ * Default constructor
+ *
+ * @param kxe_part Specifies on what @ref KXMLEditorPart will interface operate.
+ **/
+ KXMLEditorPartIfaceReadOnly(KXMLEditorPart * kxe_part,const char * dcop_name = "KXMLEditorPartIface")
+ : DCOPObject(dcop_name)
+ {
+ m_pKXEPart = kxe_part;
+ }
+ virtual ~KXMLEditorPartIfaceReadOnly()
+ {};
+k_dcop:
+ /**
+ * Saves document as file
+ *
+ * @returns Error description or empty string if file succesfully saved.
+ **/
+
+ QString saveAsFile(const QString & path_to_file);
+
+ /** Tries to change current node
+ * @param pathToNode Path to new node
+ * @returns Empty string if selection OK otherwise error description
+ **/
+ QString selectNode(const QString & pathToNode);
+
+ /** Returns path to current node
+ * @returns If error empty string
+ **/
+ QString currentNode() const;
+
+};
+
+
+
+ /**
+ *@short Read/Write DCOP inteface for Kpart based kxmleditor.
+ *@author The KXMLEditor Team
+ **/
+//
+class KXMLEditorPartIfaceReadWrite
+ :public KXMLEditorPartIfaceReadOnly
+{
+ K_DCOP
+ /**
+ * Default constructor
+ *
+ * @param kxe_part Specifies on what @ref KXMLEditorPart will interface operate.
+ **/
+public:
+ KXMLEditorPartIfaceReadWrite(KXMLEditorPart * kxe_part,const char * dcop_name = "KXMLEditorPartIface")
+ : DCOPObject(dcop_name)
+ ,KXMLEditorPartIfaceReadOnly(kxe_part,dcop_name)
+ {}
+ virtual ~KXMLEditorPartIfaceReadWrite()
+ {};
+k_dcop:
+
+ /**
+ * Opens given file
+ *
+ * @returns Error description or empty string if file succesfully loaded.
+ **/
+ QString openURL(const QString & szURL);
+
+ /**
+ * Closes object behind interface.
+ * In curent implementation it means closing entire KXMLEditor.
+ *
+ * @returns Error description or empty string if program closed.
+ **/
+ QString close();
+
+
+};
+
+
+#endif // DCOPIFACE_PART_RO_H