25 #ifndef GCU_APPLICATION_H 26 #define GCU_APPLICATION_H 52 #define GCU_CONF_DIR "gchemutils" 75 Application (std::string name, std::string datadir = DATADIR,
char const *help_name = NULL,
char const *icon_name = NULL,
CmdContext *cc = NULL);
89 void OnHelp (std::string s =
"");
97 std::string
const &
GetName ()
const {
return Name;}
117 virtual bool FileProcess (G_GNUC_UNUSED
const gchar* filename, G_GNUC_UNUSED
const gchar* mime_type, G_GNUC_UNUSED
bool bSave, G_GNUC_UNUSED GtkWindow *window, G_GNUC_UNUSED
Document *pDoc = NULL)
128 void SetCurDir (
char const* dir);
133 void SetCurDir (std::string
const &dir);
149 char const *GetPixbufTypeName (std::string& filename,
char const *mime_type);
162 ContentType Load (std::string
const &uri,
const char *mime_type,
Document* Doc,
const char *options = NULL);
175 ContentType Load (GsfInput *input,
const char *mime_type,
Document* Doc,
const char *options = NULL);
189 bool Save (std::string
const &uri,
const char *mime_type,
Object const *Obj,
ContentType type,
const char *options = NULL);
203 bool Save (GsfOutput *output,
const char *mime_type,
Object const *Obj,
ContentType type,
const char *options = NULL);
215 static GOConfNode *GetConfDir ();
230 void RegisterOptions (GOptionEntry
const *entries,
char const *translation_domain = GETTEXT_PACKAGE);
238 void AddOptions (GOptionContext *context);
251 static Application *GetApplication (
char const *name);
258 static Application *GetApplication (std::string &name);
270 TypeId AddType (std::string TypeName,
Object* (*CreateFunc) (),
TypeId id = OtherType);
282 Object* CreateObject (
const std::string& TypeName,
Object* parent = NULL);
298 void AddRule (
const std::string& type1,
RuleId rule,
const std::string& type2);
305 const std::set<TypeId>& GetRules (
TypeId type,
RuleId rule);
313 const std::set<TypeId>& GetRules (
const std::string& type,
RuleId rule);
322 void SetCreationLabel (
TypeId Id, std::string Label);
329 const std::string& GetCreationLabel (
TypeId Id);
357 const std::string& GetCreationLabel (
const std::string& TypeName);
359 TypeDesc
const *GetTypeDescription (
TypeId Id);
374 char* ConvertToCML (std::string
const &uri,
const char *mime_type,
const char *options = NULL);
384 char* ConvertToCML (GsfInput *input,
const char *mime_type,
const char *options = NULL);
394 void ConvertFromCML (
const char *cml, std::string
const &uri,
const char *mime_type,
const char *options = NULL);
404 void ConvertFromCML (
const char *cml, GsfOutput *output,
const char *mime_type,
const char *options = NULL);
410 std::list < Database >
const &
GetDatabases (
char const *classname) {
return m_Databases[classname];}
420 void RegisterBabelType (
const char *mime_type,
const char *type);
451 void AddDocument (
Document *Doc) {m_Docs.insert (Doc);}
452 void RemoveDocument (
Document *Doc);
453 int OpenBabelSocket ();
454 char const *MimeToBabelType (
char const *mime_type);
458 std::string HelpName;
459 std::string HelpBrowser;
460 std::string HelpFilename;
462 std::string IconName;
463 static GOConfNode *m_ConfDir;
464 std::list <option_data> m_Options;
465 std::map <TypeId, TypeDesc> m_Types;
466 std::map <std::string, std::string> m_BabelTypes;
467 std::map < std::string, std::list <Database> >m_Databases;
538 #endif // GCU_APPLICATION_H virtual Document * CreateNewDocument()
std::string const & GetIconName()
virtual GtkWindow * GetWindow()
virtual bool FileProcess(G_GNUC_UNUSED const gchar *filename, G_GNUC_UNUSED const gchar *mime_type, G_GNUC_UNUSED bool bSave, G_GNUC_UNUSED GtkWindow *window, G_GNUC_UNUSED Document *pDoc=NULL)
std::map< std::string, GdkPixbufFormat * > & GetSupportedPixbufFormats()
std::list< Database > const & GetDatabases(char const *classname)
bool(* BuildMenuCb)(Object *target, UIManager *uim, Object *object, double x, double y)
base class for a user interface manager
#define GCU_PROT_PROP(type, member)
The Gnome Chemistry Utils C++ classes.
virtual bool LoopRunning()
#define GCU_PROP(type, member)
std::string const & GetName() const
CmdContext * m_CmdContext
virtual void NoMoreDocsEvent()
virtual void CreateDefaultCmdContext()
std::map< std::string, GdkPixbufFormat * > m_SupportedPixbufFormats