kmail

kmmsgpartdlg.h
1 /*
2  * kmail: KDE mail client
3  * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  */
20 #ifndef kmmsgpartdlg_h
21 #define kmmsgpartdlg_h
22 
23 #include <kdialogbase.h>
24 #include <kio/global.h>
25 
26 class KMMessagePart;
27 class TQPushButton;
28 class KComboBox;
29 class TQComboBox;
30 class TQCheckBox;
31 class TQLabel;
32 class TQLineEdit;
33 
34 #undef None
35 
39 class KMMsgPartDialog: public KDialogBase
40 {
41  Q_OBJECT
42  TQ_OBJECT
43 
44 public:
45  KMMsgPartDialog( const TQString & caption=TQString(),
46  TQWidget * parent=0, const char * name=0 );
47  virtual ~KMMsgPartDialog();
48 
50  TQString mimeType() const;
52  void setMimeType( const TQString & type, const TQString & subtype );
58  void setMimeType( const TQString & mimeType );
61  void setMimeTypeList( const TQStringList & mimeTypes );
62 
66  void setSize( KIO::filesize_t size, bool estimated=false );
67 
71  TQString fileName() const;
75  void setFileName( const TQString & fileName );
76 
79  TQString description() const;
82  void setDescription( const TQString & description );
83 
85  enum Encoding {
86  None = 0x00,
87  SevenBit = 0x01,
88  EightBit = 0x02,
89  QuotedPrintable = 0x04,
90  Base64 = 0x08
91  };
92 
94  Encoding encoding() const;
99  void setShownEncodings( int encodings );
100 
103  bool isInline() const;
106  void setInline( bool inlined );
107 
109  bool isEncrypted() const;
111  void setEncrypted( bool encrypted );
113  void setCanEncrypt( bool enable );
114 
116  bool isSigned() const;
118  void setSigned( bool sign );
120  void setCanSign( bool enable );
121 
122 protected slots:
123  void slotMimeTypeChanged( const TQString & mimeType );
124 
125 protected:
126  KComboBox *mMimeType;
127  TQLabel *mIcon;
128  TQLabel *mSize;
129  TQLineEdit *mFileName;
130  TQLineEdit *mDescription;
131  TQComboBox *mEncoding;
132  TQCheckBox *mInline;
133  TQCheckBox *mEncrypted;
134  TQCheckBox *mSigned;
135  TQStringList mI18nizedEncodings;
136 };
137 
142  Q_OBJECT
143  TQ_OBJECT
144 public:
145  KMMsgPartDialogCompat( TQWidget * parent=0, const char * caption=0, bool=FALSE );
146  virtual ~KMMsgPartDialogCompat();
147 
149  void setMsgPart(KMMessagePart* msgPart);
150 
152  KMMessagePart* msgPart(void) const { return mMsgPart; }
153 
154 protected slots:
155  void slotOk();
156 
157 protected:
160  void applyChanges(void);
161 
162  KMMessagePart *mMsgPart;
163 };
164 
165 #endif /*kmmsgpartdlg_h*/