62 const String& fileWildCard,
63 const String& openFileDialogTitle,
64 const String& saveFileDialogTitle);
75 bool hasChangedSinceSaved()
const;
87 virtual void changed();
96 void setChangedFlag (
bool hasChanged);
110 bool showMessageOnFailure,
111 bool showWaitCursor =
true);
124 void loadFromAsync (
const File& fileToLoadFrom,
125 bool showMessageOnFailure,
128 #if JUCE_MODAL_LOOPS_PERMITTED
140 Result loadFromUserSpecifiedFile (
bool showMessageOnFailure);
153 void loadFromUserSpecifiedFileAsync (
bool showMessageOnFailure,
std::function<
void (
Result)> callback);
165 #if JUCE_MODAL_LOOPS_PERMITTED
178 SaveResult save (
bool askUserForFileIfNotSpecified,
179 bool showMessageOnFailure);
195 void saveAsync (
bool askUserForFileIfNotSpecified,
196 bool showMessageOnFailure,
199 #if JUCE_MODAL_LOOPS_PERMITTED
220 SaveResult saveIfNeededAndUserAgrees();
243 void saveIfNeededAndUserAgreesAsync (
std::function<
void (SaveResult)> callback);
245 #if JUCE_MODAL_LOOPS_PERMITTED
263 SaveResult saveAs (
const File& newFile,
264 bool warnAboutOverwritingExistingFiles,
265 bool askUserForFileIfNotSpecified,
266 bool showMessageOnFailure,
267 bool showWaitCursor =
true);
287 void saveAsAsync (
const File& newFile,
288 bool warnAboutOverwritingExistingFiles,
289 bool askUserForFileIfNotSpecified,
290 bool showMessageOnFailure,
293 #if JUCE_MODAL_LOOPS_PERMITTED
305 SaveResult saveAsInteractive (
bool warnAboutOverwritingExistingFiles);
320 void saveAsInteractiveAsync (
bool warnAboutOverwritingExistingFiles,
331 const File& getFile()
const;
339 void setFile (
const File& newFile);
421 virtual File getSuggestedSaveAsFile (
const File& defaultFile);
Holds a list of ChangeListeners, and sends messages to them when instructed.
A class to take care of the logic involved with the loading/saving of some kind of document.
virtual Result loadDocument(const File &file)=0
This method should try to load your document from the given file.
~FileBasedDocument() override
Destructor.
virtual String getDocumentTitle()=0
Overload this to return the title of the document.
SaveResult
A set of possible outcomes of one of the save() methods.
@ userCancelledSave
indicates that the user aborted the save operation.
virtual Result saveDocument(const File &file)=0
This method should try to write your document to the given file.
virtual void setLastDocumentOpened(const File &file)=0
This is used for dialog boxes to make them open at the last folder you were using.
virtual File getLastDocumentOpened()=0
This is used for dialog boxes to make them open at the last folder you were using.
Represents a local file or directory.
Represents the 'success' or 'failure' of an operation, and holds an associated error message to descr...