The Gnome Chemistry Utils  0.13.7
Public Member Functions | Protected Attributes
gcr::Application Class Reference

GCrystal application base class. More...

#include <gcr/application.h>

Inheritance diagram for gcr::Application:
gcugtk::Application gcu::Application gcu::DialogOwner

List of all members.

Public Member Functions

 Application ()
virtual ~Application ()
virtual gcr::DocumentOnFileNew ()=0
void OnFileOpen ()
void OnFileSave ()
void OnFileSaveAs ()
bool OnFileClose ()
void OnSaveAsImage ()
bool OnQuit ()
void SetActiveDocument (Document *doc)
virtual WindowCreateNewWindow (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)
DocumentGetDocument (const char *filename)
bool IsEmpty ()
void SetOpening ()
GOConfNode * GetConfNode (void) const

Protected Attributes

Documentm_pActiveDoc

Detailed Description

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.


Constructor & Destructor Documentation

The default constructor.

virtual gcr::Application::~Application ( ) [virtual]

The destructor.

Reimplemented from gcugtk::Application.


Member Function Documentation

virtual Window* gcr::Application::CreateNewWindow ( Document doc) [virtual]
Parameters:
doca document.

Creates a new window for the document.

Returns:
the newly allocated window.
bool gcr::Application::FileProcess ( const gchar *  filename,
const gchar *  mime_type,
bool  bSave,
GtkWindow *  window,
gcu::Document pDoc = NULL 
)
Parameters:
filenamethe uri of the file.
mime_typethe mime type of the file if known.
bSavetrue if saving, and false if loading.
windowthe current top level window.
pDocan 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.

Returns:
true if no error occured.
gcr::Application::GetConfNode ( void  ) const [inline]
Returns:
the GOConfNode used for the default configuration.

Definition at line 184 of file gcr/application.h.

Document* gcr::Application::GetDocument ( const char *  filename)
Parameters:
filenamea file name
Returns:
the document associated with filename if opened or NULL.
char const* gcr::Application::GetFirstSupportedMimeType ( std::list< std::string >::iterator &  it)
Parameters:
ita mime type iterator.

Initializes the iterator and returns the first registered mime type.

Returns:
the first registered mime type.
char const* gcr::Application::GetNextSupportedMimeType ( std::list< std::string >::iterator &  it)
Parameters:
ita mime type iterator initialized during GetFirstSupportedMimeType() call.
Returns:
the next registered mime type.
bool gcr::Application::IsEmpty ( ) [inline]
Returns:
whether there is no opened view.

Definition at line 156 of file gcr/application.h.

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.

Open the file open dialog to select documents to open.

Saves the current document. If it has no file name, the file save as dialog will pop up.

Open the file save as dialog to save the current document with a new name.

Quits the application. If a document has been modified, the user will be asked if he wants to save the modifications or ignore them.

Open the file save as dialog to save the current view as an image.

Parameters:
docthe 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.


Member Data Documentation

The active document.

Definition at line 170 of file gcr/application.h.

Referenced by SetActiveDocument().


The documentation for this class was generated from the following file: