34 #include <klistview.h>
57 SortCacheItem() : mItem(0), mParent(0), mId(-1), mSortOffset(-1),
58 mUnsortedCount(0), mUnsortedSize(0), mUnsortedChildren(0),
59 mImperfectlyThreaded (
true), mSubjThreadingList(0) { }
61 : mItem(0), mParent(0), mId(i), mSortOffset(o), mKey(k),
62 mUnsortedCount(0), mUnsortedSize(0), mUnsortedChildren(0),
63 mImperfectlyThreaded (
true), mSubjThreadingList(0) { }
64 ~
SortCacheItem() {
if(mUnsortedChildren) free(mUnsortedChildren); }
75 {
return mImperfectlyThreaded; }
79 { mImperfectlyThreaded = val; }
82 {
return mSortedChildren.count() || mUnsortedCount; }
86 {
return &mSortedChildren; }
90 { count = mUnsortedCount;
return mUnsortedChildren; }
94 mSortedChildren.append(i);
99 if(!mUnsortedChildren)
101 else if(mUnsortedCount >= mUnsortedSize)
102 mUnsortedChildren = (
SortCacheItem **)realloc(mUnsortedChildren,
104 mUnsortedChildren[mUnsortedCount++] = i;
109 mSortedChildren.clear();
110 free( mUnsortedChildren );
111 mUnsortedChildren = 0;
112 mUnsortedCount = mUnsortedSize = 0;
121 const TQString &
key()
const {
return mKey; }
125 int id()
const {
return mId; }
126 void setId(
int id) { mId = id; }
129 int offset()
const {
return mSortOffset; }
130 void setOffset(
int x) { mSortOffset = x; }
132 void updateSortFile( FILE *sortStream,
KMFolder *folder,
133 bool waiting_for_parent =
false,
134 bool update_discovered_count =
false);
145 int mId, mSortOffset;
148 TQPtrList<SortCacheItem> mSortedChildren;
149 int mUnsortedCount, mUnsortedSize;
151 bool mImperfectlyThreaded;
154 TQPtrList<SortCacheItem>* mSubjThreadingList;
166 HeaderItem( TQListView* parent,
int msgId,
const TQString& key = TQString() );
167 HeaderItem( TQListViewItem* parent,
int msgId,
const TQString& key = TQString() );
183 TQString from()
const;
186 TQ_UINT32 msgSerNum()
const;
192 TQString
text(
int col)
const;
196 typedef TQValueList<TQPixmap> PixmapList;
198 TQPixmap pixmapMerge( PixmapList pixmaps )
const;
200 const TQPixmap *cryptoIcon(KMMsgBase *msgBase)
const;
201 const TQPixmap *signatureIcon(KMMsgBase *msgBase)
const;
202 const TQPixmap *statusIcon(KMMsgBase *msgBase)
const;
204 const TQPixmap *pixmap(
int col)
const;
206 void paintCell( TQPainter * p,
const TQColorGroup & cg,
207 int column,
int width,
int align );
209 static TQString generate_key(
KMHeaders *headers, KMMsgBase *msg,
const KPaintInfo *paintInfo,
int sortOrder );
211 virtual TQString key(
int column,
bool )
const;
213 void setTempKey( TQString key );
215 int compare( TQListViewItem *i,
int col,
bool ascending )
const;
217 TQListViewItem* firstChildNonConst();
237 bool mAboutToBeDeleted;
244 #endif // HEADERITEM_H