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 TQListViewItem
00016 {
00017   Q_OBJECT
00018   
00019 
00020 public:
00021   KMAtmListViewItem( TQListView *parent );
00022   virtual ~KMAtmListViewItem();
00023 
00024   //A custom compare function is needed because the size column is
00025   //human-readable and therefore doesn't sort correctly.
00026   virtual int compare( TQListViewItem *i, int col, bool ascending ) const;
00027 
00028   virtual void paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align );
00029 
00030   void setUncompressedMimeType( const TQCString & type, const TQCString & subtype ) {
00031     mType = type; mSubtype = subtype;
00032   }
00033   void setAttachmentSize( int numBytes ) {
00034     mAttachmentSize = numBytes;
00035   }
00036   void uncompressedMimeType( TQCString & type, TQCString & subtype ) const {
00037     type = mType; subtype = mSubtype;
00038   }
00039   void setUncompressedCodec( const TQCString &codec ) { mCodec = codec; }
00040   TQCString uncompressedCodec() const { return mCodec; }
00041 
00042   void enableCryptoCBs( bool on );
00043   void setEncrypt( bool on );
00044   bool isEncrypt();
00045   void setSign( bool on );
00046   bool isSign();
00047   void setCompress( bool on );
00048   bool isCompress();
00049 
00050 signals:
00051   void compress( int );
00052   void uncompress( int );
00053 
00054 private slots:
00055   void slotCompress();
00056   void slotHeaderChange( int, int, int );
00057   void slotHeaderClick( int );
00058 
00059 protected:
00060 
00061   void updateCheckBox( int headerSection, TQCheckBox *cb );
00062   void updateAllCheckBoxes();
00063 
00064 private:
00065   TQCheckBox *mCBEncrypt;
00066   TQCheckBox *mCBSign;
00067   TQCheckBox *mCBCompress;
00068   TQCString mType, mSubtype, mCodec;
00069   int mAttachmentSize;
00070 };
00071 
00072 #endif // __KMAIL_KMATMLISTVIEW_H__