00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef SWLSTKEY_H
00026 #define SWLSTKEY_H
00027
00028 #include <swkey.h>
00029
00030 #include <defs.h>
00031
00032 SWORD_NAMESPACE_START
00033
00038 class SWDLLEXPORT ListKey : public SWKey {
00039
00040 static SWClass classdef;
00041 void init ();
00042 protected:
00043 int arraypos;
00044 int arraymax;
00045 int arraycnt;
00046 SWKey **array;
00047 public:
00052 ListKey (const char *ikey = 0);
00053 ListKey (ListKey const &k);
00056 virtual ~ ListKey ();
00057
00058 virtual SWKey *clone () const;
00061 virtual void ClearList ();
00065 virtual int Count ();
00068 virtual void Remove ();
00074 virtual char SetToElement (int ielement, SW_POSITION = TOP);
00080 virtual SWKey *GetElement (int pos = -1);
00084 ListKey & operator << (const SWKey &ikey) { add(ikey); return *this; }
00085 virtual void add(const SWKey &ikey);
00086
00091 virtual void copyFrom(const ListKey & ikey);
00092 virtual void copyFrom(const SWKey & ikey) { SWKey::copyFrom(ikey); }
00093
00099 virtual void setPosition(SW_POSITION pos);
00102 virtual void decrement(int step);
00105 virtual void increment(int step);
00106
00107 virtual char Traversable () { return 1; }
00108 virtual long Index () const { return arraypos; }
00109 virtual const char *getRangeText() const;
00110
00115 virtual long Index (long index) { SetToElement (index); return Index (); }
00116 virtual const char *getText() const;
00117 virtual void setText(const char *ikey);
00118
00119 SWKEY_OPERATORS
00120 ListKey & operator =(const ListKey &key) { copyFrom(key); return *this; }
00121 };
00122
00123 SWORD_NAMESPACE_END
00124 #endif