1
/******************************************************************************
2
* versekey.h - code for class 'versekey'- a standard Biblical verse key
4
* $Id: treekey.h,v 1.4 2002/10/01 19:52:40 dglassey Exp $
6
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
7
* CrossWire Bible Society
11
* This program is free software; you can redistribute it and/or modify it
12
* under the terms of the GNU General Public License as published by the
13
* Free Software Foundation version 2.
15
* This program is distributed in the hope that it will be useful, but
16
* WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
* General Public License for more details.
35
* The SWKey implementation used for verse based modules like Bibles or commentaries.
37
class SWDLLEXPORT TreeKey : public SWKey {
38
static SWClass classdef;
42
// TreeKey (const char *ikey = 0);
43
// TreeKey (const SWKey * ikey);
44
// TreeKey (TreeKey const &k);
45
TreeKey () { init(); };
49
virtual const char *getLocalName() = 0;
50
virtual const char *setLocalName(const char *) = 0;
52
virtual const char *getUserData(int *size = 0) = 0;
53
virtual void setUserData(const char *userData, int size = 0) = 0;
55
virtual const char *getFullName() const = 0;
57
virtual void root() = 0;
58
virtual bool parent() = 0;
60
virtual bool firstChild() = 0;
61
virtual bool nextSibling() = 0;
62
virtual bool previousSibling() = 0;
64
virtual bool hasChildren() = 0;
66
virtual void append() = 0;
67
virtual void appendChild() = 0;
68
virtual void insertBefore() = 0;
70
virtual void remove() = 0;
72
virtual void setOffset(unsigned long offset) = 0;
73
virtual unsigned long getOffset() const = 0;
75
virtual void setText(const char *ikey) = 0;
76
virtual void setPosition(SW_POSITION p) = 0;
77
virtual const char *getText() const = 0;
78
virtual int compare(const SWKey &ikey) = 0;
79
virtual void decrement(int steps = 1) = 0;
80
virtual void increment(int steps = 1) = 0;
81
virtual char Traversable () { return 1; }
82
virtual long Index () const { return getOffset(); }
83
virtual long Index (long iindex) { setOffset(iindex); return getOffset(); }