6 #include "kmime_util.h"
7 #include "headeritem.h"
11 #include <tdelistview.h>
12 #include <kfoldertree.h>
13 #include <kmmsgbase.h>
16 #include <tqstrlist.h>
17 #include <tqmemarray.h>
19 #include <tqdragobject.h>
21 #include <tqguardedptr.h>
34 typedef TQPtrList<KMMsgBase> KMMessageList;
35 typedef TQValueList<TQ_UINT32> SerNumList;
36 typedef TQMap<int,KMFolder*> KMMenuToFolder;
37 enum NestingPolicy { AlwaysOpen = 0, DefaultOpen, DefaultClosed, OpenUnread };
40 #define KMAIL_SORT_VERSION 1012
41 #define KMAIL_SORT_FILE(x) x->indexLocation() + ".sorted"
42 #define KMAIL_SORT_HEADER "## KMail Sort V%04d\n\t"
43 #define KMAIL_MAGIC_HEADER_OFFSET 21 //strlen(KMAIL_SORT_HEADER)
44 #define KMAIL_MAX_KEY_LEN 16384
45 #define KMAIL_RESERVED 3
53 friend class ::KMail::HeaderItem;
56 KMHeaders(KMMainWidget * owner, TQWidget *parent=0, const char *name=0);
83 virtual void setMsgRead( int msgId);
86 virtual void setMsgStatus(KMMsgStatus status, bool toggle= false);
87 virtual void deleteMsg();
88 virtual void applyFiltersOnMsg();
90 virtual bool canUndo() const;
91 virtual HeaderItem * prepareMove( int *contentX, int *contentY );
92 virtual void finalizeMove( HeaderItem *item, int contentX, int contentY );
98 bool askForConfirmation= true );
109 virtual KMMessageList* selectedMsgs( bool toBeDeleted = false);
126 KMMainWidget* owner( void) const { return mOwner; }
129 const KPaintInfo * paintInfo( void) const { return &mPaintInfo; }
161 virtual void setNestedOverride( bool override );
162 virtual void setSubjectThreading( bool subjThreading );
164 virtual void setOpen ( TQListViewItem *, bool );
166 NestingPolicy getNestingPolicy() const { return nestingPolicy; }
169 return mNested != mNestedOverride;
174 virtual int findUnread( bool findNext, int startAt=-1, bool onlyNew = false, bool acceptCurrent = false);
176 void highlightMessage(TQListViewItem*, bool markitread);
177 void highlightCurrentThread();
180 static TQString fancyDate( time_t otime );
185 bool eventFilter ( TQObject *o, TQEvent *e );
191 TQFont newFont() const { return mNewFont; }
192 TQFont unreadFont() const { return mUnreadFont; }
193 TQFont importantFont() const { return mImportantFont; }
194 TQFont todoFont() const { return mTodoFont; }
195 TQFont dateFont() const { return mDateFont; }
236 void highlightMessage(TQListViewItem*);
286 virtual void ensureCurrentItemVisible();
305 static TQPixmap *pixNew, *pixUns, *pixDel, *pixRead, *pixRep, *pixSent,
306 *pixQueued, *pixFwd, *pixFlag, *pixWatched, *pixIgnored, *pixSpam, *pixHam,
307 *pixFullySigned, *pixPartiallySigned, *pixUndefinedSigned,
308 *pixFullyEncrypted, *pixPartiallyEncrypted, *pixUndefinedEncrypted,
309 *pixFiller, *pixEncryptionProblematic,
310 *pixSignatureProblematic, *pixAttachment, *pixInvitation,
311 *pixReadFwd, *pixReadReplied, *pixReadFwdReplied, *pixTodo;
314 virtual bool event(TQEvent *e);
317 virtual void paintEmptyArea( TQPainter * p, const TQRect & rect );
339 virtual void contentsMouseReleaseEvent(TQMouseEvent* e);
340 virtual void keyPressEvent( TQKeyEvent * e );
343 virtual void setSorting( int column, bool ascending = true);
370 void slotMoveCompleted( KMCommand * );
374 void pasteMessages();
376 void updateActions();
381 virtual void updateMessageList( bool set_selection= false,
382 bool forceJumpToUnread = false );
385 TQGuardedPtr<KMFolder> mFolder;
387 KMMainWidget* mOwner;
393 unsigned long mCurrentItemSerNum;
395 TQMemArray<HeaderItem*> mItems;
398 bool mNested, mNestedOverride, mSubjThreading;
399 NestingPolicy nestingPolicy;
401 bool mSortDescending;
402 bool mIgnoreSortOrderChanges;
414 TQDict< SortCacheItem > mSortCacheItems;
416 TQDict< TQPtrList< SortCacheItem > > mSubjectLists;
418 TQPtrList<HeaderItem> mImperfectlyThreadedList;
421 void printSubjectThreadingTree( );
422 void printThreadingTree( );
424 void buildThreadingTree( TQMemArray<SortCacheItem *> sortCache );
426 void buildSubjectThreadingTree( TQMemArray<SortCacheItem *> sortCache );
436 bool writeSortOrder();
438 bool readSortOrder( bool set_selection = false,
439 bool forceJumpToUnread = false );
448 KMMessageList mSelMsgBaseList;
452 KPaintInfo mPaintInfo;
454 TQFont mNewFont, mUnreadFont, mImportantFont, mDateFont,mTodoFont;
457 static TQIconSet *up, *down;
459 KMMenuToFolder mMenuToFolder;
466 KMime::DateFormatter mDate;
467 bool mReaderWindowActive;
470 TDEPopupMenu* mPopup;
473 TQValueList<TQ_UINT32> mCopiedMessages;
|