Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

gcu::Application Class Reference

#include <gcu/application.h>

List of all members.

Public Member Functions

 Application (string name, string datadir=DATADIR, char const *help_name=NULL, char const *icon_name=NULL)
void OnHelp (string s="")
bool HasHelp ()
string & GetName ()
virtual GtkWindow * GetWindow ()
virtual bool FileProcess (const gchar *filename, const gchar *mime_type, bool bSave, GtkWindow *window, Document *pDoc=NULL)
char const * GetCurDir ()
void SetCurDir (char const *dir)


Detailed Description

This class is a base class for applications. It provides some basic services.

Definition at line 40 of file application.h.


Constructor & Destructor Documentation

gcu::Application::Application string  name,
string  datadir = DATADIR,
char const *  help_name = NULL,
char const *  icon_name = NULL
 

Parameters:
name: the name of the application.
datadir: where data for the application are stored.
help_name: the name to use for the help file (with .xml extension). If NULL, the name strng is used.
icon_name: the name to use for the default icon of all windows. If NULL, the help_name or name parameters will be used.
The datadir variable is used to build the full path to the help file: datadir+"/gnome/help/"+name+"/"+LANG+"/"+name".xml".


Member Function Documentation

virtual bool gcu::Application::FileProcess const gchar *  filename,
const gchar *  mime_type,
bool  bSave,
GtkWindow *  window,
Document pDoc = NULL
[inline, virtual]
 

Parameters:
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 does nothing in the parent class and must be implemented in children classes if they use the FileChooser.

Returns:
true if no error occured.

Definition at line 93 of file application.h.

char const* gcu::Application::GetCurDir  )  [inline]
 

Returns:
the path to the current directory.

Definition at line 99 of file application.h.

string& gcu::Application::GetName  )  [inline]
 

Returns:
the name of the application. Mostly useful to set the icon name of a new window.

Definition at line 73 of file application.h.

virtual GtkWindow* gcu::Application::GetWindow  )  [inline, virtual]
 

Returns:
a GtkWindow if any. Should be overloaded by children classes.

Definition at line 78 of file application.h.

bool gcu::Application::HasHelp  ) 
 

Returns:
true if both a help browser and a help file are available, false otherwise.

void gcu::Application::OnHelp string  s = ""  ) 
 

Parameters:
s: an optional tag in the help file. Displays the help file using the file browser retrieved from GConf using the "/desktop/gnome/applications/help_viewer/exec" key. If a tag is given, it will be added to the help uri. For an application named "myapp" and a tag "mytag", the uri will be: helpfilename#myapp-mytag.

void gcu::Application::SetCurDir char const *  dir  ) 
 

Parameters:
dir: the path to the new current directory.


The documentation for this class was generated from the following file:
Generated on Sun May 28 16:59:57 2006 for The Gnome Chemistry Utils by  doxygen 1.4.1