~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to include/treekey.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Glassey
  • Date: 2004-01-15 15:50:07 UTC
  • Revision ID: james.westby@ubuntu.com-20040115155007-n9mz4x0zxrs1isd3
Tags: upstream-1.5.7
ImportĀ upstreamĀ versionĀ 1.5.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 *  versekey.h - code for class 'versekey'- a standard Biblical verse key
 
3
 *
 
4
 * $Id: treekey.h,v 1.4 2002/10/01 19:52:40 dglassey Exp $
 
5
 *
 
6
 * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
 
7
 *      CrossWire Bible Society
 
8
 *      P. O. Box 2528
 
9
 *      Tempe, AZ  85280-2528
 
10
 *
 
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.
 
14
 *
 
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.
 
19
 *
 
20
 */
 
21
 
 
22
 
 
23
#ifndef TREEKEY_H
 
24
#define TREEKEY_H
 
25
 
 
26
#include <swkey.h>
 
27
#include <swmacs.h>
 
28
 
 
29
#include <defs.h>
 
30
 
 
31
SWORD_NAMESPACE_START
 
32
 
 
33
/**
 
34
 * Class VerseKey
 
35
 * The SWKey implementation used for verse based modules like Bibles or commentaries.
 
36
 */
 
37
class SWDLLEXPORT TreeKey : public SWKey {
 
38
        static SWClass classdef;
 
39
        void init();
 
40
 
 
41
public:
 
42
//      TreeKey (const char *ikey = 0);
 
43
//      TreeKey (const SWKey * ikey);
 
44
//      TreeKey (TreeKey const &k);
 
45
        TreeKey () { init(); };
 
46
        ~TreeKey () {};
 
47
 
 
48
 
 
49
        virtual const char *getLocalName() = 0;
 
50
        virtual const char *setLocalName(const char *) = 0;
 
51
 
 
52
        virtual const char *getUserData(int *size = 0) = 0;
 
53
        virtual void setUserData(const char *userData, int size = 0) = 0;
 
54
 
 
55
        virtual const char *getFullName() const = 0;
 
56
 
 
57
        virtual void root() = 0;
 
58
        virtual bool parent() = 0;
 
59
 
 
60
        virtual bool firstChild() = 0;
 
61
        virtual bool nextSibling() = 0;
 
62
        virtual bool previousSibling() = 0;
 
63
 
 
64
        virtual bool hasChildren() = 0;
 
65
 
 
66
        virtual void append() = 0;
 
67
        virtual void appendChild() = 0;
 
68
        virtual void insertBefore() = 0;
 
69
 
 
70
        virtual void remove() = 0;
 
71
 
 
72
        virtual void setOffset(unsigned long offset) = 0;
 
73
        virtual unsigned long getOffset() const = 0;
 
74
 
 
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(); }
 
84
 
 
85
        SWKEY_OPERATORS
 
86
 
 
87
        };
 
88
 
 
89
SWORD_NAMESPACE_END
 
90
#endif