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 <tdeio/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  TQ_OBJECT
42 
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( TDEIO::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  TQ_OBJECT
143 
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*/
The attachment dialog with convenience backward compatible methods.
Definition: kmmsgpartdlg.h:141
KMMessagePart * msgPart(void) const
Returns the (possibly modified) message part.
Definition: kmmsgpartdlg.h:152
void applyChanges(void)
Applies changes from the dialog to the message part.
void setMsgPart(KMMessagePart *msgPart)
Display information about this message part.
GUI for KMMsgPartDialog.
Definition: kmmsgpartdlg.h:40
TQString mimeType() const
Get the currently selected mimetype.
TQString fileName() const
Returns the current file name of the attachment.
void setShownEncodings(int encodings)
Sets the list of encodings to be shown.
bool isSigned() const
Returns whether or not this attachment is or shall be signed.
Encoding encoding() const
Returns the current encoding.
void setCanSign(bool enable)
Sets whether or not this attachment can be signed.
void setEncoding(Encoding encoding)
Sets the encoding to use.
void setMimeType(const TQString &type, const TQString &subtype)
Sets the mime type to be displayed.
bool isInline() const
Returns true if the attchment has a content-disposition of "inline", false otherwise.
void setDescription(const TQString &description)
Sets the description of the attachment, ie.
void setFileName(const TQString &fileName)
Sets the file name of the attachment.
void setCanEncrypt(bool enable)
Sets whether or not this attachment can be encrypted.
void setEncrypted(bool encrypted)
Sets whether or not this attachment is or should be encrypted.
void setInline(bool inlined)
Sets whether this attachment has a content-disposition of "inline".
TQString description() const
Returns the content of the Content-Description header field.
void setSigned(bool sign)
Sets whether or not this attachment is or should be signed.
Encoding
The list of supported encodings.
Definition: kmmsgpartdlg.h:85
void setMimeTypeList(const TQStringList &mimeTypes)
Sets the initial list of mime types to be displayed in the combobox.
bool isEncrypted() const
Returns whether or not this attachment is or shall be encrypted.
void setSize(TDEIO::filesize_t size, bool estimated=false)
Sets the size of the file to be attached in bytes.