summaryrefslogtreecommitdiff
path: root/include/versetreekey.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/versetreekey.h')
-rw-r--r--include/versetreekey.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/include/versetreekey.h b/include/versetreekey.h
index 574c026..ab1d108 100644
--- a/include/versetreekey.h
+++ b/include/versetreekey.h
@@ -36,16 +36,25 @@ SWORD_NAMESPACE_START
* Class VerseKey
* The SWKey implementation used for verse based modules like Bibles or commentaries.
*/
-class SWDLLEXPORT VerseTreeKey : public VerseKey {
+class SWDLLEXPORT VerseTreeKey : public VerseKey, public TreeKey::PositionChangeListener {
static SWClass classdef;
TreeKey *treeKey;
+// vector<struct sbook> books;
+
+ void init(TreeKey *treeKey);
+ void syncVerseToTree();
+ long lastGoodOffset;
+
+protected:
+ virtual int getBookAbbrev(const char *abbr);
public:
/**
* VerseKey Constructor - initializes Instance of VerseKey
*
+ * @param treeKey a TreeKey which will form the basis of this VerseTreeKey
* @param ikey text key (will take various forms of 'BOOK CH:VS'.
* See parse() for more detailed information)
*/
@@ -54,6 +63,7 @@ public:
/**
* VerseKey Constructor - initializes instance of VerseKey
*
+ * @param treeKey a TreeKey which will form the basis of this VerseTreeKey
* @param ikey base key (will take various forms of 'BOOK CH:VS'.
* See parse() for more detailed information)
*/
@@ -62,6 +72,7 @@ public:
/** VerseKey Constructor - initializes instance of VerseKey
* with boundariess - see also LowerBound()
* and UpperBound()
+ * @param treeKey a TreeKey which will form the basis of this VerseTreeKey
* @param min the lower boundary of the new VerseKey
* @param max the upper boundary of the new VerseKey
*/
@@ -74,6 +85,7 @@ public:
*/
VerseTreeKey(const VerseTreeKey &k);
+
/** VerseKey Destructor
* Cleans up an instance of VerseKey
*/
@@ -86,15 +98,26 @@ public:
virtual bool isTraversable() const { return true; }
- virtual TreeKey *getTreeKey() { return treeKey; }
+ virtual TreeKey *getTreeKey();
+
+ // TreeKey::PositionChangeListener interface
+ virtual void positionChanged();
+ bool internalPosChange;
+
+ virtual void decrement(int steps = 1);
+ virtual void increment(int steps = 1);
+ virtual void Normalize(char autocheck = 0);
+ virtual void setPosition(SW_POSITION newpos);
+ virtual long NewIndex() const;
// OPERATORS --------------------------------------------------------------------
SWKEY_OPERATORS
virtual SWKey & operator = (const VerseKey & ikey) { copyFrom(ikey); return *this; }
+// virtual void copyFrom(const VerseTreeKey &ikey);
};
SWORD_NAMESPACE_END