<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US"> <head> <title>kmail: kmmsgpartdlg.cpp Source File (kmail)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org" r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org" r (n 0 s 0 v 0 l 0))' /> <meta name="trademark" content="KDE e.V." /> <meta name="description" content="K Desktop Environment Homepage, KDE.org" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="robots" content="all" /> <link rel="shortcut icon" href="../../favicon.ico" /> <link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" /> <style type="text/css"> <!-- hr { display: none; } #content h2 { margin-left: 0px; } table.mdTable { background-color: #f8f8f8; border: .2em solid #d7d7d7; } td.mdRow { padding: 8px 20px; } td.md { font-weight: bold; } td.mdname1 { font-weight: bold; color: #602020; } td.mdname { font-weight: bold; color: #602020; } --> </style> </head> <body> <div id="nav_header_top" align="right"> <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a> <a href="../.."><img id="nav_header_logo" alt="Home" align="left" src="../../kde_gear_64.png" border="0" /></a> <span class="doNotDisplay">::</span> <img id="nav_header_logo_right" alt="" align="right" src="../../pimlogo.png" border="0" /> <div id="nav_header_title" align="left">KDE PIM API Reference</div> </div> <div id="nav_header_bottom" align="right"> <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span> <div id="nav_header_bottom_left" style="text-align: left;"> / <a href="../../">API Reference</a> / <a href=".">kmail</a> </div> </div> <table id="main" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" class="menuheader" height="0"></td> <td id="contentcolumn" valign="top" rowspan="2" > <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;"> <h2><a name="content"></a>kmail</h2> <!-- Generated by Doxygen 1.5.5 --> <h1>kmmsgpartdlg.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// kmmsgpartdlg.cpp</span> <a name="l00002"></a>00002 <a name="l00003"></a>00003 <a name="l00004"></a>00004 <span class="comment">// my includes:</span> <a name="l00005"></a>00005 <span class="preprocessor">#include <config.h></span> <a name="l00006"></a>00006 <span class="preprocessor">#include "kmmsgpartdlg.h"</span> <a name="l00007"></a>00007 <a name="l00008"></a>00008 <span class="comment">// other KMail includes:</span> <a name="l00009"></a>00009 <span class="preprocessor">#include "kmmessage.h"</span> <a name="l00010"></a>00010 <span class="preprocessor">#include "kmmsgpart.h"</span> <a name="l00011"></a>00011 <span class="preprocessor">#include "kcursorsaver.h"</span> <a name="l00012"></a>00012 <a name="l00013"></a>00013 <span class="comment">// other kdenetwork includes: (none)</span> <a name="l00014"></a>00014 <a name="l00015"></a>00015 <span class="comment">// other KDE includes:</span> <a name="l00016"></a>00016 <span class="preprocessor">#include <kmimetype.h></span> <a name="l00017"></a>00017 <span class="preprocessor">#include <kapplication.h></span> <a name="l00018"></a>00018 <span class="preprocessor">#include <kiconloader.h></span> <a name="l00019"></a>00019 <span class="preprocessor">#include <kaboutdata.h></span> <a name="l00020"></a>00020 <span class="preprocessor">#include <kstringvalidator.h></span> <a name="l00021"></a>00021 <span class="preprocessor">#include <kcombobox.h></span> <a name="l00022"></a>00022 <span class="preprocessor">#include <kdebug.h></span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="comment">// other Qt includes:</span> <a name="l00025"></a>00025 <span class="preprocessor">#include <qlabel.h></span> <a name="l00026"></a>00026 <span class="preprocessor">#include <qlayout.h></span> <a name="l00027"></a>00027 <span class="preprocessor">#include <qwhatsthis.h></span> <a name="l00028"></a>00028 <span class="preprocessor">#include <klineedit.h></span> <a name="l00029"></a>00029 <span class="preprocessor">#include <qcheckbox.h></span> <a name="l00030"></a>00030 <a name="l00031"></a>00031 <span class="comment">// other includes:</span> <a name="l00032"></a>00032 <span class="preprocessor">#include <assert.h></span> <a name="l00033"></a>00033 <a name="l00034"></a>00034 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">struct </span>{ <a name="l00035"></a>00035 <a class="code" href="classKMMsgPartDialog.html#ef9777936bb46aa55530ae7910788942" title="The list of supported encodings.">KMMsgPartDialog::Encoding</a> encoding; <a name="l00036"></a>00036 <span class="keyword">const</span> <span class="keywordtype">char</span> * displayName; <a name="l00037"></a>00037 } encodingTypes[] = { <a name="l00038"></a>00038 { KMMsgPartDialog::SevenBit, I18N_NOOP(<span class="stringliteral">"None (7-bit text)"</span>) }, <a name="l00039"></a>00039 { KMMsgPartDialog::EightBit, I18N_NOOP(<span class="stringliteral">"None (8-bit text)"</span>) }, <a name="l00040"></a>00040 { KMMsgPartDialog::QuotedPrintable, I18N_NOOP(<span class="stringliteral">"Quoted Printable"</span>) }, <a name="l00041"></a>00041 { KMMsgPartDialog::Base64, I18N_NOOP(<span class="stringliteral">"Base 64"</span>) }, <a name="l00042"></a>00042 }; <a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> numEncodingTypes = <a name="l00044"></a>00044 <span class="keyword">sizeof</span> encodingTypes / <span class="keyword">sizeof</span> *encodingTypes; <a name="l00045"></a>00045 <a name="l00046"></a>00046 KMMsgPartDialog::KMMsgPartDialog( <span class="keyword">const</span> QString & caption, <a name="l00047"></a>00047 QWidget * parent, <span class="keyword">const</span> <span class="keywordtype">char</span> * name ) <a name="l00048"></a>00048 : KDialogBase( Plain, <a name="l00049"></a>00049 caption.isEmpty() ? i18n(<span class="stringliteral">"Message Part Properties"</span>) : caption, <a name="l00050"></a>00050 Ok|Cancel|Help, Ok, parent, name, true, true) <a name="l00051"></a>00051 { <a name="l00052"></a>00052 <span class="comment">// tmp vars:</span> <a name="l00053"></a>00053 QGridLayout * glay; <a name="l00054"></a>00054 QLabel * label; <a name="l00055"></a>00055 QString msg; <a name="l00056"></a>00056 <a name="l00057"></a>00057 setHelp( QString::fromLatin1(<span class="stringliteral">"attachments"</span>) ); <a name="l00058"></a>00058 <a name="l00059"></a>00059 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0 ; i < numEncodingTypes ; ++i ) <a name="l00060"></a>00060 mI18nizedEncodings << i18n( encodingTypes[i].displayName ); <a name="l00061"></a>00061 <a name="l00062"></a>00062 glay = <span class="keyword">new</span> QGridLayout( plainPage(), 9 <span class="comment">/*rows*/</span>, 2 <span class="comment">/*cols*/</span>, spacingHint() ); <a name="l00063"></a>00063 glay->setColStretch( 1, 1 ); <a name="l00064"></a>00064 glay->setRowStretch( 8, 1 ); <a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="comment">// mimetype icon:</span> <a name="l00067"></a>00067 mIcon = <span class="keyword">new</span> QLabel( plainPage() ); <a name="l00068"></a>00068 mIcon->setPixmap( DesktopIcon(<span class="stringliteral">"unknown"</span>) ); <a name="l00069"></a>00069 glay->addMultiCellWidget( mIcon, 0, 1, 0, 0 ); <a name="l00070"></a>00070 <a name="l00071"></a>00071 <span class="comment">// row 0: Type combobox:</span> <a name="l00072"></a>00072 mMimeType = <span class="keyword">new</span> KComboBox( <span class="keyword">true</span>, plainPage() ); <a name="l00073"></a>00073 mMimeType->setInsertionPolicy( QComboBox::NoInsertion ); <a name="l00074"></a>00074 mMimeType->setValidator( <span class="keyword">new</span> KMimeTypeValidator( mMimeType ) ); <a name="l00075"></a>00075 mMimeType->insertStringList( QStringList() <a name="l00076"></a>00076 << QString::fromLatin1(<span class="stringliteral">"text/html"</span>) <a name="l00077"></a>00077 << QString::fromLatin1(<span class="stringliteral">"text/plain"</span>) <a name="l00078"></a>00078 << QString::fromLatin1(<span class="stringliteral">"image/gif"</span>) <a name="l00079"></a>00079 << QString::fromLatin1(<span class="stringliteral">"image/jpeg"</span>) <a name="l00080"></a>00080 << QString::fromLatin1(<span class="stringliteral">"image/png"</span>) <a name="l00081"></a>00081 << QString::fromLatin1(<span class="stringliteral">"application/octet-stream"</span>) <a name="l00082"></a>00082 << QString::fromLatin1(<span class="stringliteral">"application/x-gunzip"</span>) <a name="l00083"></a>00083 << QString::fromLatin1(<span class="stringliteral">"application/zip"</span>) ); <a name="l00084"></a>00084 connect( mMimeType, SIGNAL(textChanged(<span class="keyword">const</span> QString&)), <a name="l00085"></a>00085 <span class="keyword">this</span>, SLOT(slotMimeTypeChanged(<span class="keyword">const</span> QString&)) ); <a name="l00086"></a>00086 glay->addWidget( mMimeType, 0, 1 ); <a name="l00087"></a>00087 <a name="l00088"></a>00088 msg = i18n(<span class="stringliteral">"<qt><p>The <em>MIME type</em> of the file:</p>"</span> <a name="l00089"></a>00089 <span class="stringliteral">"<p>normally, you do not need to touch this setting, since the "</span> <a name="l00090"></a>00090 <span class="stringliteral">"type of the file is automatically checked; but, sometimes, %1 "</span> <a name="l00091"></a>00091 <span class="stringliteral">"may not detect the type correctly -- here is where you can fix "</span> <a name="l00092"></a>00092 <span class="stringliteral">"that.</p></qt>"</span>).arg( kapp->aboutData()->programName() ); <a name="l00093"></a>00093 QWhatsThis::add( mMimeType, msg ); <a name="l00094"></a>00094 <a name="l00095"></a>00095 <span class="comment">// row 1: Size label:</span> <a name="l00096"></a>00096 mSize = <span class="keyword">new</span> QLabel( plainPage() ); <a name="l00097"></a>00097 setSize( KIO::filesize_t(0) ); <a name="l00098"></a>00098 glay->addWidget( mSize, 1, 1 ); <a name="l00099"></a>00099 <a name="l00100"></a>00100 msg = i18n(<span class="stringliteral">"<qt><p>The size of the part:</p>"</span> <a name="l00101"></a>00101 <span class="stringliteral">"<p>sometimes, %1 will only give an estimated size here, "</span> <a name="l00102"></a>00102 <span class="stringliteral">"because calculating the exact size would take too much time; "</span> <a name="l00103"></a>00103 <span class="stringliteral">"when this is the case, it will be made visible by adding "</span> <a name="l00104"></a>00104 <span class="stringliteral">"\"(est.)\" to the size displayed.</p></qt>"</span>) <a name="l00105"></a>00105 .arg( kapp->aboutData()->programName() ); <a name="l00106"></a>00106 QWhatsThis::add( mSize, msg ); <a name="l00107"></a>00107 <a name="l00108"></a>00108 <span class="comment">// row 2: "Name" lineedit and label:</span> <a name="l00109"></a>00109 mFileName = <span class="keyword">new</span> KLineEdit( plainPage() ); <a name="l00110"></a>00110 label = <span class="keyword">new</span> QLabel( mFileName, i18n(<span class="stringliteral">"&Name:"</span>), plainPage() ); <a name="l00111"></a>00111 glay->addWidget( label, 2, 0 ); <a name="l00112"></a>00112 glay->addWidget( mFileName, 2, 1 ); <a name="l00113"></a>00113 <a name="l00114"></a>00114 msg = i18n(<span class="stringliteral">"<qt><p>The file name of the part:</p>"</span> <a name="l00115"></a>00115 <span class="stringliteral">"<p>although this defaults to the name of the attached file, "</span> <a name="l00116"></a>00116 <span class="stringliteral">"it does not specify the file to be attached; rather, it "</span> <a name="l00117"></a>00117 <span class="stringliteral">"suggests a file name to be used by the recipient's mail agent "</span> <a name="l00118"></a>00118 <span class="stringliteral">"when saving the part to disk.</p></qt>"</span>); <a name="l00119"></a>00119 QWhatsThis::add( label, msg ); <a name="l00120"></a>00120 QWhatsThis::add( mFileName, msg ); <a name="l00121"></a>00121 <a name="l00122"></a>00122 <span class="comment">// row 3: "Description" lineedit and label:</span> <a name="l00123"></a>00123 mDescription = <span class="keyword">new</span> KLineEdit( plainPage() ); <a name="l00124"></a>00124 label = <span class="keyword">new</span> QLabel( mDescription, i18n(<span class="stringliteral">"&Description:"</span>), plainPage() ); <a name="l00125"></a>00125 glay->addWidget( label, 3, 0 ); <a name="l00126"></a>00126 glay->addWidget( mDescription, 3, 1 ); <a name="l00127"></a>00127 <a name="l00128"></a>00128 msg = i18n(<span class="stringliteral">"<qt><p>A description of the part:</p>"</span> <a name="l00129"></a>00129 <span class="stringliteral">"<p>this is just an informational description of the part, "</span> <a name="l00130"></a>00130 <span class="stringliteral">"much like the Subject is for the whole message; most "</span> <a name="l00131"></a>00131 <span class="stringliteral">"mail agents will show this information in their message "</span> <a name="l00132"></a>00132 <span class="stringliteral">"previews alongside the attachment's icon.</p></qt>"</span>); <a name="l00133"></a>00133 QWhatsThis::add( label, msg ); <a name="l00134"></a>00134 QWhatsThis::add( mDescription, msg ); <a name="l00135"></a>00135 <a name="l00136"></a>00136 <span class="comment">// row 4: "Encoding" combobox and label:</span> <a name="l00137"></a>00137 mEncoding = <span class="keyword">new</span> QComboBox( <span class="keyword">false</span>, plainPage() ); <a name="l00138"></a>00138 mEncoding->insertStringList( mI18nizedEncodings ); <a name="l00139"></a>00139 label = <span class="keyword">new</span> QLabel( mEncoding, i18n(<span class="stringliteral">"&Encoding:"</span>), plainPage() ); <a name="l00140"></a>00140 glay->addWidget( label, 4, 0 ); <a name="l00141"></a>00141 glay->addWidget( mEncoding, 4, 1 ); <a name="l00142"></a>00142 <a name="l00143"></a>00143 msg = i18n(<span class="stringliteral">"<qt><p>The transport encoding of this part:</p>"</span> <a name="l00144"></a>00144 <span class="stringliteral">"<p>normally, you do not need to change this, since %1 will use "</span> <a name="l00145"></a>00145 <span class="stringliteral">"a decent default encoding, depending on the MIME type; yet, "</span> <a name="l00146"></a>00146 <span class="stringliteral">"sometimes, you can significantly reduce the size of the "</span> <a name="l00147"></a>00147 <span class="stringliteral">"resulting message, e.g. if a PostScript file does not contain "</span> <a name="l00148"></a>00148 <span class="stringliteral">"binary data, but consists of pure text -- in this case, choosing "</span> <a name="l00149"></a>00149 <span class="stringliteral">"\"quoted-printable\" over the default \"base64\" will save up "</span> <a name="l00150"></a>00150 <span class="stringliteral">"to 25% in resulting message size.</p></qt>"</span>) <a name="l00151"></a>00151 .arg( kapp->aboutData()->programName() ); <a name="l00152"></a>00152 QWhatsThis::add( label, msg ); <a name="l00153"></a>00153 QWhatsThis::add( mEncoding, msg ); <a name="l00154"></a>00154 <a name="l00155"></a>00155 <span class="comment">// row 5: "Suggest automatic display..." checkbox:</span> <a name="l00156"></a>00156 mInline = <span class="keyword">new</span> QCheckBox( i18n(<span class="stringliteral">"Suggest &automatic display"</span>), plainPage() ); <a name="l00157"></a>00157 glay->addMultiCellWidget( mInline, 5, 5, 0, 1 ); <a name="l00158"></a>00158 <a name="l00159"></a>00159 msg = i18n(<span class="stringliteral">"<qt><p>Check this option if you want to suggest to the "</span> <a name="l00160"></a>00160 <span class="stringliteral">"recipient the automatic (inline) display of this part in the "</span> <a name="l00161"></a>00161 <span class="stringliteral">"message preview, instead of the default icon view;</p>"</span> <a name="l00162"></a>00162 <span class="stringliteral">"<p>technically, this is carried out by setting this part's "</span> <a name="l00163"></a>00163 <span class="stringliteral">"<em>Content-Disposition</em> header field to \"inline\" "</span> <a name="l00164"></a>00164 <span class="stringliteral">"instead of the default \"attachment\".</p></qt>"</span>); <a name="l00165"></a>00165 QWhatsThis::add( mInline, msg ); <a name="l00166"></a>00166 <a name="l00167"></a>00167 <span class="comment">// row 6: "Sign" checkbox:</span> <a name="l00168"></a>00168 mSigned = <span class="keyword">new</span> QCheckBox( i18n(<span class="stringliteral">"&Sign this part"</span>), plainPage() ); <a name="l00169"></a>00169 glay->addMultiCellWidget( mSigned, 6, 6, 0, 1 ); <a name="l00170"></a>00170 <a name="l00171"></a>00171 msg = i18n(<span class="stringliteral">"<qt><p>Check this option if you want this message part to be "</span> <a name="l00172"></a>00172 <span class="stringliteral">"signed;</p>"</span> <a name="l00173"></a>00173 <span class="stringliteral">"<p>the signature will be made with the key that you associated "</span> <a name="l00174"></a>00174 <span class="stringliteral">"with the currently-selected identity.</p></qt>"</span>); <a name="l00175"></a>00175 QWhatsThis::add( mSigned, msg ); <a name="l00176"></a>00176 <a name="l00177"></a>00177 <span class="comment">// row 7: "Encrypt" checkbox:</span> <a name="l00178"></a>00178 mEncrypted = <span class="keyword">new</span> QCheckBox( i18n(<span class="stringliteral">"Encr&ypt this part"</span>), plainPage() ); <a name="l00179"></a>00179 glay->addMultiCellWidget( mEncrypted, 7, 7, 0, 1 ); <a name="l00180"></a>00180 <a name="l00181"></a>00181 msg = i18n(<span class="stringliteral">"<qt><p>Check this option if you want this message part to be "</span> <a name="l00182"></a>00182 <span class="stringliteral">"encrypted;</p>"</span> <a name="l00183"></a>00183 <span class="stringliteral">"<p>the part will be encrypted for the recipients of this "</span> <a name="l00184"></a>00184 <span class="stringliteral">"message</p></qt>"</span>); <a name="l00185"></a>00185 QWhatsThis::add( mEncrypted, msg ); <a name="l00186"></a>00186 <span class="comment">// (row 8: spacer)</span> <a name="l00187"></a>00187 } <a name="l00188"></a>00188 <a name="l00189"></a>00189 <a name="l00190"></a>00190 KMMsgPartDialog::~KMMsgPartDialog() {} <a name="l00191"></a>00191 <a name="l00192"></a>00192 <a name="l00193"></a><a class="code" href="classKMMsgPartDialog.html#ce5c89d74fea658850044d6a7a90a945">00193</a> QString <a class="code" href="classKMMsgPartDialog.html#ce5c89d74fea658850044d6a7a90a945" title="Get the currently selected mimetype.">KMMsgPartDialog::mimeType</a>()<span class="keyword"> const </span>{ <a name="l00194"></a>00194 <span class="keywordflow">return</span> mMimeType->currentText(); <a name="l00195"></a>00195 } <a name="l00196"></a>00196 <a name="l00197"></a><a class="code" href="classKMMsgPartDialog.html#68732eb07fcc65a819de31e7656f01ab">00197</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#ae115e3d42764d9ae747b00046c32121" title="Sets the mime type to be displayed.">KMMsgPartDialog::setMimeType</a>( <span class="keyword">const</span> QString & <a class="code" href="classKMMsgPartDialog.html#ce5c89d74fea658850044d6a7a90a945" title="Get the currently selected mimetype.">mimeType</a> ) { <a name="l00198"></a>00198 <span class="keywordtype">int</span> dummy = 0; <a name="l00199"></a>00199 QString tmp = mimeType; <span class="comment">// get rid of const'ness</span> <a name="l00200"></a>00200 <span class="keywordflow">if</span> ( mMimeType->validator() && mMimeType->validator()->validate( tmp, dummy ) ) <a name="l00201"></a>00201 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0 ; i < mMimeType->count() ; ++i ) <a name="l00202"></a>00202 <span class="keywordflow">if</span> ( mMimeType->text( i ) == mimeType ) { <a name="l00203"></a>00203 mMimeType->setCurrentItem( i ); <a name="l00204"></a>00204 <span class="keywordflow">return</span>; <a name="l00205"></a>00205 } <a name="l00206"></a>00206 mMimeType->insertItem( mimeType, 0 ); <a name="l00207"></a>00207 mMimeType->setCurrentItem( 0 ); <a name="l00208"></a>00208 slotMimeTypeChanged( mimeType ); <a name="l00209"></a>00209 } <a name="l00210"></a>00210 <a name="l00211"></a><a class="code" href="classKMMsgPartDialog.html#ae115e3d42764d9ae747b00046c32121">00211</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#ae115e3d42764d9ae747b00046c32121" title="Sets the mime type to be displayed.">KMMsgPartDialog::setMimeType</a>( <span class="keyword">const</span> QString & type, <a name="l00212"></a>00212 <span class="keyword">const</span> QString & subtype ) { <a name="l00213"></a>00213 <a class="code" href="classKMMsgPartDialog.html#ae115e3d42764d9ae747b00046c32121" title="Sets the mime type to be displayed.">setMimeType</a>( QString::fromLatin1(<span class="stringliteral">"%1/%2"</span>).arg(type).arg(subtype) ); <a name="l00214"></a>00214 } <a name="l00215"></a>00215 <a name="l00216"></a><a class="code" href="classKMMsgPartDialog.html#4c78f1342f83dd29d13ef1d160397b0f">00216</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#4c78f1342f83dd29d13ef1d160397b0f" title="Sets the initial list of mime types to be displayed in the combobox.">KMMsgPartDialog::setMimeTypeList</a>( <span class="keyword">const</span> QStringList & mimeTypes ) { <a name="l00217"></a>00217 mMimeType->insertStringList( mimeTypes ); <a name="l00218"></a>00218 } <a name="l00219"></a>00219 <a name="l00220"></a><a class="code" href="classKMMsgPartDialog.html#7d7cf008f1b7f9ce3e6518000692bad6">00220</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#7d7cf008f1b7f9ce3e6518000692bad6" title="Sets the size of the file to be attached in bytes.">KMMsgPartDialog::setSize</a>( KIO::filesize_t size, <span class="keywordtype">bool</span> estimated ) { <a name="l00221"></a>00221 QString text = KIO::convertSize( size ); <a name="l00222"></a>00222 <span class="keywordflow">if</span> ( estimated ) <a name="l00223"></a>00223 text = i18n(<span class="stringliteral">"%1: a filesize incl. unit (e.g. \"1.3 KB\")"</span>, <a name="l00224"></a>00224 <span class="stringliteral">"%1 (est.)"</span>).arg( text ); <a name="l00225"></a>00225 mSize->setText( text ); <a name="l00226"></a>00226 } <a name="l00227"></a>00227 <a name="l00228"></a><a class="code" href="classKMMsgPartDialog.html#52ed3960ac23475b9916c7f0411a91f8">00228</a> QString <a class="code" href="classKMMsgPartDialog.html#52ed3960ac23475b9916c7f0411a91f8" title="Returns the current file name of the attachment.">KMMsgPartDialog::fileName</a>()<span class="keyword"> const </span>{ <a name="l00229"></a>00229 <span class="keywordflow">return</span> mFileName->text(); <a name="l00230"></a>00230 } <a name="l00231"></a>00231 <a name="l00232"></a><a class="code" href="classKMMsgPartDialog.html#441a18865292c87194f4d60bd0f78117">00232</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#441a18865292c87194f4d60bd0f78117" title="Sets the file name of the attachment.">KMMsgPartDialog::setFileName</a>( <span class="keyword">const</span> QString & <a class="code" href="classKMMsgPartDialog.html#52ed3960ac23475b9916c7f0411a91f8" title="Returns the current file name of the attachment.">fileName</a> ) { <a name="l00233"></a>00233 mFileName->setText( fileName ); <a name="l00234"></a>00234 } <a name="l00235"></a>00235 <a name="l00236"></a><a class="code" href="classKMMsgPartDialog.html#a070f1cc92fc3c75970a2dc4e188073c">00236</a> QString <a class="code" href="classKMMsgPartDialog.html#a070f1cc92fc3c75970a2dc4e188073c" title="Returns the content of the Content-Description header field.">KMMsgPartDialog::description</a>()<span class="keyword"> const </span>{ <a name="l00237"></a>00237 <span class="keywordflow">return</span> mDescription->text(); <a name="l00238"></a>00238 } <a name="l00239"></a>00239 <a name="l00240"></a><a class="code" href="classKMMsgPartDialog.html#30b82681e7b6d3788b5076fab03cc1e9">00240</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#30b82681e7b6d3788b5076fab03cc1e9" title="Sets the description of the attachment, ie.">KMMsgPartDialog::setDescription</a>( <span class="keyword">const</span> QString & <a class="code" href="classKMMsgPartDialog.html#a070f1cc92fc3c75970a2dc4e188073c" title="Returns the content of the Content-Description header field.">description</a> ) { <a name="l00241"></a>00241 mDescription->setText( description ); <a name="l00242"></a>00242 } <a name="l00243"></a>00243 <a name="l00244"></a><a class="code" href="classKMMsgPartDialog.html#63e749c0b181b248c72ed42ffc590fe3">00244</a> <a class="code" href="classKMMsgPartDialog.html#ef9777936bb46aa55530ae7910788942" title="The list of supported encodings.">KMMsgPartDialog::Encoding</a> <a class="code" href="classKMMsgPartDialog.html#63e749c0b181b248c72ed42ffc590fe3" title="Returns the current encoding.">KMMsgPartDialog::encoding</a>()<span class="keyword"> const </span>{ <a name="l00245"></a>00245 QString s = mEncoding->currentText(); <a name="l00246"></a>00246 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0 ; i < mI18nizedEncodings.count() ; ++i ) <a name="l00247"></a>00247 <span class="keywordflow">if</span> ( s == *mI18nizedEncodings.at(i) ) <a name="l00248"></a>00248 <span class="keywordflow">return</span> encodingTypes[i].<a class="code" href="classKMMsgPartDialog.html#63e749c0b181b248c72ed42ffc590fe3" title="Returns the current encoding.">encoding</a>; <a name="l00249"></a>00249 kdFatal(5006) << <span class="stringliteral">"KMMsgPartDialog::encoding(): Unknown encoding encountered!"</span> <a name="l00250"></a>00250 << endl; <a name="l00251"></a>00251 <span class="keywordflow">return</span> None; <span class="comment">// keep compiler happy</span> <a name="l00252"></a>00252 } <a name="l00253"></a>00253 <a name="l00254"></a><a class="code" href="classKMMsgPartDialog.html#523da3f246beebccd96c7753771536c7">00254</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#523da3f246beebccd96c7753771536c7" title="Sets the encoding to use.">KMMsgPartDialog::setEncoding</a>( <a class="code" href="classKMMsgPartDialog.html#ef9777936bb46aa55530ae7910788942" title="The list of supported encodings.">Encoding</a> <a class="code" href="classKMMsgPartDialog.html#63e749c0b181b248c72ed42ffc590fe3" title="Returns the current encoding.">encoding</a> ) { <a name="l00255"></a>00255 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0 ; i < numEncodingTypes ; ++i ) <a name="l00256"></a>00256 <span class="keywordflow">if</span> ( encodingTypes[i].encoding == encoding ) { <a name="l00257"></a>00257 QString text = *mI18nizedEncodings.at(i); <a name="l00258"></a>00258 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j = 0 ; j < mEncoding->count() ; ++j ) <a name="l00259"></a>00259 <span class="keywordflow">if</span> ( mEncoding->text(j) == text ) { <a name="l00260"></a>00260 mEncoding->setCurrentItem( j ); <a name="l00261"></a>00261 <span class="keywordflow">return</span>; <a name="l00262"></a>00262 } <a name="l00263"></a>00263 mEncoding->insertItem( text, 0 ); <a name="l00264"></a>00264 mEncoding->setCurrentItem( 0 ); <a name="l00265"></a>00265 } <a name="l00266"></a>00266 kdFatal(5006) << <span class="stringliteral">"KMMsgPartDialog::setEncoding(): "</span> <a name="l00267"></a>00267 <span class="stringliteral">"Unknown encoding encountered!"</span> << endl; <a name="l00268"></a>00268 } <a name="l00269"></a>00269 <a name="l00270"></a><a class="code" href="classKMMsgPartDialog.html#280108579a0c14739878786a29d6fca9">00270</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#280108579a0c14739878786a29d6fca9" title="Sets the list of encodings to be shown.">KMMsgPartDialog::setShownEncodings</a>( <span class="keywordtype">int</span> encodings ) { <a name="l00271"></a>00271 mEncoding->clear(); <a name="l00272"></a>00272 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0 ; i < numEncodingTypes ; ++i ) <a name="l00273"></a>00273 <span class="keywordflow">if</span> ( encodingTypes[i].<a class="code" href="classKMMsgPartDialog.html#63e749c0b181b248c72ed42ffc590fe3" title="Returns the current encoding.">encoding</a> & encodings ) <a name="l00274"></a>00274 mEncoding->insertItem( *mI18nizedEncodings.at(i) ); <a name="l00275"></a>00275 } <a name="l00276"></a>00276 <a name="l00277"></a><a class="code" href="classKMMsgPartDialog.html#faeebf489429e235c1d760fdbe23c03d">00277</a> <span class="keywordtype">bool</span> <a class="code" href="classKMMsgPartDialog.html#faeebf489429e235c1d760fdbe23c03d" title="Returns true if the attchment has a content-disposition of &quot;inline&quot;, false...">KMMsgPartDialog::isInline</a>()<span class="keyword"> const </span>{ <a name="l00278"></a>00278 <span class="keywordflow">return</span> mInline->isChecked(); <a name="l00279"></a>00279 } <a name="l00280"></a>00280 <a name="l00281"></a><a class="code" href="classKMMsgPartDialog.html#d591db2ea2bf283486541483dae126f2">00281</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#d591db2ea2bf283486541483dae126f2" title="Sets whether this attachment has a content-disposition of &quot;inline&quot;.">KMMsgPartDialog::setInline</a>( <span class="keywordtype">bool</span> inlined ) { <a name="l00282"></a>00282 mInline->setChecked( inlined ); <a name="l00283"></a>00283 } <a name="l00284"></a>00284 <a name="l00285"></a><a class="code" href="classKMMsgPartDialog.html#4302eaef291f43601aaef6145ce995a7">00285</a> <span class="keywordtype">bool</span> <a class="code" href="classKMMsgPartDialog.html#4302eaef291f43601aaef6145ce995a7" title="Returns whether or not this attachment is or shall be encrypted.">KMMsgPartDialog::isEncrypted</a>()<span class="keyword"> const </span>{ <a name="l00286"></a>00286 <span class="keywordflow">return</span> mEncrypted->isChecked(); <a name="l00287"></a>00287 } <a name="l00288"></a>00288 <a name="l00289"></a><a class="code" href="classKMMsgPartDialog.html#cdf5a02e22bbd6f941b6f7783dd8d0e1">00289</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#cdf5a02e22bbd6f941b6f7783dd8d0e1" title="Sets whether or not this attachment is or should be encrypted.">KMMsgPartDialog::setEncrypted</a>( <span class="keywordtype">bool</span> encrypted ) { <a name="l00290"></a>00290 mEncrypted->setChecked( encrypted ); <a name="l00291"></a>00291 } <a name="l00292"></a>00292 <a name="l00293"></a><a class="code" href="classKMMsgPartDialog.html#c3d5eecdf361a20dbc3e46d90a413134">00293</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#c3d5eecdf361a20dbc3e46d90a413134" title="Sets whether or not this attachment can be encrypted.">KMMsgPartDialog::setCanEncrypt</a>( <span class="keywordtype">bool</span> enable ) { <a name="l00294"></a>00294 mEncrypted->setEnabled( enable ); <a name="l00295"></a>00295 } <a name="l00296"></a>00296 <a name="l00297"></a><a class="code" href="classKMMsgPartDialog.html#1b86896d3a5febbb81c664e24dcb8d8f">00297</a> <span class="keywordtype">bool</span> <a class="code" href="classKMMsgPartDialog.html#1b86896d3a5febbb81c664e24dcb8d8f" title="Returns whether or not this attachment is or shall be signed.">KMMsgPartDialog::isSigned</a>()<span class="keyword"> const </span>{ <a name="l00298"></a>00298 <span class="keywordflow">return</span> mSigned->isChecked(); <a name="l00299"></a>00299 } <a name="l00300"></a>00300 <a name="l00301"></a><a class="code" href="classKMMsgPartDialog.html#eec85b265cb0451e67b9f6473f854e44">00301</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#eec85b265cb0451e67b9f6473f854e44" title="Sets whether or not this attachment is or should be signed.">KMMsgPartDialog::setSigned</a>( <span class="keywordtype">bool</span> sign ) { <a name="l00302"></a>00302 mSigned->setChecked( sign ); <a name="l00303"></a>00303 } <a name="l00304"></a>00304 <a name="l00305"></a><a class="code" href="classKMMsgPartDialog.html#4e4b71b80d9d406651e1cf4fab1981fd">00305</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialog.html#4e4b71b80d9d406651e1cf4fab1981fd" title="Sets whether or not this attachment can be signed.">KMMsgPartDialog::setCanSign</a>( <span class="keywordtype">bool</span> enable ) { <a name="l00306"></a>00306 mSigned->setEnabled( enable ); <a name="l00307"></a>00307 } <a name="l00308"></a>00308 <a name="l00309"></a>00309 <span class="keywordtype">void</span> KMMsgPartDialog::slotMimeTypeChanged( <span class="keyword">const</span> QString & <a class="code" href="classKMMsgPartDialog.html#ce5c89d74fea658850044d6a7a90a945" title="Get the currently selected mimetype.">mimeType</a> ) { <a name="l00310"></a>00310 <span class="comment">// message subparts MUST have 7bit or 8bit encoding...</span> <a name="l00311"></a>00311 <span class="preprocessor">#if 0</span> <a name="l00312"></a>00312 <span class="preprocessor"></span> <span class="comment">// ...but until KMail can recode 8bit messages on attach, so that</span> <a name="l00313"></a>00313 <span class="comment">// they can be signed, we can't enforce this :-(</span> <a name="l00314"></a>00314 <span class="keywordflow">if</span> ( mimeType.startsWith(<span class="stringliteral">"message/"</span>) ) { <a name="l00315"></a>00315 <a class="code" href="classKMMsgPartDialog.html#523da3f246beebccd96c7753771536c7" title="Sets the encoding to use.">setEncoding</a>( SevenBit ); <a name="l00316"></a>00316 mEncoding->setEnabled( <span class="keyword">false</span> ); <a name="l00317"></a>00317 } <span class="keywordflow">else</span> { <a name="l00318"></a>00318 mEncoding->setEnabled( !mReadOnly ); <a name="l00319"></a>00319 } <a name="l00320"></a>00320 <span class="preprocessor">#endif</span> <a name="l00321"></a>00321 <span class="preprocessor"></span> <span class="comment">// find a mimetype icon:</span> <a name="l00322"></a>00322 <span class="keywordtype">int</span> dummy = 0; <a name="l00323"></a>00323 QString tmp = mimeType; <span class="comment">// get rid of const'ness</span> <a name="l00324"></a>00324 <span class="keywordflow">if</span> ( mMimeType->validator() && mMimeType->validator()->validate( tmp, dummy ) <a name="l00325"></a>00325 == QValidator::Acceptable ) <a name="l00326"></a>00326 mIcon->setPixmap( KMimeType::mimeType( mimeType )->pixmap( KIcon::Desktop ) ); <a name="l00327"></a>00327 <span class="keywordflow">else</span> <a name="l00328"></a>00328 mIcon->setPixmap( DesktopIcon(<span class="stringliteral">"unknown"</span>) ); <a name="l00329"></a>00329 } <a name="l00330"></a>00330 <a name="l00331"></a>00331 <a name="l00332"></a>00332 <a name="l00333"></a>00333 <a name="l00334"></a>00334 KMMsgPartDialogCompat::KMMsgPartDialogCompat( QWidget * parent, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">bool</span> readOnly) <a name="l00335"></a>00335 : <a class="code" href="classKMMsgPartDialog.html" title="GUI for KMMsgPartDialog.">KMMsgPartDialog</a>(QString::null, parent ), mMsgPart( 0 ) <a name="l00336"></a>00336 { <a name="l00337"></a>00337 <a class="code" href="classKMMsgPartDialog.html#280108579a0c14739878786a29d6fca9" title="Sets the list of encodings to be shown.">setShownEncodings</a>( SevenBit|EightBit|QuotedPrintable|Base64 ); <a name="l00338"></a>00338 <span class="keywordflow">if</span> (readOnly) <a name="l00339"></a>00339 { <a name="l00340"></a>00340 mMimeType->setEditable(<span class="keyword">false</span>); <a name="l00341"></a>00341 mMimeType->setEnabled(<span class="keyword">false</span>); <a name="l00342"></a>00342 mFileName->setReadOnly(<span class="keyword">true</span>); <a name="l00343"></a>00343 mDescription->setReadOnly(<span class="keyword">true</span>); <a name="l00344"></a>00344 mEncoding->setEnabled(<span class="keyword">false</span>); <a name="l00345"></a>00345 mInline->setEnabled(<span class="keyword">false</span>); <a name="l00346"></a>00346 mEncrypted->setEnabled(<span class="keyword">false</span>); <a name="l00347"></a>00347 mSigned->setEnabled(<span class="keyword">false</span>); <a name="l00348"></a>00348 } <a name="l00349"></a>00349 } <a name="l00350"></a>00350 <a name="l00351"></a>00351 KMMsgPartDialogCompat::~KMMsgPartDialogCompat() {} <a name="l00352"></a>00352 <a name="l00353"></a><a class="code" href="classKMMsgPartDialogCompat.html#e9646d5542a8da442a2d6366814a4d3b">00353</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialogCompat.html#e9646d5542a8da442a2d6366814a4d3b" title="Display information about this message part.">KMMsgPartDialogCompat::setMsgPart</a>( KMMessagePart * aMsgPart ) <a name="l00354"></a>00354 { <a name="l00355"></a>00355 mMsgPart = aMsgPart; <a name="l00356"></a>00356 assert( mMsgPart ); <a name="l00357"></a>00357 <a name="l00358"></a>00358 QCString enc = mMsgPart->cteStr(); <a name="l00359"></a>00359 <span class="keywordflow">if</span> ( enc == <span class="stringliteral">"7bit"</span> ) <a name="l00360"></a>00360 <a class="code" href="classKMMsgPartDialog.html#523da3f246beebccd96c7753771536c7" title="Sets the encoding to use.">setEncoding</a>( SevenBit ); <a name="l00361"></a>00361 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( enc == <span class="stringliteral">"8bit"</span> ) <a name="l00362"></a>00362 <a class="code" href="classKMMsgPartDialog.html#523da3f246beebccd96c7753771536c7" title="Sets the encoding to use.">setEncoding</a>( EightBit ); <a name="l00363"></a>00363 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( enc == <span class="stringliteral">"quoted-printable"</span> ) <a name="l00364"></a>00364 <a class="code" href="classKMMsgPartDialog.html#523da3f246beebccd96c7753771536c7" title="Sets the encoding to use.">setEncoding</a>( QuotedPrintable ); <a name="l00365"></a>00365 <span class="keywordflow">else</span> <a name="l00366"></a>00366 <a class="code" href="classKMMsgPartDialog.html#523da3f246beebccd96c7753771536c7" title="Sets the encoding to use.">setEncoding</a>( Base64 ); <a name="l00367"></a>00367 <a name="l00368"></a>00368 <a class="code" href="classKMMsgPartDialog.html#30b82681e7b6d3788b5076fab03cc1e9" title="Sets the description of the attachment, ie.">setDescription</a>( mMsgPart->contentDescription() ); <a name="l00369"></a>00369 <a class="code" href="classKMMsgPartDialog.html#441a18865292c87194f4d60bd0f78117" title="Sets the file name of the attachment.">setFileName</a>( mMsgPart->fileName() ); <a name="l00370"></a>00370 <a class="code" href="classKMMsgPartDialog.html#ae115e3d42764d9ae747b00046c32121" title="Sets the mime type to be displayed.">setMimeType</a>( mMsgPart->typeStr(), mMsgPart->subtypeStr() ); <a name="l00371"></a>00371 <a class="code" href="classKMMsgPartDialog.html#7d7cf008f1b7f9ce3e6518000692bad6" title="Sets the size of the file to be attached in bytes.">setSize</a>( mMsgPart->decodedSize() ); <a name="l00372"></a>00372 <a class="code" href="classKMMsgPartDialog.html#d591db2ea2bf283486541483dae126f2" title="Sets whether this attachment has a content-disposition of &quot;inline&quot;.">setInline</a>( mMsgPart->contentDisposition() <a name="l00373"></a>00373 .find( QRegExp(<span class="stringliteral">"^\\s*inline"</span>, <span class="keyword">false</span>) ) >= 0 ); <a name="l00374"></a>00374 } <a name="l00375"></a>00375 <a name="l00376"></a>00376 <a name="l00377"></a><a class="code" href="classKMMsgPartDialogCompat.html#d9aab0b2e40bb42f900d2d375d577b33">00377</a> <span class="keywordtype">void</span> <a class="code" href="classKMMsgPartDialogCompat.html#d9aab0b2e40bb42f900d2d375d577b33" title="Applies changes from the dialog to the message part.">KMMsgPartDialogCompat::applyChanges</a>() <a name="l00378"></a>00378 { <a name="l00379"></a>00379 <span class="keywordflow">if</span> (!mMsgPart) <span class="keywordflow">return</span>; <a name="l00380"></a>00380 <a name="l00381"></a>00381 <a class="code" href="classKCursorSaver.html" title="sets a cursor and makes sure it&#39;s restored on destruction Create a KCursorSaver...">KCursorSaver</a> busy(KBusyPtr::busy()); <a name="l00382"></a>00382 <a name="l00383"></a>00383 <span class="comment">// apply Content-Disposition:</span> <a name="l00384"></a>00384 QCString cDisp; <a name="l00385"></a>00385 <span class="keywordflow">if</span> ( <a class="code" href="classKMMsgPartDialog.html#faeebf489429e235c1d760fdbe23c03d" title="Returns true if the attchment has a content-disposition of &quot;inline&quot;, false...">isInline</a>() ) <a name="l00386"></a>00386 cDisp = <span class="stringliteral">"inline;"</span>; <a name="l00387"></a>00387 <span class="keywordflow">else</span> <a name="l00388"></a>00388 cDisp = <span class="stringliteral">"attachment;"</span>; <a name="l00389"></a>00389 <a name="l00390"></a>00390 QString name = <a class="code" href="classKMMsgPartDialog.html#52ed3960ac23475b9916c7f0411a91f8" title="Returns the current file name of the attachment.">fileName</a>(); <a name="l00391"></a>00391 <span class="keywordflow">if</span> ( !name.isEmpty() || !mMsgPart->name().isEmpty()) { <a name="l00392"></a>00392 mMsgPart->setName( name ); <a name="l00393"></a>00393 QCString <a class="code" href="classKMMsgPartDialog.html#63e749c0b181b248c72ed42ffc590fe3" title="Returns the current encoding.">encoding</a> = KMMsgBase::autoDetectCharset( mMsgPart->charset(), <a name="l00394"></a>00394 <a class="code" href="classKMMessage.html#41e2c0836f490db2edf4983899a07591" title="Get a list of preferred message charsets.">KMMessage::preferredCharsets</a>(), name ); <a name="l00395"></a>00395 <span class="keywordflow">if</span> ( encoding.isEmpty() ) encoding = <span class="stringliteral">"utf-8"</span>; <a name="l00396"></a>00396 QCString encName = KMMsgBase::encodeRFC2231String( name, encoding ); <a name="l00397"></a>00397 <a name="l00398"></a>00398 cDisp += <span class="stringliteral">"\n\tfilename"</span>; <a name="l00399"></a>00399 <span class="keywordflow">if</span> ( name != QString( encName ) ) <a name="l00400"></a>00400 cDisp += <span class="stringliteral">"*="</span> + encName; <a name="l00401"></a>00401 <span class="keywordflow">else</span> <a name="l00402"></a>00402 cDisp += <span class="stringliteral">"=\""</span> + encName.replace( <span class="charliteral">'\\'</span>, <span class="stringliteral">"\\\\"</span> ).replace( <span class="charliteral">'"'</span>, <span class="stringliteral">"\\\""</span> ) + <span class="charliteral">'"'</span>; <a name="l00403"></a>00403 mMsgPart->setContentDisposition( cDisp ); <a name="l00404"></a>00404 } <a name="l00405"></a>00405 <a name="l00406"></a>00406 <span class="comment">// apply Content-Description"</span> <a name="l00407"></a>00407 QString desc = <a class="code" href="classKMMsgPartDialog.html#a070f1cc92fc3c75970a2dc4e188073c" title="Returns the content of the Content-Description header field.">description</a>(); <a name="l00408"></a>00408 <span class="keywordflow">if</span> ( !desc.isEmpty() || !mMsgPart->contentDescription().isEmpty() ) <a name="l00409"></a>00409 mMsgPart->setContentDescription( desc ); <a name="l00410"></a>00410 <a name="l00411"></a>00411 <span class="comment">// apply Content-Type:</span> <a name="l00412"></a>00412 QCString type = <a class="code" href="classKMMsgPartDialog.html#ce5c89d74fea658850044d6a7a90a945" title="Get the currently selected mimetype.">mimeType</a>().latin1(); <a name="l00413"></a>00413 QCString subtype; <a name="l00414"></a>00414 <span class="keywordtype">int</span> idx = type.find(<span class="charliteral">'/'</span>); <a name="l00415"></a>00415 <span class="keywordflow">if</span> ( idx < 0 ) <a name="l00416"></a>00416 subtype = <span class="stringliteral">""</span>; <a name="l00417"></a>00417 <span class="keywordflow">else</span> { <a name="l00418"></a>00418 subtype = type.mid( idx+1 ); <a name="l00419"></a>00419 type = type.left( idx ); <a name="l00420"></a>00420 } <a name="l00421"></a>00421 mMsgPart->setTypeStr(type); <a name="l00422"></a>00422 mMsgPart->setSubtypeStr(subtype); <a name="l00423"></a>00423 <a name="l00424"></a>00424 <span class="comment">// apply Content-Transfer-Encoding:</span> <a name="l00425"></a>00425 QCString cte; <a name="l00426"></a>00426 <span class="keywordflow">if</span> (subtype == <span class="stringliteral">"rfc822"</span> && type == <span class="stringliteral">"message"</span>) <a name="l00427"></a>00427 kdWarning( <a class="code" href="classKMMsgPartDialog.html#63e749c0b181b248c72ed42ffc590fe3" title="Returns the current encoding.">encoding</a>() != SevenBit && <a class="code" href="classKMMsgPartDialog.html#63e749c0b181b248c72ed42ffc590fe3" title="Returns the current encoding.">encoding</a>() != EightBit, 5006 ) <a name="l00428"></a>00428 << <span class="stringliteral">"encoding on rfc822/message must be \"7bit\" or \"8bit\""</span> << endl; <a name="l00429"></a>00429 <span class="keywordflow">switch</span> ( <a class="code" href="classKMMsgPartDialog.html#63e749c0b181b248c72ed42ffc590fe3" title="Returns the current encoding.">encoding</a>() ) { <a name="l00430"></a>00430 <span class="keywordflow">case</span> SevenBit: cte = <span class="stringliteral">"7bit"</span>; <span class="keywordflow">break</span>; <a name="l00431"></a>00431 <span class="keywordflow">case</span> EightBit: cte = <span class="stringliteral">"8bit"</span>; <span class="keywordflow">break</span>; <a name="l00432"></a>00432 <span class="keywordflow">case</span> QuotedPrintable: cte = <span class="stringliteral">"quoted-printable"</span>; <span class="keywordflow">break</span>; <a name="l00433"></a>00433 <span class="keywordflow">case</span> Base64: <span class="keywordflow">default</span>: cte = <span class="stringliteral">"base64"</span>; <span class="keywordflow">break</span>; <a name="l00434"></a>00434 } <a name="l00435"></a>00435 <span class="keywordflow">if</span> ( cte != mMsgPart->cteStr().lower() ) { <a name="l00436"></a>00436 QByteArray body = mMsgPart->bodyDecodedBinary(); <a name="l00437"></a>00437 mMsgPart->setCteStr( cte ); <a name="l00438"></a>00438 mMsgPart->setBodyEncodedBinary( body ); <a name="l00439"></a>00439 } <a name="l00440"></a>00440 } <a name="l00441"></a>00441 <a name="l00442"></a>00442 <a name="l00443"></a>00443 <span class="comment">//-----------------------------------------------------------------------------</span> <a name="l00444"></a>00444 <span class="keywordtype">void</span> KMMsgPartDialogCompat::slotOk() <a name="l00445"></a>00445 { <a name="l00446"></a>00446 <a class="code" href="classKMMsgPartDialogCompat.html#d9aab0b2e40bb42f900d2d375d577b33" title="Applies changes from the dialog to the message part.">applyChanges</a>(); <a name="l00447"></a>00447 KMMsgPartDialog::slotOk(); <a name="l00448"></a>00448 } <a name="l00449"></a>00449 <a name="l00450"></a>00450 <a name="l00451"></a>00451 <span class="comment">//-----------------------------------------------------------------------------</span> <a name="l00452"></a>00452 <span class="preprocessor">#include "kmmsgpartdlg.moc"</span> </pre></div></div> </div></div> </td> </tr> <tr> <td valign="top" id="leftmenu" width="25%"> <a name="navigation"></a> <div class="menu_box"><h2>kmail</h2> <div class="nav_list"> <ul><li><a href="index.html">Main Page</a></li><li><a href="namespaces.html">Namespace List</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="namespacemembers.html">Namespace Members</a></li><li><a href="functions.html">Class Members</a></li><li><a href="pages.html">Related Pages</a></li></ul> <!-- <h2>Class Picker</h2> <div style="text-align: center;"> <form name="guideform"> <select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value"> <option value="annotated.html">-- Choose --</option> <option value="classAccountUpdater.html">accountupdater</option>, <option value="classAttachmentModifyCommand.html">attachmentmodifycommand</option>, <option value="classFolderStorage.html">folderstorage</option>, <option value="classKCursorSaver.html">kcursorsaver</option>, <option value="classKleo_1_1KeyResolver.html">kleo::keyresolver</option>, <option value="classKListViewIndexedSearchLine.html">klistviewindexedsearchline</option>, <option value="classKMAcctFolder.html">kmacctfolder</option>, <option value="classKMAcctSelDlg.html">kmacctseldlg</option>, <option value="classKMail_1_1AccountComboBox.html">kmail::accountcombobox</option>, <option value="classKMail_1_1AccountManager.html">kmail::accountmanager</option>, <option value="classKMail_1_1ACLEntryDialog.html">kmail::aclentrydialog</option>, <option value="classKMail_1_1ACLJobs_1_1DeleteACLJob.html">kmail::acljobs::deleteacljob</option>, <option value="classKMail_1_1ACLJobs_1_1GetACLJob.html">kmail::acljobs::getacljob</option>, <option value="classKMail_1_1ACLJobs_1_1GetUserRightsJob.html">kmail::acljobs::getuserrightsjob</option>, <option value="classKMail_1_1ACLJobs_1_1MultiSetACLJob.html">kmail::acljobs::multisetacljob</option>, <option value="classKMail_1_1AnnotationJobs_1_1GetAnnotationJob.html">kmail::annotationjobs::getannotationjob</option>, <option value="classKMail_1_1AnnotationJobs_1_1MultiGetAnnotationJob.html">kmail::annotationjobs::multigetannotationjob</option>, <option value="classKMail_1_1AnnotationJobs_1_1MultiSetAnnotationJob.html">kmail::annotationjobs::multisetannotationjob</option>, <option value="classKMail_1_1AnnotationJobs_1_1MultiUrlGetAnnotationJob.html">kmail::annotationjobs::multiurlgetannotationjob</option>, <option value="classKMail_1_1AntiSpamConfig.html">kmail::antispamconfig</option>, <option value="classKMail_1_1AntiSpamWizard.html">kmail::antispamwizard</option>, <option value="classKMail_1_1AntiSpamWizard_1_1ConfigReader.html">kmail::antispamwizard::configreader</option>, <option value="classKMail_1_1AntiSpamWizard_1_1SpamToolConfig.html">kmail::antispamwizard::spamtoolconfig</option>, <option value="classKMail_1_1Callback.html">kmail::callback</option>, <option value="classKMail_1_1CopyFolderJob.html">kmail::copyfolderjob</option>, <option value="classKMail_1_1DictionaryComboBox.html">kmail::dictionarycombobox</option>, <option value="classKMail_1_1EditorWatcher.html">kmail::editorwatcher</option>, <option value="classKMail_1_1FilterImporterExporter.html">kmail::filterimporterexporter</option>, <option value="classKMail_1_1FilterLog.html">kmail::filterlog</option>, <option value="classKMail_1_1FilterLogDialog.html">kmail::filterlogdialog</option>, <option value="classKMail_1_1FolderDiaACLTab.html">kmail::folderdiaacltab</option>, <option value="classKMail_1_1FolderDiaGeneralTab.html">kmail::folderdiageneraltab</option>, <option value="classKMail_1_1FolderDiaQuotaTab.html">kmail::folderdiaquotatab</option>, <option value="classKMail_1_1FolderDiaTab.html">kmail::folderdiatab</option>, <option value="classKMail_1_1FolderDiaTemplatesTab.html">kmail::folderdiatemplatestab</option>, <option value="classKMail_1_1FolderRequester.html">kmail::folderrequester</option>, <option value="classKMail_1_1HeaderItem.html">kmail::headeritem</option>, <option value="classKMail_1_1HeaderStyle.html">kmail::headerstyle</option>, <option value="classKMail_1_1HtmlStatusBar.html">kmail::htmlstatusbar</option>, <option value="classKMail_1_1HtmlWriter.html">kmail::htmlwriter</option>, <option value="classKMail_1_1IdentityDrag.html">kmail::identitydrag</option>, <option value="classKMail_1_1IdentityListView.html">kmail::identitylistview</option>, <option value="classKMail_1_1IdentityListViewItem.html">kmail::identitylistviewitem</option>, <option value="classKMail_1_1Interface_1_1BodyPart.html">kmail::interface::bodypart</option>, <option value="classKMail_1_1Interface_1_1BodyPartFormatterPlugin.html">kmail::interface::bodypartformatterplugin</option>, <option value="classKMail_1_1Interface_1_1BodyPartMemento.html">kmail::interface::bodypartmemento</option>, <option value="classKMail_1_1Interface_1_1BodyPartURLHandler.html">kmail::interface::bodyparturlhandler</option>, <option value="classKMail_1_1Interface_1_1Observable.html">kmail::interface::observable</option>, <option value="classKMail_1_1Interface_1_1Observer.html">kmail::interface::observer</option>, <option value="classKMail_1_1JobScheduler.html">kmail::jobscheduler</option>, <option value="classKMail_1_1ListJob.html">kmail::listjob</option>, <option value="classKMail_1_1MaildirCompactionJob.html">kmail::maildircompactionjob</option>, <option value="classKMail_1_1MailingList.html">kmail::mailinglist</option>, <option value="classKMail_1_1MboxCompactionJob.html">kmail::mboxcompactionjob</option>, <option value="classKMail_1_1MessageActions.html">kmail::messageactions</option>, <option value="classKMail_1_1MessageCopyHelper.html">kmail::messagecopyhelper</option>, <option value="classKMail_1_1PartNodeBodyPart.html">kmail::partnodebodypart</option>, <option value="classKMail_1_1PopAccount.html">kmail::popaccount</option>, <option value="classKMail_1_1QuotaJobs_1_1GetQuotarootJob.html">kmail::quotajobs::getquotarootjob</option>, <option value="classKMail_1_1QuotaJobs_1_1GetStorageQuotaJob.html">kmail::quotajobs::getstoragequotajob</option>, <option value="classKMail_1_1RedirectDialog.html">kmail::redirectdialog</option>, <option value="classKMail_1_1RenameJob.html">kmail::renamejob</option>, <option value="classKMail_1_1RuleWidgetHandler.html">kmail::rulewidgethandler</option>, <option value="classKMail_1_1RuleWidgetHandlerManager.html">kmail::rulewidgethandlermanager</option>, <option value="classKMail_1_1ScheduledCompactionTask.html">kmail::scheduledcompactiontask</option>, <option value="classKMail_1_1ScheduledExpireTask.html">kmail::scheduledexpiretask</option>, <option value="classKMail_1_1ScheduledJob.html">kmail::scheduledjob</option>, <option value="classKMail_1_1ScheduledTask.html">kmail::scheduledtask</option>, <option value="classKMail_1_1SearchJob.html">kmail::searchjob</option>, <option value="classKMail_1_1SearchWindow.html">kmail::searchwindow</option>, <option value="classKMail_1_1SecondaryWindow.html">kmail::secondarywindow</option>, <option value="classKMail_1_1SieveDebugDialog.html">kmail::sievedebugdialog</option>, <option value="classKMail_1_1SortCacheItem.html">kmail::sortcacheitem</option>, <option value="classKMail_1_1SpamHeaderAnalyzer.html">kmail::spamheaderanalyzer</option>, <option value="classKMail_1_1SpamScore.html">kmail::spamscore</option>, <option value="classKMail_1_1TeeHtmlWriter.html">kmail::teehtmlwriter</option>, <option value="classKMail_1_1TransportManager.html">kmail::transportmanager</option>, <option value="classKMail_1_1UndoInfo.html">kmail::undoinfo</option>, <option value="classKMail_1_1URLHandler.html">kmail::urlhandler</option>, <option value="classKMail_1_1URLHandlerManager.html">kmail::urlhandlermanager</option>, <option value="classKMail_1_1Util_1_1LaterDeleter.html">kmail::util::laterdeleter</option>, <option value="classKMailICalIfaceImpl.html">kmailicalifaceimpl</option>, <option value="classKMailIface.html">kmailiface</option>, <option value="classKMDict.html">kmdict</option>, <option value="classKMDictItem.html">kmdictitem</option>, <option value="classKMFilterAction.html">kmfilteraction</option>, <option value="classKMFilterActionDict.html">kmfilteractiondict</option>, <option value="classKMFilterActionWidget.html">kmfilteractionwidget</option>, <option value="classKMFilterActionWithAddress.html">kmfilteractionwithaddress</option>, <option value="classKMFilterActionWithFolder.html">kmfilteractionwithfolder</option>, <option value="classKMFilterActionWithNone.html">kmfilteractionwithnone</option>, <option value="classKMFilterActionWithString.html">kmfilteractionwithstring</option>, <option value="classKMFilterActionWithStringList.html">kmfilteractionwithstringlist</option>, <option value="classKMFilterActionWithUOID.html">kmfilteractionwithuoid</option>, <option value="classKMFilterActionWithUrl.html">kmfilteractionwithurl</option>, <option value="classKMFilterDlg.html">kmfilterdlg</option>, <option value="classKMFilterListBox.html">kmfilterlistbox</option>, <option value="classKMFolder.html">kmfolder</option>, <option value="classKMFolderDialog.html">kmfolderdialog</option>, <option value="classKMFolderDir.html">kmfolderdir</option>, <option value="classKMFolderIndex.html">kmfolderindex</option>, <option value="classKMFolderOpener.html">kmfolderopener</option>, <option value="classKMHeaders.html">kmheaders</option>, <option value="classKMKernel.html">kmkernel</option>, <option value="classKMMenuCommand.html">kmmenucommand</option>, <option value="classKMMessage.html">kmmessage</option>, <option value="classKMMsgDict.html">kmmsgdict</option>, <option value="classKMMsgList.html">kmmsglist</option>, <option value="classKMMsgPartDialog.html">kmmsgpartdialog</option>, <option value="classKMMsgPartDialogCompat.html">kmmsgpartdialogcompat</option>, <option value="classKMPopHeadersView.html">kmpopheadersview</option>, <option value="classKMReaderWin.html">kmreaderwin</option>, <option value="classKMSearchPattern.html">kmsearchpattern</option>, <option value="classKMSearchPatternEdit.html">kmsearchpatternedit</option>, <option value="classKMSearchRule.html">kmsearchrule</option>, <option value="classKMSearchRuleNumerical.html">kmsearchrulenumerical</option>, <option value="classKMSearchRuleStatus.html">kmsearchrulestatus</option>, <option value="classKMSearchRuleString.html">kmsearchrulestring</option>, <option value="classKMSearchRuleWidget.html">kmsearchrulewidget</option>, <option value="classKMSystemTray.html">kmsystemtray</option>, <option value="classMailComposerIface.html">mailcomposeriface</option>, <option value="classScalix_1_1FolderAttributeParser.html">scalix::folderattributeparser</option>, <option value="classSnippetConfig.html">snippetconfig</option>, <option value="classSnippetGroup.html">snippetgroup</option>, <option value="classSnippetItem.html">snippetitem</option>, <option value="classSnippetSettings.html">snippetsettings</option>, <option value="classSnippetWidget.html">snippetwidget</option>, </select> </form> </div> --> </div></div> <div class="menu_box"><h2>API Dox</h2> <div class="nav_list"> <ul> <li><a href="../../akregator/html/index.html">akregator</a></li><li> <a href="../../akregator/src/html/index.html">src</a></li><li> <a href="../../akregator/src/librss/html/index.html">librss</a></li><li><a href="../../certmanager/html/index.html">certmanager</a></li><li> <a href="../../certmanager/lib/html/index.html">lib</a></li><li><a href="../../kaddressbook/html/index.html">kaddressbook</a></li><li><a href="../../kalarm/html/index.html">kalarm</a></li><li> <a href="../../kalarm/lib/html/index.html">lib</a></li><li><a href="../../kandy/html/index.html">kandy</a></li><li><a href="../../karm/html/index.html">karm</a></li><li><a href="../../kdgantt/html/index.html">kdgantt</a></li><li><a href="../../kgantt/html/index.html">kgantt</a></li><li><a href="../../kioslaves/html/index.html">kioslaves</a></li><li> <a href="../../kioslaves/imap4/html/index.html">imap4</a></li><li> <a href="../../kioslaves/mbox/html/index.html">mbox</a></li><li><a href="../../kitchensync/html/index.html">kitchensync</a></li><li><a href="../../kmail/html/index.html">kmail</a></li><li><a href="../../knotes/html/index.html">knotes</a></li><li><a href="../../konsolekalendar/html/index.html">konsolekalendar</a></li><li><a href="../../kontact/html/index.html">kontact</a></li><li><a href="../../korganizer/html/index.html">korganizer</a></li><li><a href="../../kpilot/html/index.html">kpilot</a></li><li> <a href="../../kpilot/kpilot/html/index.html">kpilot</a></li><li> <a href="../../kpilot/lib/html/index.html">lib</a></li><li><a href="../../libemailfunctions/html/index.html">libemailfunctions</a></li><li><a href="../../libkcal/html/index.html">libkcal</a></li><li><a href="../../libkdepim/html/index.html">libkdepim</a></li><li><a href="../../libkholidays/html/index.html">libkholidays</a></li><li><a href="../../libkmime/html/index.html">libkmime</a></li><li><a href="../../libkpgp/html/index.html">libkpgp</a></li><li><a href="../../libkpimidentities/html/index.html">libkpimidentities</a></li> </ul></div></div> </td> </tr> </table> <span class="doNotDisplay"> <a href="http://www.kde.org/" accesskey="8">KDE Home</a> | <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> | <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a> </span> <div style="height: 8px"></div> <div id="footer"> <div id="footer_left"> Maintained by <a href="mailto:groot@kde.org">Adriaan de Groot</a> and <a href="mailto:winter@kde.org">Allen Winter</a>. <br/> KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> | <a href="http://www.kde.org/contact/impressum.php">Legal</a> </div> <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div> </div> <!-- WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL BE BLOCKED INSTANTLY AND PERMANENTLY! <a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a> WARNING END --> </body> </html>