The Gnome Chemistry Utils
0.13.7
|
GCrystal application base class. More...
#include <gcr/application.h>
Public Member Functions | |
Application () | |
virtual | ~Application () |
virtual gcr::Document * | OnFileNew ()=0 |
void | OnFileOpen () |
void | OnFileSave () |
void | OnFileSaveAs () |
bool | OnFileClose () |
void | OnSaveAsImage () |
bool | OnQuit () |
void | SetActiveDocument (Document *doc) |
virtual Window * | CreateNewWindow (Document *doc) |
bool | FileProcess (const gchar *filename, const gchar *mime_type, bool bSave, GtkWindow *window, gcu::Document *pDoc=NULL) |
char const * | GetFirstSupportedMimeType (std::list< std::string >::iterator &it) |
char const * | GetNextSupportedMimeType (std::list< std::string >::iterator &it) |
Document * | GetDocument (const char *filename) |
bool | IsEmpty () |
void | SetOpening () |
GOConfNode * | GetConfNode (void) const |
Protected Attributes | |
Document * | m_pActiveDoc |
GCrystal application base class.
This class is used to represent a GCrystal application. It is a virtual class since at least one method is pure virtual (gcp::Application::OnFileNew)
Definition at line 50 of file gcr/application.h.
The default constructor.
virtual gcr::Application::~Application | ( | ) | [virtual] |
The destructor.
Reimplemented from gcugtk::Application.
virtual Window* gcr::Application::CreateNewWindow | ( | Document * | doc | ) | [virtual] |
doc | a document. |
Creates a new window for the document.
bool gcr::Application::FileProcess | ( | const gchar * | filename, |
const gchar * | mime_type, | ||
bool | bSave, | ||
GtkWindow * | window, | ||
gcu::Document * | pDoc = NULL |
||
) |
filename | the uri of the file. |
mime_type | the mime type of the file if known. |
bSave | true if saving, and false if loading. |
window | the current top level window. |
pDoc | an optional document. |
Called by the FileChooser when a file name has been selected. This method loads a new file or saves pDoc according to bSave. When loading, a new document is created unless pDoc is not NULL and is empty.
gcr::Application::GetConfNode | ( | void | ) | const [inline] |
Definition at line 184 of file gcr/application.h.
Document* gcr::Application::GetDocument | ( | const char * | filename | ) |
filename | a file name |
char const* gcr::Application::GetFirstSupportedMimeType | ( | std::list< std::string >::iterator & | it | ) |
it | a mime type iterator. |
Initializes the iterator and returns the first registered mime type.
char const* gcr::Application::GetNextSupportedMimeType | ( | std::list< std::string >::iterator & | it | ) |
it | a mime type iterator initialized during GetFirstSupportedMimeType() call. |
bool gcr::Application::IsEmpty | ( | ) | [inline] |
Definition at line 156 of file gcr/application.h.
bool gcr::Application::OnFileClose | ( | ) |
Closes the current document. If the document has been modified, the user will be asked if he wants to save the modifications or ignore them.
virtual gcr::Document* gcr::Application::OnFileNew | ( | ) | [pure virtual] |
Creates a new document. This method is pure virtual and must be implemented in derived classes.
void gcr::Application::OnFileOpen | ( | ) |
Open the file open dialog to select documents to open.
void gcr::Application::OnFileSave | ( | ) |
Saves the current document. If it has no file name, the file save as dialog will pop up.
void gcr::Application::OnFileSaveAs | ( | ) |
Open the file save as dialog to save the current document with a new name.
bool gcr::Application::OnQuit | ( | ) |
Quits the application. If a document has been modified, the user will be asked if he wants to save the modifications or ignore them.
void gcr::Application::OnSaveAsImage | ( | ) |
Open the file save as dialog to save the current view as an image.
void gcr::Application::SetActiveDocument | ( | Document * | doc | ) | [inline] |
doc | the document becoming active. |
Sets the new active document.
Definition at line 105 of file gcr/application.h.
References m_pActiveDoc.
void gcr::Application::SetOpening | ( | ) | [inline] |
Tells the application that a document is loading.
Definition at line 161 of file gcr/application.h.
Document* gcr::Application::m_pActiveDoc [protected] |
The active document.
Definition at line 170 of file gcr/application.h.
Referenced by SetActiveDocument().