kmail

kmatmlistview.h
1/*
2 * KMAtmListViewItem Header File
3 * Author: Markus Wuebben <markus.wuebben@kde.org>
4 */
5#ifndef __KMAIL_KMATMLISTVIEW_H__
6#define __KMAIL_KMATMLISTVIEW_H__
7
8#include <tqlistview.h>
9#include <tqcstring.h>
10
11class KMComposeWin;
12class MessageComposer;
13class TQCheckBox;
14
15class KMAtmListViewItem : public TQObject, public TQListViewItem
16{
17 TQ_OBJECT
18
19
20public:
21 KMAtmListViewItem( TQListView *parent );
22 virtual ~KMAtmListViewItem();
23
24 //A custom compare function is needed because the size column is
25 //human-readable and therefore doesn't sort correctly.
26 virtual int compare( TQListViewItem *i, int col, bool ascending ) const;
27
28 virtual void paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align );
29
30 void setUncompressedMimeType( const TQCString & type, const TQCString & subtype ) {
31 mType = type; mSubtype = subtype;
32 }
33 void setAttachmentSize( int numBytes ) {
34 mAttachmentSize = numBytes;
35 }
36 void uncompressedMimeType( TQCString & type, TQCString & subtype ) const {
37 type = mType; subtype = mSubtype;
38 }
39 void setUncompressedCodec( const TQCString &codec ) { mCodec = codec; }
40 TQCString uncompressedCodec() const { return mCodec; }
41
42 void enableCryptoCBs( bool on );
43 void setEncrypt( bool on );
44 bool isEncrypt();
45 void setSign( bool on );
46 bool isSign();
47 void setCompress( bool on );
48 bool isCompress();
49
50signals:
51 void compress( int );
52 void uncompress( int );
53
54private slots:
55 void slotCompress();
56 void slotHeaderChange( int, int, int );
57 void slotHeaderClick( int );
58
59protected:
60
61 void updateCheckBox( int headerSection, TQCheckBox *cb );
62 void updateAllCheckBoxes();
63
64private:
65 TQCheckBox *mCBEncrypt;
66 TQCheckBox *mCBSign;
67 TQCheckBox *mCBCompress;
68 TQCString mType, mSubtype, mCodec;
69 int mAttachmentSize;
70};
71
72#endif // __KMAIL_KMATMLISTVIEW_H__