4 #include "kmime_util.h"
5 #include "headeritem.h"
9 #include <tdelistview.h>
10 #include <kfoldertree.h>
11 #include <kmmsgbase.h>
14 #include <tqstrlist.h>
15 #include <tqmemarray.h>
17 #include <tqdragobject.h>
19 #include <tqguardedptr.h>
32 typedef TQPtrList<KMMsgBase> KMMessageList;
33 typedef TQValueList<TQ_UINT32> SerNumList;
34 typedef TQMap<int,KMFolder*> KMMenuToFolder;
35 enum NestingPolicy { AlwaysOpen = 0, DefaultOpen, DefaultClosed, OpenUnread };
38 #define KMAIL_SORT_VERSION 1012
39 #define KMAIL_SORT_FILE(x) x->indexLocation() + ".sorted"
40 #define KMAIL_SORT_HEADER "## KMail Sort V%04d\n\t"
41 #define KMAIL_MAGIC_HEADER_OFFSET 21 //strlen(KMAIL_SORT_HEADER)
42 #define KMAIL_MAX_KEY_LEN 16384
43 #define KMAIL_RESERVED 3
51 friend class ::KMail::HeaderItem;
54 KMHeaders(KMMainWidget * owner, TQWidget *parent=0, const char *name=0);
81 virtual void setMsgRead( int msgId);
84 virtual void setMsgStatus(KMMsgStatus status, bool toggle= false);
85 virtual void deleteMsg();
86 virtual void applyFiltersOnMsg();
88 virtual bool canUndo() const;
89 virtual HeaderItem * prepareMove( int *contentX, int *contentY );
90 virtual void finalizeMove( HeaderItem *item, int contentX, int contentY );
96 bool askForConfirmation= true );
107 virtual KMMessageList* selectedMsgs( bool toBeDeleted = false);
124 KMMainWidget* owner( void) const { return mOwner; }
127 const KPaintInfo * paintInfo( void) const { return &mPaintInfo; }
159 virtual void setNestedOverride( bool override );
160 virtual void setSubjectThreading( bool subjThreading );
162 virtual void setOpen ( TQListViewItem *, bool );
164 NestingPolicy getNestingPolicy() const { return nestingPolicy; }
167 return mNested != mNestedOverride;
172 virtual int findUnread( bool findNext, int startAt=-1, bool onlyNew = false, bool acceptCurrent = false);
174 void highlightMessage(TQListViewItem*, bool markitread);
175 void highlightCurrentThread();
178 static TQString fancyDate( time_t otime );
183 bool eventFilter ( TQObject *o, TQEvent *e );
189 TQFont newFont() const { return mNewFont; }
190 TQFont unreadFont() const { return mUnreadFont; }
191 TQFont importantFont() const { return mImportantFont; }
192 TQFont todoFont() const { return mTodoFont; }
193 TQFont dateFont() const { return mDateFont; }
234 void highlightMessage(TQListViewItem*);
284 virtual void ensureCurrentItemVisible();
303 static TQPixmap *pixNew, *pixUns, *pixDel, *pixRead, *pixRep, *pixSent,
304 *pixQueued, *pixFwd, *pixFlag, *pixWatched, *pixIgnored, *pixSpam, *pixHam,
305 *pixFullySigned, *pixPartiallySigned, *pixUndefinedSigned,
306 *pixFullyEncrypted, *pixPartiallyEncrypted, *pixUndefinedEncrypted,
307 *pixFiller, *pixEncryptionProblematic,
308 *pixSignatureProblematic, *pixAttachment, *pixInvitation,
309 *pixReadFwd, *pixReadReplied, *pixReadFwdReplied, *pixTodo;
312 virtual bool event(TQEvent *e);
315 virtual void paintEmptyArea( TQPainter * p, const TQRect & rect );
337 virtual void contentsMouseReleaseEvent(TQMouseEvent* e);
338 virtual void keyPressEvent( TQKeyEvent * e );
341 virtual void setSorting( int column, bool ascending = true);
368 void slotMoveCompleted( KMCommand * );
372 void pasteMessages();
374 void updateActions();
379 virtual void updateMessageList( bool set_selection= false,
380 bool forceJumpToUnread = false );
383 TQGuardedPtr<KMFolder> mFolder;
385 KMMainWidget* mOwner;
391 unsigned long mCurrentItemSerNum;
393 TQMemArray<HeaderItem*> mItems;
396 bool mNested, mNestedOverride, mSubjThreading;
397 NestingPolicy nestingPolicy;
399 bool mSortDescending;
400 bool mIgnoreSortOrderChanges;
412 TQDict< SortCacheItem > mSortCacheItems;
414 TQDict< TQPtrList< SortCacheItem > > mSubjectLists;
416 TQPtrList<HeaderItem> mImperfectlyThreadedList;
419 void printSubjectThreadingTree( );
420 void printThreadingTree( );
422 void buildThreadingTree( TQMemArray<SortCacheItem *> sortCache );
424 void buildSubjectThreadingTree( TQMemArray<SortCacheItem *> sortCache );
434 bool writeSortOrder();
436 bool readSortOrder( bool set_selection = false,
437 bool forceJumpToUnread = false );
446 KMMessageList mSelMsgBaseList;
450 KPaintInfo mPaintInfo;
452 TQFont mNewFont, mUnreadFont, mImportantFont, mDateFont,mTodoFont;
455 static TQIconSet *up, *down;
457 KMMenuToFolder mMenuToFolder;
464 KMime::DateFormatter mDate;
465 bool mReaderWindowActive;
468 TDEPopupMenu* mPopup;
471 TQValueList<TQ_UINT32> mCopiedMessages;
|