kmail

kmmsgpartdlg.h

Go to the documentation of this file.
00001 /*
00002  * kmail: KDE mail client
00003  * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  *
00019  */
00020 #ifndef kmmsgpartdlg_h
00021 #define kmmsgpartdlg_h
00022 
00023 #include <kdialogbase.h>
00024 #include <kio/global.h>
00025 
00026 class KMMessagePart;
00027 class QPushButton;
00028 class KComboBox;
00029 class QComboBox;
00030 class QCheckBox;
00031 class QLabel;
00032 class QLineEdit;
00033 
00034 #undef None
00035 
00039 class KMMsgPartDialog: public KDialogBase
00040 {
00041   Q_OBJECT
00042 
00043 public:
00044   KMMsgPartDialog( const QString & caption=QString::null,
00045            QWidget * parent=0, const char * name=0 );
00046   virtual ~KMMsgPartDialog();
00047 
00049   QString mimeType() const;
00051   void setMimeType( const QString & type, const QString & subtype );
00057   void setMimeType( const QString & mimeType );
00060   void setMimeTypeList( const QStringList & mimeTypes );
00061 
00065   void setSize( KIO::filesize_t size, bool estimated=false );
00066 
00070   QString fileName() const;
00074   void setFileName( const QString & fileName );
00075 
00078   QString description() const;
00081   void setDescription( const QString & description );
00082 
00084   enum Encoding {
00085     None     = 0x00,
00086     SevenBit = 0x01,
00087     EightBit = 0x02,
00088     QuotedPrintable = 0x04,
00089     Base64   = 0x08
00090   };
00091 
00093   Encoding encoding() const;
00095   void setEncoding( Encoding encoding );
00098   void setShownEncodings( int encodings );
00099 
00102   bool isInline() const;
00105   void setInline( bool inlined );
00106 
00108   bool isEncrypted() const;
00110   void setEncrypted( bool encrypted );
00112   void setCanEncrypt( bool enable );
00113 
00115   bool isSigned() const;
00117   void setSigned( bool sign );
00119   void setCanSign( bool enable );
00120 
00121 protected slots:
00122   void slotMimeTypeChanged( const QString & mimeType );
00123 
00124 protected:
00125   KComboBox  *mMimeType;
00126   QLabel     *mIcon;
00127   QLabel     *mSize;
00128   QLineEdit  *mFileName;
00129   QLineEdit  *mDescription;
00130   QComboBox  *mEncoding;
00131   QCheckBox  *mInline;
00132   QCheckBox  *mEncrypted;
00133   QCheckBox  *mSigned;
00134   QStringList mI18nizedEncodings;
00135 };
00136 
00140 class KMMsgPartDialogCompat : public KMMsgPartDialog {
00141   Q_OBJECT
00142 public:
00143   KMMsgPartDialogCompat( QWidget * parent=0, const char * caption=0, bool=FALSE );
00144   virtual ~KMMsgPartDialogCompat();
00145 
00147   void setMsgPart(KMMessagePart* msgPart);
00148 
00150   KMMessagePart* msgPart(void) const { return mMsgPart; }
00151 
00152 protected slots:
00153   void slotOk();
00154 
00155 protected:
00158   void applyChanges(void);
00159 
00160   KMMessagePart *mMsgPart;
00161 };
00162 
00163 #endif /*kmmsgpartdlg_h*/