summaryrefslogtreecommitdiffstats
path: root/bibletime/backend/cswordtreekey.h
diff options
context:
space:
mode:
Diffstat (limited to 'bibletime/backend/cswordtreekey.h')
-rw-r--r--bibletime/backend/cswordtreekey.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/bibletime/backend/cswordtreekey.h b/bibletime/backend/cswordtreekey.h
new file mode 100644
index 0000000..7ba563d
--- /dev/null
+++ b/bibletime/backend/cswordtreekey.h
@@ -0,0 +1,74 @@
+/*********
+*
+* This file is part of BibleTime's source code, http://www.bibletime.info/.
+*
+* Copyright 1999-2007 by the BibleTime developers.
+* The BibleTime source code is licensed under the GNU General Public License version 2.0.
+*
+**********/
+
+
+
+#ifndef CSWORDTREEKEYIDX_H
+#define CSWORDTREEKEYIDX_H
+
+//BibleTime includes
+#include "cswordkey.h"
+
+//Sword includes
+#include <treekeyidx.h>
+
+class CSwordModuleInfo;
+
+/** BibleTime's implementation of Sword's TreeKeyIdx class.
+ * @short CSwordKey implementation for Sword's TreeKey
+ * @author The BibleTime team
+ */
+
+class CSwordTreeKey : public CSwordKey, public sword::TreeKeyIdx {
+
+public:
+ /** Constructor of this CSwordKey implementation.
+ * @param k The Sword tree key which belongs to this key
+ * @param module The module which belongs to this key
+ */
+ CSwordTreeKey( const sword::TreeKeyIdx *k, CSwordModuleInfo* module );
+ /** Copy constructor.
+ */
+ CSwordTreeKey( const CSwordTreeKey& k );
+ /** The module which belongs to this key.
+ * @return The module.
+ */
+ virtual CSwordModuleInfo* const module( CSwordModuleInfo* const newModule );
+ /** Copy method.
+ * @return A new copy of this object.
+ */
+ virtual CSwordTreeKey* copy() const;
+ /**
+ * Returns the last part of the current key as unicode decoded QString.
+ * Use this instead of TreeKeyIdx::getLocalName() to avoid encoding problems.
+ */
+ virtual const QString getLocalNameUnicode() const;
+ /**
+ * Returns the current key
+ */
+ virtual const QString key() const;
+ /**
+ * Set the key. If the parameter is empty or null, the key will be set to "/"
+ */
+ virtual const bool key( const QString& key );
+ /**
+ * Set/get the key. If the parameter is not set (means equal to QString::null)
+ * the used key is returned. Otherwise the key is set and the new on ei returned.
+ */
+ virtual const bool key( const char* key );
+ /**
+ * Assignment operator.
+ */
+ virtual CSwordTreeKey& operator = (const QString& keyname );
+protected:
+ /**Get the unencoded key for use by Sword.*/
+ virtual const char * rawKey() const;
+};
+
+#endif