kmail

kmatmlistview.h

Go to the documentation of this file.
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 <qlistview.h>
00009 #include <qcstring.h>
00010 
00011 class KMComposeWin;
00012 class MessageComposer;
00013 class QCheckBox;
00014 
00015 class KMAtmListViewItem : public QObject, public QListViewItem
00016 {
00017   Q_OBJECT
00018 
00019 public:
00020   KMAtmListViewItem( QListView *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( QListViewItem *i, int col, bool ascending ) const;
00026 
00027   virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align );
00028 
00029   void setUncompressedMimeType( const QCString & type, const QCString & subtype ) {
00030     mType = type; mSubtype = subtype;
00031   }
00032   void setAttachmentSize( int numBytes ) {
00033     mAttachmentSize = numBytes;
00034   }
00035   void uncompressedMimeType( QCString & type, QCString & subtype ) const {
00036     type = mType; subtype = mSubtype;
00037   }
00038   void setUncompressedCodec( const QCString &codec ) { mCodec = codec; }
00039   QCString 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, QCheckBox *cb );
00061   void updateAllCheckBoxes();
00062 
00063 private:
00064   QCheckBox *mCBEncrypt;
00065   QCheckBox *mCBSign;
00066   QCheckBox *mCBCompress;
00067   QCString mType, mSubtype, mCodec;
00068   int mAttachmentSize;
00069 };
00070 
00071 #endif // __KMAIL_KMATMLISTVIEW_H__