kmail

kmmsgpartdlg.h

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 <tdeio/global.h>
00025 
00026 class KMMessagePart;
00027 class TQPushButton;
00028 class KComboBox;
00029 class TQComboBox;
00030 class TQCheckBox;
00031 class TQLabel;
00032 class TQLineEdit;
00033 
00034 #undef None
00035 
00039 class KMMsgPartDialog: public KDialogBase
00040 {
00041   Q_OBJECT
00042   
00043 
00044 public:
00045   KMMsgPartDialog( const TQString & caption=TQString(),
00046            TQWidget * parent=0, const char * name=0 );
00047   virtual ~KMMsgPartDialog();
00048 
00050   TQString mimeType() const;
00052   void setMimeType( const TQString & type, const TQString & subtype );
00058   void setMimeType( const TQString & mimeType );
00061   void setMimeTypeList( const TQStringList & mimeTypes );
00062 
00066   void setSize( TDEIO::filesize_t size, bool estimated=false );
00067 
00071   TQString fileName() const;
00075   void setFileName( const TQString & fileName );
00076 
00079   TQString description() const;
00082   void setDescription( const TQString & description );
00083 
00085   enum Encoding {
00086     None     = 0x00,
00087     SevenBit = 0x01,
00088     EightBit = 0x02,
00089     QuotedPrintable = 0x04,
00090     Base64   = 0x08
00091   };
00092 
00094   Encoding encoding() const;
00096   void setEncoding( Encoding encoding );
00099   void setShownEncodings( int encodings );
00100 
00103   bool isInline() const;
00106   void setInline( bool inlined );
00107 
00109   bool isEncrypted() const;
00111   void setEncrypted( bool encrypted );
00113   void setCanEncrypt( bool enable );
00114 
00116   bool isSigned() const;
00118   void setSigned( bool sign );
00120   void setCanSign( bool enable );
00121 
00122 protected slots:
00123   void slotMimeTypeChanged( const TQString & mimeType );
00124 
00125 protected:
00126   KComboBox  *mMimeType;
00127   TQLabel     *mIcon;
00128   TQLabel     *mSize;
00129   TQLineEdit  *mFileName;
00130   TQLineEdit  *mDescription;
00131   TQComboBox  *mEncoding;
00132   TQCheckBox  *mInline;
00133   TQCheckBox  *mEncrypted;
00134   TQCheckBox  *mSigned;
00135   TQStringList mI18nizedEncodings;
00136 };
00137 
00141 class KMMsgPartDialogCompat : public KMMsgPartDialog {
00142   Q_OBJECT
00143   
00144 public:
00145   KMMsgPartDialogCompat( TQWidget * parent=0, const char * caption=0, bool=FALSE );
00146   virtual ~KMMsgPartDialogCompat();
00147 
00149   void setMsgPart(KMMessagePart* msgPart);
00150 
00152   KMMessagePart* msgPart(void) const { return mMsgPart; }
00153 
00154 protected slots:
00155   void slotOk();
00156 
00157 protected:
00160   void applyChanges(void);
00161 
00162   KMMessagePart *mMsgPart;
00163 };
00164 
00165 #endif /*kmmsgpartdlg_h*/