00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef TREEKEY_H
00024 #define TREEKEY_H
00025
00026 #include <swkey.h>
00027 #include <swbuf.h>
00028
00029 #include <defs.h>
00030
00031 SWORD_NAMESPACE_START
00032
00037 class SWDLLEXPORT TreeKey : public SWKey {
00038 static SWClass classdef;
00039 void init();
00040
00041 protected:
00042
00043
00044
00045 mutable SWBuf unsnappedKeyText;
00046
00047 public:
00048
00049
00050
00051 TreeKey () { init(); };
00052 ~TreeKey () {};
00053
00054
00055 virtual const char *getLocalName() = 0;
00056 virtual const char *setLocalName(const char *) = 0;
00057
00058 virtual const char *getUserData(int *size = 0) = 0;
00059 virtual void setUserData(const char *userData, int size = 0) = 0;
00060
00063 virtual void root() = 0;
00064
00068 virtual bool parent() = 0;
00069
00073 virtual bool firstChild() = 0;
00074
00078 virtual bool nextSibling() = 0;
00079
00083 virtual bool previousSibling() = 0;
00084
00088 virtual bool hasChildren() = 0;
00089
00090 virtual void append() = 0;
00091 virtual void appendChild() = 0;
00092 virtual void insertBefore() = 0;
00093
00094 virtual void remove() = 0;
00095
00096
00097 virtual void setOffset(unsigned long offset) = 0;
00098 virtual unsigned long getOffset() const = 0;
00099
00100 virtual void setText(const char *ikey) = 0;
00101 virtual void setPosition(SW_POSITION p) = 0;
00102 virtual const char *getText() const = 0;
00103 virtual int compare(const SWKey &ikey) = 0;
00104 virtual void decrement(int steps = 1) = 0;
00105 virtual void increment(int steps = 1) = 0;
00106 virtual bool isTraversable() const { return true; }
00107 virtual long Index() const { return getOffset(); }
00108 virtual long Index(long iindex) { setOffset(iindex); return getOffset(); }
00109
00114 virtual void assureKeyPath(const char *keyPath = 0);
00115 virtual void save() {}
00116
00117 SWKEY_OPERATORS
00118
00119 };
00120
00121 SWORD_NAMESPACE_END
00122 #endif