kmail

kmatmlistview.h

00001 /* -*- mode: C++; c-file-style: "gnu" -*-
00002  * KMAtmListViewItem Header File
00003  * Author: Markus Wuebben <markus.wuebben@kde.org>
00004  */
00005 #ifndef __KMAIL_KMATMLISTVIEW_H__
00006 #define __KMAIL_KMATMLISTVIEW_H__
00007 
00008 #include <tqlistview.h>
00009 #include <tqcstring.h>
00010 
00011 class KMComposeWin;
00012 class MessageComposer;
00013 class TQCheckBox;
00014 
00015 class KMAtmListViewItem : public TQObject, public QListViewItem
00016 {
00017   Q_OBJECT
00018 
00019 public:
00020   KMAtmListViewItem( TQListView *parent );
00021   virtual ~KMAtmListViewItem();
00022 
00023   //A custom compare function is needed because the size column is
00024   //human-readable and therefore doesn't sort correctly.
00025   virtual int compare( TQListViewItem *i, int col, bool ascending ) const;
00026 
00027   virtual void paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align );
00028 
00029   void setUncompressedMimeType( const TQCString & type, const TQCString & subtype ) {
00030     mType = type; mSubtype = subtype;
00031   }
00032   void setAttachmentSize( int numBytes ) {
00033     mAttachmentSize = numBytes;
00034   }
00035   void uncompressedMimeType( TQCString & type, TQCString & subtype ) const {
00036     type = mType; subtype = mSubtype;
00037   }
00038   void setUncompressedCodec( const TQCString &codec ) { mCodec = codec; }
00039   TQCString uncompressedCodec() const { return mCodec; }
00040 
00041   void enableCryptoCBs( bool on );
00042   void setEncrypt( bool on );
00043   bool isEncrypt();
00044   void setSign( bool on );
00045   bool isSign();
00046   void setCompress( bool on );
00047   bool isCompress();
00048 
00049 signals:
00050   void compress( int );
00051   void uncompress( int );
00052 
00053 private slots:
00054   void slotCompress();
00055   void slotHeaderChange( int, int, int );
00056   void slotHeaderClick( int );
00057 
00058 protected:
00059 
00060   void updateCheckBox( int headerSection, TQCheckBox *cb );
00061   void updateAllCheckBoxes();
00062 
00063 private:
00064   TQCheckBox *mCBEncrypt;
00065   TQCheckBox *mCBSign;
00066   TQCheckBox *mCBCompress;
00067   TQCString mType, mSubtype, mCodec;
00068   int mAttachmentSize;
00069 };
00070 
00071 #endif // __KMAIL_KMATMLISTVIEW_H__