/usr/share/doc/libjuce/apiref/classFileBasedDocument.html is in libjuce-doc 4.3.0~repack-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 | <!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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: FileBasedDocument Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JUCE
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pro-methods">Protected Member Functions</a> |
<a href="classFileBasedDocument-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">FileBasedDocument Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>A class to take care of the logic involved with the loading/saving of some kind of document.
<a href="classFileBasedDocument.html#details">More...</a></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for FileBasedDocument:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center">
<img src="classFileBasedDocument.png" usemap="#FileBasedDocument_map" alt=""/>
<map id="FileBasedDocument_map" name="FileBasedDocument_map">
<area href="classChangeBroadcaster.html" title="Holds a list of ChangeListeners, and sends messages to them when instructed. " alt="ChangeBroadcaster" shape="rect" coords="0,0,125,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a89d417326aed46fb561c599265e426d2"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">SaveResult</a> { <a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2aa0f8eec65cc59595a5e7d665c2a2efeb">savedOk</a> = 0,
<a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2a29ad285f4aa606eb17b9f7f0de211f5f">userCancelledSave</a>,
<a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2a7b2f3f4edd3dc5b02d1578ef4594f394">failedToWriteToFile</a>
}<tr class="memdesc:a89d417326aed46fb561c599265e426d2"><td class="mdescLeft"> </td><td class="mdescRight">A set of possible outcomes of one of the <a class="el" href="classFileBasedDocument.html#a8059227774bee831db9ca4d402c68321" title="Tries to save the document to the last file it was saved or loaded from. ">save()</a> methods. <a href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:a89d417326aed46fb561c599265e426d2"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a67651e24e6e4bd15b08edb2d101910aa"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a67651e24e6e4bd15b08edb2d101910aa">FileBasedDocument</a> (const <a class="el" href="classString.html">String</a> &fileExtension, const <a class="el" href="classString.html">String</a> &fileWildCard, const <a class="el" href="classString.html">String</a> &openFileDialogTitle, const <a class="el" href="classString.html">String</a> &saveFileDialogTitle)</td></tr>
<tr class="memdesc:a67651e24e6e4bd15b08edb2d101910aa"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="classFileBasedDocument.html" title="A class to take care of the logic involved with the loading/saving of some kind of document...">FileBasedDocument</a>. <a href="#a67651e24e6e4bd15b08edb2d101910aa">More...</a><br /></td></tr>
<tr class="separator:a67651e24e6e4bd15b08edb2d101910aa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a030915656fbe64df18d25b67fb7c0268"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a030915656fbe64df18d25b67fb7c0268">~FileBasedDocument</a> ()</td></tr>
<tr class="memdesc:a030915656fbe64df18d25b67fb7c0268"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a030915656fbe64df18d25b67fb7c0268">More...</a><br /></td></tr>
<tr class="separator:a030915656fbe64df18d25b67fb7c0268"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5676fb4537c68957616bd24f54b58f22"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a5676fb4537c68957616bd24f54b58f22">hasChangedSinceSaved</a> () const</td></tr>
<tr class="memdesc:a5676fb4537c68957616bd24f54b58f22"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the <a class="el" href="classFileBasedDocument.html#a3a058b73776404d76b828205ca058e42" title="Called to indicate that the document has changed and needs saving. ">changed()</a> method has been called since the file was last saved or loaded. <a href="#a5676fb4537c68957616bd24f54b58f22">More...</a><br /></td></tr>
<tr class="separator:a5676fb4537c68957616bd24f54b58f22"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3a058b73776404d76b828205ca058e42"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a3a058b73776404d76b828205ca058e42">changed</a> ()</td></tr>
<tr class="memdesc:a3a058b73776404d76b828205ca058e42"><td class="mdescLeft"> </td><td class="mdescRight">Called to indicate that the document has changed and needs saving. <a href="#a3a058b73776404d76b828205ca058e42">More...</a><br /></td></tr>
<tr class="separator:a3a058b73776404d76b828205ca058e42"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a60543bfd5b8889f23714e1b5cc72c44a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a60543bfd5b8889f23714e1b5cc72c44a">setChangedFlag</a> (bool hasChanged)</td></tr>
<tr class="memdesc:a60543bfd5b8889f23714e1b5cc72c44a"><td class="mdescLeft"> </td><td class="mdescRight">Sets the state of the 'changed' flag. <a href="#a60543bfd5b8889f23714e1b5cc72c44a">More...</a><br /></td></tr>
<tr class="separator:a60543bfd5b8889f23714e1b5cc72c44a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abcf1958f689b229b309f7486854cc7d7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classResult.html">Result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#abcf1958f689b229b309f7486854cc7d7">loadFrom</a> (const <a class="el" href="classFile.html">File</a> &fileToLoadFrom, bool showMessageOnFailure)</td></tr>
<tr class="memdesc:abcf1958f689b229b309f7486854cc7d7"><td class="mdescLeft"> </td><td class="mdescRight">Tries to open a file. <a href="#abcf1958f689b229b309f7486854cc7d7">More...</a><br /></td></tr>
<tr class="separator:abcf1958f689b229b309f7486854cc7d7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa9d239ddcfbe0ede54b3a1051ef6d8b5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classResult.html">Result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#aa9d239ddcfbe0ede54b3a1051ef6d8b5">loadFromUserSpecifiedFile</a> (bool showMessageOnFailure)</td></tr>
<tr class="memdesc:aa9d239ddcfbe0ede54b3a1051ef6d8b5"><td class="mdescLeft"> </td><td class="mdescRight">Asks the user for a file and tries to load it. <a href="#aa9d239ddcfbe0ede54b3a1051ef6d8b5">More...</a><br /></td></tr>
<tr class="separator:aa9d239ddcfbe0ede54b3a1051ef6d8b5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8059227774bee831db9ca4d402c68321"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">SaveResult</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a8059227774bee831db9ca4d402c68321">save</a> (bool askUserForFileIfNotSpecified, bool showMessageOnFailure)</td></tr>
<tr class="memdesc:a8059227774bee831db9ca4d402c68321"><td class="mdescLeft"> </td><td class="mdescRight">Tries to save the document to the last file it was saved or loaded from. <a href="#a8059227774bee831db9ca4d402c68321">More...</a><br /></td></tr>
<tr class="separator:a8059227774bee831db9ca4d402c68321"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a619ff6ed84d0c0471c5bf7cf98b82d85"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">SaveResult</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a619ff6ed84d0c0471c5bf7cf98b82d85">saveIfNeededAndUserAgrees</a> ()</td></tr>
<tr class="memdesc:a619ff6ed84d0c0471c5bf7cf98b82d85"><td class="mdescLeft"> </td><td class="mdescRight">If the file needs saving, it'll ask the user if that's what they want to do, and save it if they say yes. <a href="#a619ff6ed84d0c0471c5bf7cf98b82d85">More...</a><br /></td></tr>
<tr class="separator:a619ff6ed84d0c0471c5bf7cf98b82d85"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6e2943c148904e4d5357353034e69614"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">SaveResult</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a6e2943c148904e4d5357353034e69614">saveAs</a> (const <a class="el" href="classFile.html">File</a> &newFile, bool warnAboutOverwritingExistingFiles, bool askUserForFileIfNotSpecified, bool showMessageOnFailure)</td></tr>
<tr class="memdesc:a6e2943c148904e4d5357353034e69614"><td class="mdescLeft"> </td><td class="mdescRight">Tries to save the document to a specified file. <a href="#a6e2943c148904e4d5357353034e69614">More...</a><br /></td></tr>
<tr class="separator:a6e2943c148904e4d5357353034e69614"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa57557b32e2d2c61ef31f202e74521ad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">SaveResult</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#aa57557b32e2d2c61ef31f202e74521ad">saveAsInteractive</a> (bool warnAboutOverwritingExistingFiles)</td></tr>
<tr class="memdesc:aa57557b32e2d2c61ef31f202e74521ad"><td class="mdescLeft"> </td><td class="mdescRight">Prompts the user for a filename and tries to save to it. <a href="#aa57557b32e2d2c61ef31f202e74521ad">More...</a><br /></td></tr>
<tr class="separator:aa57557b32e2d2c61ef31f202e74521ad"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7994fd2587307dfe0b9933f5fe3b4cbd"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classFile.html">File</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a7994fd2587307dfe0b9933f5fe3b4cbd">getFile</a> () const</td></tr>
<tr class="memdesc:a7994fd2587307dfe0b9933f5fe3b4cbd"><td class="mdescLeft"> </td><td class="mdescRight">Returns the file that this document was last successfully saved or loaded from. <a href="#a7994fd2587307dfe0b9933f5fe3b4cbd">More...</a><br /></td></tr>
<tr class="separator:a7994fd2587307dfe0b9933f5fe3b4cbd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae9831c5ca4576665d1876c129976a3f8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#ae9831c5ca4576665d1876c129976a3f8">setFile</a> (const <a class="el" href="classFile.html">File</a> &newFile)</td></tr>
<tr class="memdesc:ae9831c5ca4576665d1876c129976a3f8"><td class="mdescLeft"> </td><td class="mdescRight">Sets the file that this document thinks it was loaded from. <a href="#ae9831c5ca4576665d1876c129976a3f8">More...</a><br /></td></tr>
<tr class="separator:ae9831c5ca4576665d1876c129976a3f8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classChangeBroadcaster"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classChangeBroadcaster')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classChangeBroadcaster.html">ChangeBroadcaster</a></td></tr>
<tr class="memitem:a1c8ccfa186a47d58a05e7f1f1576c038 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a1c8ccfa186a47d58a05e7f1f1576c038">ChangeBroadcaster</a> () noexcept</td></tr>
<tr class="memdesc:a1c8ccfa186a47d58a05e7f1f1576c038 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft"> </td><td class="mdescRight">Creates an <a class="el" href="classChangeBroadcaster.html" title="Holds a list of ChangeListeners, and sends messages to them when instructed. ">ChangeBroadcaster</a>. <a href="classChangeBroadcaster.html#a1c8ccfa186a47d58a05e7f1f1576c038">More...</a><br /></td></tr>
<tr class="separator:a1c8ccfa186a47d58a05e7f1f1576c038 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3b2f8465cc6c09c0583c8bdf56319742 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a3b2f8465cc6c09c0583c8bdf56319742">~ChangeBroadcaster</a> ()</td></tr>
<tr class="memdesc:a3b2f8465cc6c09c0583c8bdf56319742 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="classChangeBroadcaster.html#a3b2f8465cc6c09c0583c8bdf56319742">More...</a><br /></td></tr>
<tr class="separator:a3b2f8465cc6c09c0583c8bdf56319742 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad68416fe79a94cd5c99519bdea6c2a06 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#ad68416fe79a94cd5c99519bdea6c2a06">addChangeListener</a> (<a class="el" href="classChangeListener.html">ChangeListener</a> *listener)</td></tr>
<tr class="memdesc:ad68416fe79a94cd5c99519bdea6c2a06 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft"> </td><td class="mdescRight">Registers a listener to receive change callbacks from this broadcaster. <a href="classChangeBroadcaster.html#ad68416fe79a94cd5c99519bdea6c2a06">More...</a><br /></td></tr>
<tr class="separator:ad68416fe79a94cd5c99519bdea6c2a06 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae558a26c795278549a63e342bd5f1650 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#ae558a26c795278549a63e342bd5f1650">removeChangeListener</a> (<a class="el" href="classChangeListener.html">ChangeListener</a> *listener)</td></tr>
<tr class="memdesc:ae558a26c795278549a63e342bd5f1650 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft"> </td><td class="mdescRight">Unregisters a listener from the list. <a href="classChangeBroadcaster.html#ae558a26c795278549a63e342bd5f1650">More...</a><br /></td></tr>
<tr class="separator:ae558a26c795278549a63e342bd5f1650 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6b9c150078318d419debc82e6f22ce58 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a6b9c150078318d419debc82e6f22ce58">removeAllChangeListeners</a> ()</td></tr>
<tr class="memdesc:a6b9c150078318d419debc82e6f22ce58 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft"> </td><td class="mdescRight">Removes all listeners from the list. <a href="classChangeBroadcaster.html#a6b9c150078318d419debc82e6f22ce58">More...</a><br /></td></tr>
<tr class="separator:a6b9c150078318d419debc82e6f22ce58 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a10f01d1c0a7fde85355321985a682cbd inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a10f01d1c0a7fde85355321985a682cbd">sendChangeMessage</a> ()</td></tr>
<tr class="memdesc:a10f01d1c0a7fde85355321985a682cbd inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft"> </td><td class="mdescRight">Causes an asynchronous change message to be sent to all the registered listeners. <a href="classChangeBroadcaster.html#a10f01d1c0a7fde85355321985a682cbd">More...</a><br /></td></tr>
<tr class="separator:a10f01d1c0a7fde85355321985a682cbd inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5d16cd01b9af4bacb1716530af17f77b inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a5d16cd01b9af4bacb1716530af17f77b">sendSynchronousChangeMessage</a> ()</td></tr>
<tr class="memdesc:a5d16cd01b9af4bacb1716530af17f77b inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft"> </td><td class="mdescRight">Sends a synchronous change message to all the registered listeners. <a href="classChangeBroadcaster.html#a5d16cd01b9af4bacb1716530af17f77b">More...</a><br /></td></tr>
<tr class="separator:a5d16cd01b9af4bacb1716530af17f77b inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a78f62ecd57a016f8ba7a6ce55454947d inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a78f62ecd57a016f8ba7a6ce55454947d">dispatchPendingMessages</a> ()</td></tr>
<tr class="memdesc:a78f62ecd57a016f8ba7a6ce55454947d inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft"> </td><td class="mdescRight">If a change message has been sent but not yet dispatched, this will call <a class="el" href="classChangeBroadcaster.html#a5d16cd01b9af4bacb1716530af17f77b" title="Sends a synchronous change message to all the registered listeners. ">sendSynchronousChangeMessage()</a> to make the callback immediately. <a href="classChangeBroadcaster.html#a78f62ecd57a016f8ba7a6ce55454947d">More...</a><br /></td></tr>
<tr class="separator:a78f62ecd57a016f8ba7a6ce55454947d inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:abf86feb0316f1d010c956bd687bc2bf8"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classString.html">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#abf86feb0316f1d010c956bd687bc2bf8">getDocumentTitle</a> ()=0</td></tr>
<tr class="memdesc:abf86feb0316f1d010c956bd687bc2bf8"><td class="mdescLeft"> </td><td class="mdescRight">Overload this to return the title of the document. <a href="#abf86feb0316f1d010c956bd687bc2bf8">More...</a><br /></td></tr>
<tr class="separator:abf86feb0316f1d010c956bd687bc2bf8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a88999864b31dbda9bb0be1e593428cef"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classResult.html">Result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a88999864b31dbda9bb0be1e593428cef">loadDocument</a> (const <a class="el" href="classFile.html">File</a> &file)=0</td></tr>
<tr class="memdesc:a88999864b31dbda9bb0be1e593428cef"><td class="mdescLeft"> </td><td class="mdescRight">This method should try to load your document from the given file. <a href="#a88999864b31dbda9bb0be1e593428cef">More...</a><br /></td></tr>
<tr class="separator:a88999864b31dbda9bb0be1e593428cef"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2042b565e85118d3a2b34f677f61cbd8"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classResult.html">Result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a2042b565e85118d3a2b34f677f61cbd8">saveDocument</a> (const <a class="el" href="classFile.html">File</a> &file)=0</td></tr>
<tr class="memdesc:a2042b565e85118d3a2b34f677f61cbd8"><td class="mdescLeft"> </td><td class="mdescRight">This method should try to write your document to the given file. <a href="#a2042b565e85118d3a2b34f677f61cbd8">More...</a><br /></td></tr>
<tr class="separator:a2042b565e85118d3a2b34f677f61cbd8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5d71efccf45d29de2c2dcbb801e8021a"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classFile.html">File</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a5d71efccf45d29de2c2dcbb801e8021a">getLastDocumentOpened</a> ()=0</td></tr>
<tr class="memdesc:a5d71efccf45d29de2c2dcbb801e8021a"><td class="mdescLeft"> </td><td class="mdescRight">This is used for dialog boxes to make them open at the last folder you were using. <a href="#a5d71efccf45d29de2c2dcbb801e8021a">More...</a><br /></td></tr>
<tr class="separator:a5d71efccf45d29de2c2dcbb801e8021a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad8fa1517b5af884e0213ee365dcf65f4"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#ad8fa1517b5af884e0213ee365dcf65f4">setLastDocumentOpened</a> (const <a class="el" href="classFile.html">File</a> &file)=0</td></tr>
<tr class="memdesc:ad8fa1517b5af884e0213ee365dcf65f4"><td class="mdescLeft"> </td><td class="mdescRight">This is used for dialog boxes to make them open at the last folder you were using. <a href="#ad8fa1517b5af884e0213ee365dcf65f4">More...</a><br /></td></tr>
<tr class="separator:ad8fa1517b5af884e0213ee365dcf65f4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8eea22697f626904d28cee0082d3d076"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classFile.html">File</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classFileBasedDocument.html#a8eea22697f626904d28cee0082d3d076">getSuggestedSaveAsFile</a> (const <a class="el" href="classFile.html">File</a> &defaultFile)</td></tr>
<tr class="memdesc:a8eea22697f626904d28cee0082d3d076"><td class="mdescLeft"> </td><td class="mdescRight">This is called by <a class="el" href="classFileBasedDocument.html#aa57557b32e2d2c61ef31f202e74521ad" title="Prompts the user for a filename and tries to save to it. ">saveAsInteractive()</a> to allow you to optionally customise the filename that the user is presented with in the save dialog. <a href="#a8eea22697f626904d28cee0082d3d076">More...</a><br /></td></tr>
<tr class="separator:a8eea22697f626904d28cee0082d3d076"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A class to take care of the logic involved with the loading/saving of some kind of document. </p>
<p>There's quite a lot of tedious logic involved in writing all the load/save/save-as functions you need for documents that get saved to a file, so this class attempts to abstract most of the boring stuff.</p>
<p>Your subclass should just implement all the pure virtual methods, and you can then use the higher-level public methods to do the load/save dialogs, to warn the user about overwriting files, etc.</p>
<p>The document object keeps track of whether it has changed since it was last saved or loaded, so when you change something, call its <a class="el" href="classFileBasedDocument.html#a3a058b73776404d76b828205ca058e42" title="Called to indicate that the document has changed and needs saving. ">changed()</a> method. This will set a flag so it knows it needs saving, and will also broadcast a change message using the <a class="el" href="classChangeBroadcaster.html" title="Holds a list of ChangeListeners, and sends messages to them when instructed. ">ChangeBroadcaster</a> base class.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classChangeBroadcaster.html" title="Holds a list of ChangeListeners, and sends messages to them when instructed. ">ChangeBroadcaster</a> </dd></dl>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a89d417326aed46fb561c599265e426d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89d417326aed46fb561c599265e426d2">§ </a></span>SaveResult</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">FileBasedDocument::SaveResult</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>A set of possible outcomes of one of the <a class="el" href="classFileBasedDocument.html#a8059227774bee831db9ca4d402c68321" title="Tries to save the document to the last file it was saved or loaded from. ">save()</a> methods. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a89d417326aed46fb561c599265e426d2aa0f8eec65cc59595a5e7d665c2a2efeb"></a>savedOk </td><td class="fielddoc"><p>indicates that a file was saved successfully. </p>
</td></tr>
<tr><td class="fieldname"><a id="a89d417326aed46fb561c599265e426d2a29ad285f4aa606eb17b9f7f0de211f5f"></a>userCancelledSave </td><td class="fielddoc"><p>indicates that the user aborted the save operation. </p>
</td></tr>
<tr><td class="fieldname"><a id="a89d417326aed46fb561c599265e426d2a7b2f3f4edd3dc5b02d1578ef4594f394"></a>failedToWriteToFile </td><td class="fielddoc"><p>indicates that it tried to write to a file but this failed. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a67651e24e6e4bd15b08edb2d101910aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a67651e24e6e4bd15b08edb2d101910aa">§ </a></span>FileBasedDocument()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">FileBasedDocument::FileBasedDocument </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>fileExtension</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>fileWildCard</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>openFileDialogTitle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>saveFileDialogTitle</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classFileBasedDocument.html" title="A class to take care of the logic involved with the loading/saving of some kind of document...">FileBasedDocument</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">fileExtension</td><td>the extension to use when loading/saving files, e.g. ".doc" </td></tr>
<tr><td class="paramname">fileWildCard</td><td>the wildcard to use in file dialogs, e.g. "*.doc" </td></tr>
<tr><td class="paramname">openFileDialogTitle</td><td>the title to show on an open-file dialog, e.g. "Choose a file to open.." </td></tr>
<tr><td class="paramname">saveFileDialogTitle</td><td>the title to show on an save-file dialog, e.g. "Choose a file to save as.." </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a030915656fbe64df18d25b67fb7c0268"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a030915656fbe64df18d25b67fb7c0268">§ </a></span>~FileBasedDocument()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual FileBasedDocument::~FileBasedDocument </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a5676fb4537c68957616bd24f54b58f22"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5676fb4537c68957616bd24f54b58f22">§ </a></span>hasChangedSinceSaved()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool FileBasedDocument::hasChangedSinceSaved </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true if the <a class="el" href="classFileBasedDocument.html#a3a058b73776404d76b828205ca058e42" title="Called to indicate that the document has changed and needs saving. ">changed()</a> method has been called since the file was last saved or loaded. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#a60543bfd5b8889f23714e1b5cc72c44a" title="Sets the state of the 'changed' flag. ">setChangedFlag</a>, <a class="el" href="classFileBasedDocument.html#a3a058b73776404d76b828205ca058e42" title="Called to indicate that the document has changed and needs saving. ">changed</a> </dd></dl>
</div>
</div>
<a id="a3a058b73776404d76b828205ca058e42"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3a058b73776404d76b828205ca058e42">§ </a></span>changed()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void FileBasedDocument::changed </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Called to indicate that the document has changed and needs saving. </p>
<p>This method will also trigger a change message to be sent out using the <a class="el" href="classChangeBroadcaster.html" title="Holds a list of ChangeListeners, and sends messages to them when instructed. ">ChangeBroadcaster</a> base class.</p>
<p>After calling the method, the <a class="el" href="classFileBasedDocument.html#a5676fb4537c68957616bd24f54b58f22" title="Returns true if the changed() method has been called since the file was last saved or loaded...">hasChangedSinceSaved()</a> method will return true, until it is reset either by saving to a file or using the <a class="el" href="classFileBasedDocument.html#a60543bfd5b8889f23714e1b5cc72c44a" title="Sets the state of the 'changed' flag. ">setChangedFlag()</a> method.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#a5676fb4537c68957616bd24f54b58f22" title="Returns true if the changed() method has been called since the file was last saved or loaded...">hasChangedSinceSaved</a>, <a class="el" href="classFileBasedDocument.html#a60543bfd5b8889f23714e1b5cc72c44a" title="Sets the state of the 'changed' flag. ">setChangedFlag</a> </dd></dl>
</div>
</div>
<a id="a60543bfd5b8889f23714e1b5cc72c44a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60543bfd5b8889f23714e1b5cc72c44a">§ </a></span>setChangedFlag()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void FileBasedDocument::setChangedFlag </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>hasChanged</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the state of the 'changed' flag. </p>
<p>The 'changed' flag is set to true when the <a class="el" href="classFileBasedDocument.html#a3a058b73776404d76b828205ca058e42" title="Called to indicate that the document has changed and needs saving. ">changed()</a> method is called - use this method to reset it or to set it without also broadcasting a change message.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#a3a058b73776404d76b828205ca058e42" title="Called to indicate that the document has changed and needs saving. ">changed</a>, <a class="el" href="classFileBasedDocument.html#a5676fb4537c68957616bd24f54b58f22" title="Returns true if the changed() method has been called since the file was last saved or loaded...">hasChangedSinceSaved</a> </dd></dl>
</div>
</div>
<a id="abcf1958f689b229b309f7486854cc7d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abcf1958f689b229b309f7486854cc7d7">§ </a></span>loadFrom()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classResult.html">Result</a> FileBasedDocument::loadFrom </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classFile.html">File</a> & </td>
<td class="paramname"><em>fileToLoadFrom</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>showMessageOnFailure</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Tries to open a file. </p>
<p>If the file opens correctly, the document's file (see the <a class="el" href="classFileBasedDocument.html#a7994fd2587307dfe0b9933f5fe3b4cbd" title="Returns the file that this document was last successfully saved or loaded from. ">getFile()</a> method) is set to this new one; if it fails, the document's file is left unchanged, and optionally a message box is shown telling the user there was an error.</p>
<dl class="section return"><dt>Returns</dt><dd>A result indicating whether the new file loaded successfully, or the error message if it failed. </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#a88999864b31dbda9bb0be1e593428cef" title="This method should try to load your document from the given file. ">loadDocument</a>, <a class="el" href="classFileBasedDocument.html#aa9d239ddcfbe0ede54b3a1051ef6d8b5" title="Asks the user for a file and tries to load it. ">loadFromUserSpecifiedFile</a> </dd></dl>
</div>
</div>
<a id="aa9d239ddcfbe0ede54b3a1051ef6d8b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa9d239ddcfbe0ede54b3a1051ef6d8b5">§ </a></span>loadFromUserSpecifiedFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classResult.html">Result</a> FileBasedDocument::loadFromUserSpecifiedFile </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>showMessageOnFailure</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Asks the user for a file and tries to load it. </p>
<p>This will pop up a dialog box using the title, file extension and wildcard specified in the document's constructor, and asks the user for a file. If they pick one, the <a class="el" href="classFileBasedDocument.html#abcf1958f689b229b309f7486854cc7d7" title="Tries to open a file. ">loadFrom()</a> method is used to try to load it, optionally showing a message if it fails.</p>
<dl class="section return"><dt>Returns</dt><dd>a result indicating success; This will be a failure message if the user cancelled or if they picked a file which failed to load correctly </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#abcf1958f689b229b309f7486854cc7d7" title="Tries to open a file. ">loadFrom</a> </dd></dl>
</div>
</div>
<a id="a8059227774bee831db9ca4d402c68321"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8059227774bee831db9ca4d402c68321">§ </a></span>save()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">SaveResult</a> FileBasedDocument::save </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>askUserForFileIfNotSpecified</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>showMessageOnFailure</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Tries to save the document to the last file it was saved or loaded from. </p>
<p>This will always try to write to the file, even if the document isn't flagged as having changed.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">askUserForFileIfNotSpecified</td><td>if there's no file currently specified and this is true, it will prompt the user to pick a file, as if <a class="el" href="classFileBasedDocument.html#aa57557b32e2d2c61ef31f202e74521ad" title="Prompts the user for a filename and tries to save to it. ">saveAsInteractive()</a> was called. </td></tr>
<tr><td class="paramname">showMessageOnFailure</td><td>if true it will show a warning message when if the save operation fails </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#a619ff6ed84d0c0471c5bf7cf98b82d85" title="If the file needs saving, it'll ask the user if that's what they want to do, and save it if they say ...">saveIfNeededAndUserAgrees</a>, <a class="el" href="classFileBasedDocument.html#a6e2943c148904e4d5357353034e69614" title="Tries to save the document to a specified file. ">saveAs</a>, <a class="el" href="classFileBasedDocument.html#aa57557b32e2d2c61ef31f202e74521ad" title="Prompts the user for a filename and tries to save to it. ">saveAsInteractive</a> </dd></dl>
</div>
</div>
<a id="a619ff6ed84d0c0471c5bf7cf98b82d85"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a619ff6ed84d0c0471c5bf7cf98b82d85">§ </a></span>saveIfNeededAndUserAgrees()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">SaveResult</a> FileBasedDocument::saveIfNeededAndUserAgrees </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>If the file needs saving, it'll ask the user if that's what they want to do, and save it if they say yes. </p>
<p>If you've got a document open and want to close it (e.g. to quit the app), this is the method to call.</p>
<p>If the document doesn't need saving it'll return the value savedOk so you can go ahead and delete the document.</p>
<p>If it does need saving it'll prompt the user, and if they say "discard changes" it'll return savedOk, so again, you can safely delete the document.</p>
<p>If the user clicks "cancel", it'll return userCancelledSave, so if you can abort the close-document operation.</p>
<p>And if they click "save changes", it'll try to save and either return savedOk, or failedToWriteToFile if there was a problem.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#a8059227774bee831db9ca4d402c68321" title="Tries to save the document to the last file it was saved or loaded from. ">save</a>, <a class="el" href="classFileBasedDocument.html#a6e2943c148904e4d5357353034e69614" title="Tries to save the document to a specified file. ">saveAs</a>, <a class="el" href="classFileBasedDocument.html#aa57557b32e2d2c61ef31f202e74521ad" title="Prompts the user for a filename and tries to save to it. ">saveAsInteractive</a> </dd></dl>
</div>
</div>
<a id="a6e2943c148904e4d5357353034e69614"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e2943c148904e4d5357353034e69614">§ </a></span>saveAs()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">SaveResult</a> FileBasedDocument::saveAs </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classFile.html">File</a> & </td>
<td class="paramname"><em>newFile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>warnAboutOverwritingExistingFiles</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>askUserForFileIfNotSpecified</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>showMessageOnFailure</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Tries to save the document to a specified file. </p>
<p>If this succeeds, it'll also change the document's internal file (as returned by the <a class="el" href="classFileBasedDocument.html#a7994fd2587307dfe0b9933f5fe3b4cbd" title="Returns the file that this document was last successfully saved or loaded from. ">getFile()</a> method). If it fails, the file will be left unchanged.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">newFile</td><td>the file to try to write to </td></tr>
<tr><td class="paramname">warnAboutOverwritingExistingFiles</td><td>if true and the file exists, it'll ask the user first if they want to overwrite it </td></tr>
<tr><td class="paramname">askUserForFileIfNotSpecified</td><td>if the file is non-existent and this is true, it'll use the <a class="el" href="classFileBasedDocument.html#aa57557b32e2d2c61ef31f202e74521ad" title="Prompts the user for a filename and tries to save to it. ">saveAsInteractive()</a> method to ask the user for a filename </td></tr>
<tr><td class="paramname">showMessageOnFailure</td><td>if true and the write operation fails, it'll show a message box to warn the user </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#a619ff6ed84d0c0471c5bf7cf98b82d85" title="If the file needs saving, it'll ask the user if that's what they want to do, and save it if they say ...">saveIfNeededAndUserAgrees</a>, <a class="el" href="classFileBasedDocument.html#a8059227774bee831db9ca4d402c68321" title="Tries to save the document to the last file it was saved or loaded from. ">save</a>, <a class="el" href="classFileBasedDocument.html#aa57557b32e2d2c61ef31f202e74521ad" title="Prompts the user for a filename and tries to save to it. ">saveAsInteractive</a> </dd></dl>
</div>
</div>
<a id="aa57557b32e2d2c61ef31f202e74521ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa57557b32e2d2c61ef31f202e74521ad">§ </a></span>saveAsInteractive()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2">SaveResult</a> FileBasedDocument::saveAsInteractive </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>warnAboutOverwritingExistingFiles</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Prompts the user for a filename and tries to save to it. </p>
<p>This will pop up a dialog box using the title, file extension and wildcard specified in the document's constructor, and asks the user for a file. If they pick one, the <a class="el" href="classFileBasedDocument.html#a6e2943c148904e4d5357353034e69614" title="Tries to save the document to a specified file. ">saveAs()</a> method is used to try to save to this file.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">warnAboutOverwritingExistingFiles</td><td>if true and the file exists, it'll ask the user first if they want to overwrite it </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#a619ff6ed84d0c0471c5bf7cf98b82d85" title="If the file needs saving, it'll ask the user if that's what they want to do, and save it if they say ...">saveIfNeededAndUserAgrees</a>, <a class="el" href="classFileBasedDocument.html#a8059227774bee831db9ca4d402c68321" title="Tries to save the document to the last file it was saved or loaded from. ">save</a>, <a class="el" href="classFileBasedDocument.html#a6e2943c148904e4d5357353034e69614" title="Tries to save the document to a specified file. ">saveAs</a> </dd></dl>
</div>
</div>
<a id="a7994fd2587307dfe0b9933f5fe3b4cbd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7994fd2587307dfe0b9933f5fe3b4cbd">§ </a></span>getFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classFile.html">File</a>& FileBasedDocument::getFile </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the file that this document was last successfully saved or loaded from. </p>
<p>When the document object is created, this will be set to <a class="el" href="classFile.html" title="Represents a local file or directory. ">File()</a>.</p>
<p>It is changed when one of the load or save methods is used, or when <a class="el" href="classFileBasedDocument.html#ae9831c5ca4576665d1876c129976a3f8" title="Sets the file that this document thinks it was loaded from. ">setFile()</a> is used to explicitly set it. </p>
<p>References <a class="el" href="juce__PlatformDefs_8h.html#a851b02724a8158a7f746c66b5758b3dd">JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR</a>.</p>
</div>
</div>
<a id="ae9831c5ca4576665d1876c129976a3f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae9831c5ca4576665d1876c129976a3f8">§ </a></span>setFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void FileBasedDocument::setFile </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classFile.html">File</a> & </td>
<td class="paramname"><em>newFile</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the file that this document thinks it was loaded from. </p>
<p>This won't actually load anything - it just changes the file stored internally.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classFileBasedDocument.html#a7994fd2587307dfe0b9933f5fe3b4cbd" title="Returns the file that this document was last successfully saved or loaded from. ">getFile</a> </dd></dl>
</div>
</div>
<a id="abf86feb0316f1d010c956bd687bc2bf8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf86feb0316f1d010c956bd687bc2bf8">§ </a></span>getDocumentTitle()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classString.html">String</a> FileBasedDocument::getDocumentTitle </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Overload this to return the title of the document. </p>
<p>This is used in message boxes, filenames and file choosers, so it should be something sensible. </p>
</div>
</div>
<a id="a88999864b31dbda9bb0be1e593428cef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88999864b31dbda9bb0be1e593428cef">§ </a></span>loadDocument()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classResult.html">Result</a> FileBasedDocument::loadDocument </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classFile.html">File</a> & </td>
<td class="paramname"><em>file</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This method should try to load your document from the given file. </p>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="classResult.html" title="Represents the 'success' or 'failure' of an operation, and holds an associated error message to descr...">Result</a> object to indicate the whether there was an error. </dd></dl>
</div>
</div>
<a id="a2042b565e85118d3a2b34f677f61cbd8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2042b565e85118d3a2b34f677f61cbd8">§ </a></span>saveDocument()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classResult.html">Result</a> FileBasedDocument::saveDocument </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classFile.html">File</a> & </td>
<td class="paramname"><em>file</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This method should try to write your document to the given file. </p>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="classResult.html" title="Represents the 'success' or 'failure' of an operation, and holds an associated error message to descr...">Result</a> object to indicate the whether there was an error. </dd></dl>
</div>
</div>
<a id="a5d71efccf45d29de2c2dcbb801e8021a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d71efccf45d29de2c2dcbb801e8021a">§ </a></span>getLastDocumentOpened()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classFile.html">File</a> FileBasedDocument::getLastDocumentOpened </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This is used for dialog boxes to make them open at the last folder you were using. </p>
<p><a class="el" href="classFileBasedDocument.html#a5d71efccf45d29de2c2dcbb801e8021a" title="This is used for dialog boxes to make them open at the last folder you were using. ">getLastDocumentOpened()</a> and <a class="el" href="classFileBasedDocument.html#ad8fa1517b5af884e0213ee365dcf65f4" title="This is used for dialog boxes to make them open at the last folder you were using. ">setLastDocumentOpened()</a> are used to store the last document that was used - you might want to store this value in a static variable, or even in your application's properties. It should be a global setting rather than a property of this object.</p>
<p>This method works very well in conjunction with a <a class="el" href="classRecentlyOpenedFilesList.html" title="Manages a set of files for use as a list of recently-opened documents. ">RecentlyOpenedFilesList</a> object to manage your recent-files list.</p>
<p>As a default value, it's ok to return <a class="el" href="classFile.html" title="Represents a local file or directory. ">File()</a>, and the document object will use a sensible one instead.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classRecentlyOpenedFilesList.html" title="Manages a set of files for use as a list of recently-opened documents. ">RecentlyOpenedFilesList</a> </dd></dl>
</div>
</div>
<a id="ad8fa1517b5af884e0213ee365dcf65f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad8fa1517b5af884e0213ee365dcf65f4">§ </a></span>setLastDocumentOpened()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void FileBasedDocument::setLastDocumentOpened </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classFile.html">File</a> & </td>
<td class="paramname"><em>file</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This is used for dialog boxes to make them open at the last folder you were using. </p>
<p><a class="el" href="classFileBasedDocument.html#a5d71efccf45d29de2c2dcbb801e8021a" title="This is used for dialog boxes to make them open at the last folder you were using. ">getLastDocumentOpened()</a> and <a class="el" href="classFileBasedDocument.html#ad8fa1517b5af884e0213ee365dcf65f4" title="This is used for dialog boxes to make them open at the last folder you were using. ">setLastDocumentOpened()</a> are used to store the last document that was used - you might want to store this value in a static variable, or even in your application's properties. It should be a global setting rather than a property of this object.</p>
<p>This method works very well in conjunction with a <a class="el" href="classRecentlyOpenedFilesList.html" title="Manages a set of files for use as a list of recently-opened documents. ">RecentlyOpenedFilesList</a> object to manage your recent-files list.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classRecentlyOpenedFilesList.html" title="Manages a set of files for use as a list of recently-opened documents. ">RecentlyOpenedFilesList</a> </dd></dl>
</div>
</div>
<a id="a8eea22697f626904d28cee0082d3d076"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8eea22697f626904d28cee0082d3d076">§ </a></span>getSuggestedSaveAsFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classFile.html">File</a> FileBasedDocument::getSuggestedSaveAsFile </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classFile.html">File</a> & </td>
<td class="paramname"><em>defaultFile</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This is called by <a class="el" href="classFileBasedDocument.html#aa57557b32e2d2c61ef31f202e74521ad" title="Prompts the user for a filename and tries to save to it. ">saveAsInteractive()</a> to allow you to optionally customise the filename that the user is presented with in the save dialog. </p>
<p>The defaultFile parameter is an initial suggestion based on what the class knows about the current document - you can return a variation on this file with a different extension, etc, or just return something completely different. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__FileBasedDocument_8h.html">juce_FileBasedDocument.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content © ROLI Ltd.</small></address><br/>
</body>
</html>
|