|
|
|
|
@ -10,8 +10,8 @@ |
|
|
|
|
|
|
|
|
|
class KMMsgDict; |
|
|
|
|
|
|
|
|
|
#define KMMsgListInherited QMemArray<KMMsgBasePtr> |
|
|
|
|
class KMMsgList: public QMemArray<KMMsgBasePtr> |
|
|
|
|
#define KMMsgListInherited QMemArray<KMMsgBase*> |
|
|
|
|
class KMMsgList: public QMemArray<KMMsgBase*> |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
/** Valid parameters for sort() */ |
|
|
|
|
@ -29,16 +29,16 @@ public: |
|
|
|
|
|
|
|
|
|
/** Returns message at given index and removes it from the list.
|
|
|
|
|
Also removes from message dictionary. */ |
|
|
|
|
virtual KMMsgBasePtr take(int idx); |
|
|
|
|
virtual KMMsgBase* take(int idx); |
|
|
|
|
|
|
|
|
|
/** Insert message at given index. Resizes the array if necessary.
|
|
|
|
|
If @p syncDict, also updates message dictionary. */ |
|
|
|
|
virtual void insert(int idx, KMMsgBasePtr msg, bool syncDict = true); |
|
|
|
|
virtual void insert(int idx, KMMsgBase* msg, bool syncDict = true); |
|
|
|
|
|
|
|
|
|
/** Append given message after the last used message. Resizes the
|
|
|
|
|
array if necessary. Returns index of new position. |
|
|
|
|
If @p syncDict, also updates message dictionary. */ |
|
|
|
|
virtual int append(KMMsgBasePtr msg, bool syncDict = true); |
|
|
|
|
virtual int append(KMMsgBase* msg, bool syncDict = true); |
|
|
|
|
|
|
|
|
|
/** Clear messages. If autoDelete is set (default) the messages are
|
|
|
|
|
deleted. The array is not resized. If @p syncDict, also updates |
|
|
|
|
@ -54,15 +54,15 @@ public: |
|
|
|
|
virtual bool reset(int size); |
|
|
|
|
|
|
|
|
|
/** Returns message at given index. */ |
|
|
|
|
virtual KMMsgBasePtr at(int idx) { return KMMsgListInherited::at(idx); } |
|
|
|
|
KMMsgBasePtr at(int idx) const { return KMMsgListInherited::at(idx); } |
|
|
|
|
KMMsgBasePtr operator[](int idx) { return KMMsgListInherited::at(idx); } |
|
|
|
|
KMMsgBasePtr operator[](int idx) const { return KMMsgListInherited::at(idx); } |
|
|
|
|
virtual KMMsgBase* at(int idx) { return KMMsgListInherited::at(idx); } |
|
|
|
|
const KMMsgBase* at(int idx) const { return KMMsgListInherited::at(idx); } |
|
|
|
|
KMMsgBase* operator[](int idx) { return KMMsgListInherited::at(idx); } |
|
|
|
|
const KMMsgBase* operator[](int idx) const { return KMMsgListInherited::at(idx); } |
|
|
|
|
|
|
|
|
|
/** Set message at given index. The array is resized if necessary. If
|
|
|
|
|
there is already a message at the given index this message is *not* |
|
|
|
|
deleted. Does not sync the message dictionary. */ |
|
|
|
|
virtual void set(int idx, KMMsgBasePtr msg); |
|
|
|
|
virtual void set(int idx, KMMsgBase* msg); |
|
|
|
|
|
|
|
|
|
/** Returns first unused index (index of last message plus one). */ |
|
|
|
|
int high(void) const { return mHigh; } |
|
|
|
|
|