31 #ifndef TBX_DOCMANAGER_H_
32 #define TBX_DOCMANAGER_H_
35 #include "../prequitlistener.h"
37 #include "../command.h"
38 #include "../loader.h"
133 std::list<Document *> _documents;
141 virtual ~NewDocumentCommand() {}
142 virtual void execute();
151 virtual ~QuitCommand() {};
152 virtual void execute();
161 virtual ~FileLoader() {}
166 void remove_document(
Document *doc);
205 bool load_files(
int num_files,
char *file_names[]);
206 bool load_file(
const std::string &file_name,
int estimated_size = -1,
bool from_filer =
true);
Class to manage all the documents.
Definition: docmanager.h:127
Listener for when a Quit is selected from the Quit dialog.
Definition: quit.h:194
Event passed to pre quit listeners.
Definition: prequitlistener.h:82
DocCreatorBase * doc_creator()
Get the object that creates documents and their main window.
Definition: docmanager.h:180
Class to allow a quit cancelled during the prequit message to be restarted.
Definition: prequitlistener.h:45
Base class for commands in tbx.
Definition: command.h:36
Listen for the pre quit message from the desktop.
Definition: prequitlistener.h:109
unsigned int modified_count() const
Return number of documents modified.
Definition: docmanager.cc:89
virtual void create_window(Document *doc)
Create the window used to display the given document.
Definition: docmanager.h:97
virtual void create_window(Document *doc)=0
Create the window used to display the given document.
bool load_file(const std::string &file_name, int estimated_size=-1, bool from_filer=true)
Load a file into a document and show it in a window.
Definition: docmanager.cc:239
Base class for a document.
Definition: document.h:52
Templated class to provide information on a documents file type and how to create the document and it...
Definition: docmanager.h:86
tbx::Loader * file_loader()
Return a loader to load a document into a new window.
Definition: docmanager.h:198
static DocManager * instance()
Get single instance of the document manager.
Definition: docmanager.h:176
tbx::Command * quit_command()
Return a command that can be executed to quit the application showing a Quit dialogue if necessary...
Definition: docmanager.h:193
Class to handle file/data loading from the filer or an external application.
Definition: loader.h:179
tbx::Command * new_document_command()
Return a command that can be executed to create a new document with its window.
Definition: docmanager.h:188
DocCreator(int file_type)
Construct document creator for a file type.
Definition: docmanager.h:94
DocManager(DocCreatorBase *doc_creator)
Construct the document manager for the application.
Definition: docmanager.cc:53
virtual void pre_quit(tbx::PreQuitEvent &event)
Called when the prequit message is received by the application.
Definition: docmanager.cc:130
Class to provide information on a toolbox event.
Definition: eventinfo.h:48
virtual Document * create_document()=0
Override this method to create the document object.
int file_type() const
Get the document file type.
Definition: docmanager.h:203
int file_type() const
Return the file type handled by this document creator.
Definition: docmanager.h:65
Class with details of a file load operation.
Definition: loader.h:41
Class to show a toolbox Quit object that gives the user an option to Quit or Cancel the application...
Definition: quit.h:60
virtual Document * create_document()
Override this method to create the document object.
Definition: docmanager.h:96
bool load_files(int num_files, char *file_names[])
Load multiple files into documents and show windows for them.
Definition: docmanager.cc:219
Base class to help create a document and a window to show it in.
Definition: docmanager.h:50
DocCreatorBase(int file_type)
Construct a document and window creator for a file type.
Definition: docmanager.h:59