1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt examples: AttachmentEdit Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>AttachmentEdit Class Reference<br>
<small>
[<a class="el" href="group__composerexample.html">Composer example</a>]</small>
</h1><!-- doxytag: class="AttachmentEdit" --><!-- doxytag: inherits="Wt::WContainerWidget" -->An edit field for an email attachment.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>></code>
<p>
<div class="dynheader">
Inheritance diagram for AttachmentEdit:</div>
<div class="dynsection">
<p><center><img src="classAttachmentEdit__inherit__graph.png" border="0" usemap="#AttachmentEdit__inherit__map" alt="Inheritance graph"></center>
<map name="AttachmentEdit__inherit__map">
<area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html" title="Wt::WContainerWidget" alt="" coords="5,304,157,331"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html" title="Wt::WInteractWidget" alt="" coords="11,229,152,256"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html" title="Wt::WWebWidget" alt="" coords="20,155,143,181"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html" title="Wt::WWidget" alt="" coords="33,80,129,107"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WObject.html" title="Wt::WObject" alt="" coords="33,5,129,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
<p>
<a href="classAttachmentEdit-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#edd19941ecf64ef030eaa164eb34b85a">AttachmentEdit</a> (<a class="el" href="classComposer.html">Composer</a> *composer, <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *<a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#3461e31818c4d2f516641bdaf508312a">parent</a>=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an attachment edit field. <a href="#edd19941ecf64ef030eaa164eb34b85a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#6f3f515115ee196e625766400180d4b4">~AttachmentEdit</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#172fff67913dc3e3adf8c1e4198d6ea6">uploadNow</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Update the file now. <a href="#172fff67913dc3e3adf8c1e4198d6ea6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#dc4314df22d6fa1598acebe62726a464">uploadFailed</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return whether the upload failed. <a href="#dc4314df22d6fa1598acebe62726a464"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#780f87ad49249e38bf60f2560afd9789">include</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return whether this attachment must be included in the message. <a href="#780f87ad49249e38bf60f2560afd9789"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classAttachment.html">Attachment</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#b0212edb4c861593672381f746389410">attachment</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the attachment. <a href="#b0212edb4c861593672381f746389410"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html">Signal</a>< void > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#8e8ec2b62906eb6137b1a505a6ba0306">uploadDone</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Signal emitted when a new attachment has been uploaded (or failed to upload. <a href="#8e8ec2b62906eb6137b1a505a6ba0306"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Slots</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#85d6892fe9c38394d17dc350ce678acd">uploaded</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Slot triggered when the WFileUpload completed an upload. <a href="#85d6892fe9c38394d17dc350ce678acd"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#9f7b53df9b2342f38984832f1d2430eb">fileTooLarge</a> (int size)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Slot triggered when the WFileUpload received an oversized file. <a href="#9f7b53df9b2342f38984832f1d2430eb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#27277be62832ebbda987707b7a2d814e">remove</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Slot triggered when the users wishes to remove this attachment edit. <a href="#27277be62832ebbda987707b7a2d814e"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classComposer.html">Composer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#403927978e9c841e64b62421458790e8">composer_</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html">Signal</a>< void > </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#24ee0aca670036a7491a1c0114188cc7">uploadDone_</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html">WFileUpload</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430">upload_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The WFileUpload control. <a href="#a9a3945293cf0a30d35e8bc56312d430"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#ce5c155b8749314f50ca2ba4a46c6e56">uploaded_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The text describing the uploaded file. <a href="#ce5c155b8749314f50ca2ba4a46c6e56"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WCheckBox.html">WCheckBox</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#ca36a743220d5663d340840cdb38f7ce">keep_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The check box to keep or discard the uploaded file. <a href="#ca36a743220d5663d340840cdb38f7ce"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classOption.html">Option</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#55484424d37b196d07035e245399ffae">remove_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The option to remove the file. <a href="#55484424d37b196d07035e245399ffae"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#2c3fa5d63ec5feedc63f95295989cd4d">error_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The text box to display an error (empty or too big file). <a href="#2c3fa5d63ec5feedc63f95295989cd4d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#6a19f364e7a82797bc5c18adb6a01530">uploadFailed_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The state of the last upload process. <a href="#6a19f364e7a82797bc5c18adb6a01530"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::wstring </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#06536f7028735943c69325ebe33eec82">fileName_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The filename of the uploaded file. <a href="#06536f7028735943c69325ebe33eec82"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#86af04b8e5ebcdf2bdbd94a92847e6da">spoolFileName_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The filename of the local spool file. <a href="#86af04b8e5ebcdf2bdbd94a92847e6da"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::wstring </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#b9d9406dda4396e37b53a77a6e6fa861">contentDescription_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The content description that was sent along with the file. <a href="#b9d9406dda4396e37b53a77a6e6fa861"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttachmentEdit.html#3b94f0070aa893cbae3459f2a930bc09">taken_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Whether the spool file is "taken" and is no longer managed by the edit. <a href="#3b94f0070aa893cbae3459f2a930bc09"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
An edit field for an email attachment.
<p>
This widget managements one attachment edit: it shows a file upload control, handles the upload, and gives feed-back on the file uploaded.<p>
This widget is part of the Wt composer example.
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00037">37</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="edd19941ecf64ef030eaa164eb34b85a"></a><!-- doxytag: member="AttachmentEdit::AttachmentEdit" ref="edd19941ecf64ef030eaa164eb34b85a" args="(Composer *composer, WContainerWidget *parent=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">AttachmentEdit::AttachmentEdit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classComposer.html">Composer</a> * </td>
<td class="paramname"> <em>composer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> * </td>
<td class="paramname"> <em>parent</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create an attachment edit field.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8C-source.html#l00026">26</a> of file <a class="el" href="AttachmentEdit_8C-source.html">AttachmentEdit.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00027"></a>00027 : <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#520ba6e52a36a7f2efbef1a31a69e898">WContainerWidget</a>(parent),
<a name="l00028"></a>00028 <a class="code" href="classAttachmentEdit.html#403927978e9c841e64b62421458790e8">composer_</a>(composer),
<a name="l00029"></a>00029 <a class="code" href="classAttachmentEdit.html#24ee0aca670036a7491a1c0114188cc7">uploadDone_</a>(<span class="keyword">this</span>),
<a name="l00030"></a>00030 <a class="code" href="classAttachmentEdit.html#6a19f364e7a82797bc5c18adb6a01530" title="The state of the last upload process.">uploadFailed_</a>(<span class="keyword">false</span>),
<a name="l00031"></a>00031 <a class="code" href="classAttachmentEdit.html#3b94f0070aa893cbae3459f2a930bc09" title="Whether the spool file is &quot;taken&quot; and is no longer managed by the edit...">taken_</a>(<span class="keyword">false</span>)
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 <span class="comment">/*</span>
<a name="l00034"></a>00034 <span class="comment"> * The file upload itself.</span>
<a name="l00035"></a>00035 <span class="comment"> */</span>
<a name="l00036"></a>00036 <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html">WFileUpload</a>(<span class="keyword">this</span>);
<a name="l00037"></a>00037 <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#c7ad1324c86d378da9da9740a631a662">setFileTextSize</a>(40);
<a name="l00038"></a>00038
<a name="l00039"></a>00039 <span class="comment">/*</span>
<a name="l00040"></a>00040 <span class="comment"> * The 'remove' option.</span>
<a name="l00041"></a>00041 <span class="comment"> */</span>
<a name="l00042"></a>00042 <a class="code" href="classAttachmentEdit.html#55484424d37b196d07035e245399ffae" title="The option to remove the file.">remove_</a> = <span class="keyword">new</span> <a class="code" href="classOption.html" title="A clickable option.">Option</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#a651f107ec7cf080faef6c435705fc44">tr</a>(<span class="stringliteral">"msg.remove"</span>), <span class="keyword">this</span>);
<a name="l00043"></a>00043 <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#ee0157eb927635094425c6f91cc7bd16">decorationStyle</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WCssDecorationStyle.html#5e552350f0955212ea237994a98638dc">font</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFont.html#d449c8c5c3b78e66d51fe6db0c0b9d58">setSize</a>(WFont::Smaller);
<a name="l00044"></a>00044 <a class="code" href="classAttachmentEdit.html#55484424d37b196d07035e245399ffae" title="The option to remove the file.">remove_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#07719d06da0dd17af2381c663e8fb0b7">setMargin</a>(5, Left);
<a name="l00045"></a>00045 <a class="code" href="classAttachmentEdit.html#55484424d37b196d07035e245399ffae" title="The option to remove the file.">remove_</a>-><a class="code" href="classOption.html#31cd766f28605ceba53642d7d4e68c9e" title="Returns the clickable part.">item</a>()-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html#e11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(SLOT(<span class="keyword">this</span>, WWidget::hide));
<a name="l00046"></a>00046 <a class="code" href="classAttachmentEdit.html#55484424d37b196d07035e245399ffae" title="The option to remove the file.">remove_</a>-><a class="code" href="classOption.html#31cd766f28605ceba53642d7d4e68c9e" title="Returns the clickable part.">item</a>()-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html#e11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(SLOT(<span class="keyword">this</span>, <a class="code" href="classAttachmentEdit.html#27277be62832ebbda987707b7a2d814e" title="Slot triggered when the users wishes to remove this attachment edit.">AttachmentEdit::remove</a>));
<a name="l00047"></a>00047
<a name="l00048"></a>00048 <span class="comment">/*</span>
<a name="l00049"></a>00049 <span class="comment"> * Fields that will display the feedback.</span>
<a name="l00050"></a>00050 <span class="comment"> */</span>
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="comment">// The check box to include or exclude the attachment.</span>
<a name="l00053"></a>00053 <a class="code" href="classAttachmentEdit.html#ca36a743220d5663d340840cdb38f7ce" title="The check box to keep or discard the uploaded file.">keep_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WCheckBox.html">WCheckBox</a>(<span class="keyword">this</span>);
<a name="l00054"></a>00054 <a class="code" href="classAttachmentEdit.html#ca36a743220d5663d340840cdb38f7ce" title="The check box to keep or discard the uploaded file.">keep_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#0825c3ccbd4999afc1a88fafa6aa6fc7">hide</a>();
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="comment">// The uploaded file information.</span>
<a name="l00057"></a>00057 <a class="code" href="classAttachmentEdit.html#ce5c155b8749314f50ca2ba4a46c6e56" title="The text describing the uploaded file.">uploaded_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">""</span>, <span class="keyword">this</span>);
<a name="l00058"></a>00058 <a class="code" href="classAttachmentEdit.html#ce5c155b8749314f50ca2ba4a46c6e56" title="The text describing the uploaded file.">uploaded_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#6fd43dced1a62f7e79bc3522eeb16216">setStyleClass</a>(<span class="stringliteral">"option"</span>);
<a name="l00059"></a>00059 <a class="code" href="classAttachmentEdit.html#ce5c155b8749314f50ca2ba4a46c6e56" title="The text describing the uploaded file.">uploaded_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#0825c3ccbd4999afc1a88fafa6aa6fc7">hide</a>();
<a name="l00060"></a>00060
<a name="l00061"></a>00061 <span class="comment">// The error message.</span>
<a name="l00062"></a>00062 <a class="code" href="classAttachmentEdit.html#2c3fa5d63ec5feedc63f95295989cd4d" title="The text box to display an error (empty or too big file).">error_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">""</span>, <span class="keyword">this</span>);
<a name="l00063"></a>00063 <a class="code" href="classAttachmentEdit.html#2c3fa5d63ec5feedc63f95295989cd4d" title="The text box to display an error (empty or too big file).">error_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#6fd43dced1a62f7e79bc3522eeb16216">setStyleClass</a>(<span class="stringliteral">"error"</span>);
<a name="l00064"></a>00064 <a class="code" href="classAttachmentEdit.html#2c3fa5d63ec5feedc63f95295989cd4d" title="The text box to display an error (empty or too big file).">error_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#07719d06da0dd17af2381c663e8fb0b7">setMargin</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLength.html">WLength</a>(5), Left);
<a name="l00065"></a>00065
<a name="l00066"></a>00066 <span class="comment">/*</span>
<a name="l00067"></a>00067 <span class="comment"> * React to events.</span>
<a name="l00068"></a>00068 <span class="comment"> */</span>
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="comment">// Try to catch the fileupload change signal to trigger an upload.</span>
<a name="l00071"></a>00071 <span class="comment">// We could do like google and at a delay with a WTimer as well...</span>
<a name="l00072"></a>00072 <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#3abaf94bdba04e7833aa18bc7e8d0f40">changed</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1EventSignal.html#6efcb92576b5aa846a3354dd26918a9f">connect</a>(SLOT(<a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>, WFileUpload::upload));
<a name="l00073"></a>00073
<a name="l00074"></a>00074 <span class="comment">// React to a succesfull upload.</span>
<a name="l00075"></a>00075 <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#acb4622c8cd83d1635a8c0db13c8c0fe">uploaded</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1EventSignal.html#6efcb92576b5aa846a3354dd26918a9f">connect</a>(SLOT(<span class="keyword">this</span>, <a class="code" href="classAttachmentEdit.html#85d6892fe9c38394d17dc350ce678acd" title="Slot triggered when the WFileUpload completed an upload.">AttachmentEdit::uploaded</a>));
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="comment">// React to a fileupload problem.</span>
<a name="l00078"></a>00078 <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#29dc78a0162c676f7b72904d595440d8">fileTooLarge</a>().connect(SLOT(<span class="keyword">this</span>, <a class="code" href="classAttachmentEdit.html#9f7b53df9b2342f38984832f1d2430eb" title="Slot triggered when the WFileUpload received an oversized file.">AttachmentEdit::fileTooLarge</a>));
<a name="l00079"></a>00079
<a name="l00080"></a>00080 <span class="comment">/*</span>
<a name="l00081"></a>00081 <span class="comment"> * Connect the uploadDone signal to the Composer's attachmentDone,</span>
<a name="l00082"></a>00082 <span class="comment"> * so that the Composer can keep track of attachment upload progress,</span>
<a name="l00083"></a>00083 <span class="comment"> * if it wishes.</span>
<a name="l00084"></a>00084 <span class="comment"> */</span>
<a name="l00085"></a>00085 <a class="code" href="classAttachmentEdit.html#24ee0aca670036a7491a1c0114188cc7">uploadDone_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html#6fc9536d2e7f59684ec32f3734b01f38">connect</a>(SLOT(composer, <a class="code" href="classComposer.html#aa2db4aef750f6533c53af1189c92144" title="Slotcalled when an attachment has been uploaded.">Composer::attachmentDone</a>));
<a name="l00086"></a>00086 }
</pre></div>
<p>
</div>
</div><p>
<a class="anchor" name="6f3f515115ee196e625766400180d4b4"></a><!-- doxytag: member="AttachmentEdit::~AttachmentEdit" ref="6f3f515115ee196e625766400180d4b4" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">AttachmentEdit::~AttachmentEdit </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8C-source.html#l00088">88</a> of file <a class="el" href="AttachmentEdit_8C-source.html">AttachmentEdit.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00089"></a>00089 {
<a name="l00090"></a>00090 <span class="comment">// delete the local attachment file copy, if it was not taken from us.</span>
<a name="l00091"></a>00091 <span class="keywordflow">if</span> (!<a class="code" href="classAttachmentEdit.html#3b94f0070aa893cbae3459f2a930bc09" title="Whether the spool file is &quot;taken&quot; and is no longer managed by the edit...">taken_</a>)
<a name="l00092"></a>00092 unlink(<a class="code" href="classAttachmentEdit.html#86af04b8e5ebcdf2bdbd94a92847e6da" title="The filename of the local spool file.">spoolFileName_</a>.c_str());
<a name="l00093"></a>00093 }
</pre></div>
<p>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="172fff67913dc3e3adf8c1e4198d6ea6"></a><!-- doxytag: member="AttachmentEdit::uploadNow" ref="172fff67913dc3e3adf8c1e4198d6ea6" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool AttachmentEdit::uploadNow </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Update the file now.
<p>
Returns whether a new file will be uploaded. If so, the uploadDone signal will be signalled when the file is uploaded (or failed to upload).
<p>Definition at line <a class="el" href="AttachmentEdit_8C-source.html#l00095">95</a> of file <a class="el" href="AttachmentEdit_8C-source.html">AttachmentEdit.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00096"></a>00096 {
<a name="l00097"></a>00097 <span class="comment">/*</span>
<a name="l00098"></a>00098 <span class="comment"> * See if this attachment still needs to be uploaded,</span>
<a name="l00099"></a>00099 <span class="comment"> * and return if a new asynchronous upload is started.</span>
<a name="l00100"></a>00100 <span class="comment"> */</span>
<a name="l00101"></a>00101 <span class="keywordflow">if</span> (<a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>) {
<a name="l00102"></a>00102 <span class="keywordflow">if</span> (<a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#66376fb4668a037760a91abad9f83f8a">canUpload</a>()) {
<a name="l00103"></a>00103 <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#c17094f2fd6ae8cac1035161f7d80b9c">upload</a>();
<a name="l00104"></a>00104 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00105"></a>00105 } <span class="keywordflow">else</span>
<a name="l00106"></a>00106 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00107"></a>00107 } <span class="keywordflow">else</span>
<a name="l00108"></a>00108 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00109"></a>00109 }
</pre></div>
<p>
</div>
</div><p>
<a class="anchor" name="dc4314df22d6fa1598acebe62726a464"></a><!-- doxytag: member="AttachmentEdit::uploadFailed" ref="dc4314df22d6fa1598acebe62726a464" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool AttachmentEdit::uploadFailed </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return whether the upload failed.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00055">55</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00055"></a>00055 { <span class="keywordflow">return</span> <a class="code" href="classAttachmentEdit.html#6a19f364e7a82797bc5c18adb6a01530" title="The state of the last upload process.">uploadFailed_</a>; }
</pre></div>
<p>
</div>
</div><p>
<a class="anchor" name="780f87ad49249e38bf60f2560afd9789"></a><!-- doxytag: member="AttachmentEdit::include" ref="780f87ad49249e38bf60f2560afd9789" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool AttachmentEdit::include </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return whether this attachment must be included in the message.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8C-source.html#l00179">179</a> of file <a class="el" href="AttachmentEdit_8C-source.html">AttachmentEdit.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00180"></a>00180 {
<a name="l00181"></a>00181 <span class="keywordflow">return</span> <a class="code" href="classAttachmentEdit.html#ca36a743220d5663d340840cdb38f7ce" title="The check box to keep or discard the uploaded file.">keep_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractToggleButton.html#bd40ce7a6c4b4e924c9097015f4971ea">isChecked</a>();
<a name="l00182"></a>00182 }
</pre></div>
<p>
</div>
</div><p>
<a class="anchor" name="b0212edb4c861593672381f746389410"></a><!-- doxytag: member="AttachmentEdit::attachment" ref="b0212edb4c861593672381f746389410" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classAttachment.html">Attachment</a> AttachmentEdit::attachment </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return the attachment.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8C-source.html#l00184">184</a> of file <a class="el" href="AttachmentEdit_8C-source.html">AttachmentEdit.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00185"></a>00185 {
<a name="l00186"></a>00186 <a class="code" href="classAttachmentEdit.html#3b94f0070aa893cbae3459f2a930bc09" title="Whether the spool file is &quot;taken&quot; and is no longer managed by the edit...">taken_</a> = <span class="keyword">true</span>;
<a name="l00187"></a>00187 <span class="keywordflow">return</span> <a class="code" href="classAttachment.html" title="An email attachment.">Attachment</a>(<a class="code" href="classAttachmentEdit.html#06536f7028735943c69325ebe33eec82" title="The filename of the uploaded file.">fileName_</a>, <a class="code" href="classAttachmentEdit.html#b9d9406dda4396e37b53a77a6e6fa861" title="The content description that was sent along with the file.">contentDescription_</a>, <a class="code" href="classAttachmentEdit.html#86af04b8e5ebcdf2bdbd94a92847e6da" title="The filename of the local spool file.">spoolFileName_</a>);
<a name="l00188"></a>00188 }
</pre></div>
<p>
</div>
</div><p>
<a class="anchor" name="8e8ec2b62906eb6137b1a505a6ba0306"></a><!-- doxytag: member="AttachmentEdit::uploadDone" ref="8e8ec2b62906eb6137b1a505a6ba0306" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html">Signal</a><void>& AttachmentEdit::uploadDone </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Signal emitted when a new attachment has been uploaded (or failed to upload.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00068">68</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00068"></a>00068 { <span class="keywordflow">return</span> <a class="code" href="classAttachmentEdit.html#24ee0aca670036a7491a1c0114188cc7">uploadDone_</a>; }
</pre></div>
<p>
</div>
</div><p>
<a class="anchor" name="85d6892fe9c38394d17dc350ce678acd"></a><!-- doxytag: member="AttachmentEdit::uploaded" ref="85d6892fe9c38394d17dc350ce678acd" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AttachmentEdit::uploaded </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td><code> [private, slot]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Slot triggered when the WFileUpload completed an upload.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8C-source.html#l00111">111</a> of file <a class="el" href="AttachmentEdit_8C-source.html">AttachmentEdit.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00112"></a>00112 {
<a name="l00113"></a>00113 <span class="keywordflow">if</span> (!<a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#4207ca5ea74962583d146409301c3416">emptyFileName</a>()) {
<a name="l00114"></a>00114 <a class="code" href="classAttachmentEdit.html#06536f7028735943c69325ebe33eec82" title="The filename of the uploaded file.">fileName_</a> = <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#8fc5e7671594ffd178e0930554e85f15">clientFileName</a>();
<a name="l00115"></a>00115 <a class="code" href="classAttachmentEdit.html#86af04b8e5ebcdf2bdbd94a92847e6da" title="The filename of the local spool file.">spoolFileName_</a> = <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#98bff1bc07a5d59086455a45805e43bf">spoolFileName</a>();
<a name="l00116"></a>00116 <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#541d634e9f9e546f59417682811f01ef">stealSpooledFile</a>();
<a name="l00117"></a>00117 <a class="code" href="classAttachmentEdit.html#b9d9406dda4396e37b53a77a6e6fa861" title="The content description that was sent along with the file.">contentDescription_</a> = <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html#fc6902cab1ca352a06687f900f2839aa">contentDescription</a>();
<a name="l00118"></a>00118
<a name="l00119"></a>00119 <span class="comment">/*</span>
<a name="l00120"></a>00120 <span class="comment"> * Delete this widgets since we have a succesfull upload.</span>
<a name="l00121"></a>00121 <span class="comment"> */</span>
<a name="l00122"></a>00122 <span class="keyword">delete</span> <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a>;
<a name="l00123"></a>00123 <a class="code" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430" title="The WFileUpload control.">upload_</a> = 0;
<a name="l00124"></a>00124 <span class="keyword">delete</span> <a class="code" href="classAttachmentEdit.html#55484424d37b196d07035e245399ffae" title="The option to remove the file.">remove_</a>;
<a name="l00125"></a>00125 <a class="code" href="classAttachmentEdit.html#55484424d37b196d07035e245399ffae" title="The option to remove the file.">remove_</a> = 0;
<a name="l00126"></a>00126
<a name="l00127"></a>00127 <a class="code" href="classAttachmentEdit.html#2c3fa5d63ec5feedc63f95295989cd4d" title="The text box to display an error (empty or too big file).">error_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6">setText</a>(<span class="stringliteral">""</span>);
<a name="l00128"></a>00128
<a name="l00129"></a>00129 <span class="comment">/*</span>
<a name="l00130"></a>00130 <span class="comment"> * Include the file ?</span>
<a name="l00131"></a>00131 <span class="comment"> */</span>
<a name="l00132"></a>00132 <a class="code" href="classAttachmentEdit.html#ca36a743220d5663d340840cdb38f7ce" title="The check box to keep or discard the uploaded file.">keep_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#52dcef5a385ddfa0a8c3e6c20000f181">show</a>();
<a name="l00133"></a>00133 <a class="code" href="classAttachmentEdit.html#ca36a743220d5663d340840cdb38f7ce" title="The check box to keep or discard the uploaded file.">keep_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractToggleButton.html#6838c9a37f3e9e3c466e9f48bde55e62">setChecked</a>();
<a name="l00134"></a>00134
<a name="l00135"></a>00135 <span class="comment">/*</span>
<a name="l00136"></a>00136 <span class="comment"> * Give information on the file uploaded.</span>
<a name="l00137"></a>00137 <span class="comment"> */</span>
<a name="l00138"></a>00138 <span class="keyword">struct </span>stat buf;
<a name="l00139"></a>00139 stat(<a class="code" href="classAttachmentEdit.html#86af04b8e5ebcdf2bdbd94a92847e6da" title="The filename of the local spool file.">spoolFileName_</a>.c_str(), &buf);
<a name="l00140"></a>00140 std::wstring size;
<a name="l00141"></a>00141 <span class="keywordflow">if</span> (buf.st_size < 1024)
<a name="l00142"></a>00142 size = boost::lexical_cast<std::wstring>(buf.st_size) + L<span class="stringliteral">" bytes"</span>;
<a name="l00143"></a>00143 <span class="keywordflow">else</span>
<a name="l00144"></a>00144 size = boost::lexical_cast<std::wstring>((int)(buf.st_size / 1024))
<a name="l00145"></a>00145 + L<span class="stringliteral">"kb"</span>;
<a name="l00146"></a>00146
<a name="l00147"></a>00147 <a class="code" href="classAttachmentEdit.html#ce5c155b8749314f50ca2ba4a46c6e56" title="The text describing the uploaded file.">uploaded_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6">setText</a>(static_cast<std::wstring>(<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#94abba3bda8fc934ae86db54c577b428">escapeText</a>(<a class="code" href="classAttachmentEdit.html#06536f7028735943c69325ebe33eec82" title="The filename of the uploaded file.">fileName_</a>))
<a name="l00148"></a>00148 + L<span class="stringliteral">" (<i>"</span> + <a class="code" href="classAttachmentEdit.html#b9d9406dda4396e37b53a77a6e6fa861" title="The content description that was sent along with the file.">contentDescription_</a> + L<span class="stringliteral">"</i>) "</span> + size);
<a name="l00149"></a>00149 <a class="code" href="classAttachmentEdit.html#ce5c155b8749314f50ca2ba4a46c6e56" title="The text describing the uploaded file.">uploaded_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#52dcef5a385ddfa0a8c3e6c20000f181">show</a>();
<a name="l00150"></a>00150
<a name="l00151"></a>00151 <a class="code" href="classAttachmentEdit.html#6a19f364e7a82797bc5c18adb6a01530" title="The state of the last upload process.">uploadFailed_</a> = <span class="keyword">false</span>;
<a name="l00152"></a>00152 } <span class="keywordflow">else</span> {
<a name="l00153"></a>00153 <a class="code" href="classAttachmentEdit.html#2c3fa5d63ec5feedc63f95295989cd4d" title="The text box to display an error (empty or too big file).">error_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6">setText</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#a651f107ec7cf080faef6c435705fc44">tr</a>(<span class="stringliteral">"msg.file-empty"</span>));
<a name="l00154"></a>00154 <a class="code" href="classAttachmentEdit.html#6a19f364e7a82797bc5c18adb6a01530" title="The state of the last upload process.">uploadFailed_</a> = <span class="keyword">true</span>;
<a name="l00155"></a>00155 }
<a name="l00156"></a>00156
<a name="l00157"></a>00157 <span class="comment">/*</span>
<a name="l00158"></a>00158 <span class="comment"> * Signal to the Composer that a new asyncrhonous file upload was processed.</span>
<a name="l00159"></a>00159 <span class="comment"> */</span>
<a name="l00160"></a>00160 <a class="code" href="classAttachmentEdit.html#24ee0aca670036a7491a1c0114188cc7">uploadDone_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html#b9ec97260c79e7b546b7235ad2ffd627">emit</a>();
<a name="l00161"></a>00161 }
</pre></div>
<p>
</div>
</div><p>
<a class="anchor" name="9f7b53df9b2342f38984832f1d2430eb"></a><!-- doxytag: member="AttachmentEdit::fileTooLarge" ref="9f7b53df9b2342f38984832f1d2430eb" args="(int size)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AttachmentEdit::fileTooLarge </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>size</em> </td>
<td> ) </td>
<td><code> [private, slot]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Slot triggered when the WFileUpload received an oversized file.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8C-source.html#l00168">168</a> of file <a class="el" href="AttachmentEdit_8C-source.html">AttachmentEdit.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00169"></a>00169 {
<a name="l00170"></a>00170 <a class="code" href="classAttachmentEdit.html#2c3fa5d63ec5feedc63f95295989cd4d" title="The text box to display an error (empty or too big file).">error_</a>-><a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6">setText</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html#a651f107ec7cf080faef6c435705fc44">tr</a>(<span class="stringliteral">"msg.file-too-large"</span>));
<a name="l00171"></a>00171 <a class="code" href="classAttachmentEdit.html#6a19f364e7a82797bc5c18adb6a01530" title="The state of the last upload process.">uploadFailed_</a> = <span class="keyword">true</span>;
<a name="l00172"></a>00172
<a name="l00173"></a>00173 <span class="comment">/*</span>
<a name="l00174"></a>00174 <span class="comment"> * Signal to the Composer that a new asyncrhonous file upload was processed.</span>
<a name="l00175"></a>00175 <span class="comment"> */</span>
<a name="l00176"></a>00176 <a class="code" href="classAttachmentEdit.html#24ee0aca670036a7491a1c0114188cc7">uploadDone_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html#b9ec97260c79e7b546b7235ad2ffd627">emit</a>();
<a name="l00177"></a>00177 }
</pre></div>
<p>
</div>
</div><p>
<a class="anchor" name="27277be62832ebbda987707b7a2d814e"></a><!-- doxytag: member="AttachmentEdit::remove" ref="27277be62832ebbda987707b7a2d814e" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AttachmentEdit::remove </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td><code> [private, slot]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Slot triggered when the users wishes to remove this attachment edit.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8C-source.html#l00163">163</a> of file <a class="el" href="AttachmentEdit_8C-source.html">AttachmentEdit.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00164"></a>00164 {
<a name="l00165"></a>00165 <a class="code" href="classAttachmentEdit.html#403927978e9c841e64b62421458790e8">composer_</a>-><a class="code" href="classComposer.html#b142f49c8de59da0f84185165eb6c1c1" title="Remove the given attachment edit.">removeAttachment</a>(<span class="keyword">this</span>);
<a name="l00166"></a>00166 }
</pre></div>
<p>
</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="403927978e9c841e64b62421458790e8"></a><!-- doxytag: member="AttachmentEdit::composer_" ref="403927978e9c841e64b62421458790e8" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classComposer.html">Composer</a>* <a class="el" href="classAttachmentEdit.html#403927978e9c841e64b62421458790e8">AttachmentEdit::composer_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00071">71</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="24ee0aca670036a7491a1c0114188cc7"></a><!-- doxytag: member="AttachmentEdit::uploadDone_" ref="24ee0aca670036a7491a1c0114188cc7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html">Signal</a><void> <a class="el" href="classAttachmentEdit.html#24ee0aca670036a7491a1c0114188cc7">AttachmentEdit::uploadDone_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00073">73</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="a9a3945293cf0a30d35e8bc56312d430"></a><!-- doxytag: member="AttachmentEdit::upload_" ref="a9a3945293cf0a30d35e8bc56312d430" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WFileUpload.html">WFileUpload</a>* <a class="el" href="classAttachmentEdit.html#a9a3945293cf0a30d35e8bc56312d430">AttachmentEdit::upload_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The WFileUpload control.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00076">76</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="ce5c155b8749314f50ca2ba4a46c6e56"></a><!-- doxytag: member="AttachmentEdit::uploaded_" ref="ce5c155b8749314f50ca2ba4a46c6e56" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>* <a class="el" href="classAttachmentEdit.html#ce5c155b8749314f50ca2ba4a46c6e56">AttachmentEdit::uploaded_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The text describing the uploaded file.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00079">79</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="ca36a743220d5663d340840cdb38f7ce"></a><!-- doxytag: member="AttachmentEdit::keep_" ref="ca36a743220d5663d340840cdb38f7ce" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WCheckBox.html">WCheckBox</a>* <a class="el" href="classAttachmentEdit.html#ca36a743220d5663d340840cdb38f7ce">AttachmentEdit::keep_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The check box to keep or discard the uploaded file.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00082">82</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="55484424d37b196d07035e245399ffae"></a><!-- doxytag: member="AttachmentEdit::remove_" ref="55484424d37b196d07035e245399ffae" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classOption.html">Option</a>* <a class="el" href="classAttachmentEdit.html#55484424d37b196d07035e245399ffae">AttachmentEdit::remove_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The option to remove the file.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00085">85</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="2c3fa5d63ec5feedc63f95295989cd4d"></a><!-- doxytag: member="AttachmentEdit::error_" ref="2c3fa5d63ec5feedc63f95295989cd4d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>* <a class="el" href="classAttachmentEdit.html#2c3fa5d63ec5feedc63f95295989cd4d">AttachmentEdit::error_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The text box to display an error (empty or too big file).
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00088">88</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="6a19f364e7a82797bc5c18adb6a01530"></a><!-- doxytag: member="AttachmentEdit::uploadFailed_" ref="6a19f364e7a82797bc5c18adb6a01530" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classAttachmentEdit.html#6a19f364e7a82797bc5c18adb6a01530">AttachmentEdit::uploadFailed_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The state of the last upload process.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00091">91</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="06536f7028735943c69325ebe33eec82"></a><!-- doxytag: member="AttachmentEdit::fileName_" ref="06536f7028735943c69325ebe33eec82" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::wstring <a class="el" href="classAttachmentEdit.html#06536f7028735943c69325ebe33eec82">AttachmentEdit::fileName_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The filename of the uploaded file.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00094">94</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="86af04b8e5ebcdf2bdbd94a92847e6da"></a><!-- doxytag: member="AttachmentEdit::spoolFileName_" ref="86af04b8e5ebcdf2bdbd94a92847e6da" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string <a class="el" href="classAttachmentEdit.html#86af04b8e5ebcdf2bdbd94a92847e6da">AttachmentEdit::spoolFileName_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The filename of the local spool file.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00097">97</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="b9d9406dda4396e37b53a77a6e6fa861"></a><!-- doxytag: member="AttachmentEdit::contentDescription_" ref="b9d9406dda4396e37b53a77a6e6fa861" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::wstring <a class="el" href="classAttachmentEdit.html#b9d9406dda4396e37b53a77a6e6fa861">AttachmentEdit::contentDescription_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The content description that was sent along with the file.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00100">100</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<a class="anchor" name="3b94f0070aa893cbae3459f2a930bc09"></a><!-- doxytag: member="AttachmentEdit::taken_" ref="3b94f0070aa893cbae3459f2a930bc09" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classAttachmentEdit.html#3b94f0070aa893cbae3459f2a930bc09">AttachmentEdit::taken_</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Whether the spool file is "taken" and is no longer managed by the edit.
<p>
<p>Definition at line <a class="el" href="AttachmentEdit_8h-source.html#l00103">103</a> of file <a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a>.</p>
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li>/home/koen/project/wt/public-git/wt/examples/composer/<a class="el" href="AttachmentEdit_8h-source.html">AttachmentEdit.h</a><li>/home/koen/project/wt/public-git/wt/examples/composer/<a class="el" href="AttachmentEdit_8C-source.html">AttachmentEdit.C</a></ul>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:12 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>
|