App_WithDoc.h
bakery/App/App.h
bakery/Document/Document.h
App_WithDoc_Gtk.h
GtkDialogs.h
bakery.h
list
bakery/App/App.h
map
App_WithDoc.h
glibmm/object.h
bakery/Document/Document.h
ViewBase.h
bakery/App/AppInstanceManager.h
vector
sigc++/sigc++.h
iostream
sigc++/trackable.h
bakery/View/View.h
glibmm.h
GtkDialogs.h
App_WithDoc.h
bakery.h
App_WithDoc_Gtk.h
Bakery::App_WithDoc
Bakery

    /*
    *Copyright2000MurrayCumming
    *
    *Thislibraryisfreesoftware;youcanredistributeitand/or
    *modifyitunderthetermsoftheGNULibraryGeneralPublic
    *LicenseaspublishedbytheFreeSoftwareFoundation;either
    *version2oftheLicense,or(atyouroption)anylaterversion.
    *
    *Thislibraryisdistributedinthehopethatitwillbeuseful,
    *butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof
    *MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.SeetheGNU
    *LibraryGeneralPublicLicenseformoredetails.
    *
    *YoushouldhavereceivedacopyoftheGNULibraryGeneralPublic
    *Licensealongwiththislibrary;ifnot,writetotheFree
    *SoftwareFoundation,Inc.,675MassAve,Cambridge,MA02139,USA.
    */

    #ifndefBAKERY_APP_WITHDOC_H
    #defineBAKERY_APP_WITHDOC_H

    #include<bakery/App/App.h>
    #include<bakery/Document/Document.h>

    namespaceBakery
    {

    classApp_WithDoc:virtualpublicApp//virtualbecauseApp_WithDoc_GtkwillinherititviaApp_With_DocandviaApp_Gtk.
    {
    public:
    App_WithDoc(constGlib::ustring&appname="");//TODO:appnamewhenusingget_derived_widget()

    virtual~App_WithDoc();

    virtualvoidinit();//overriddentocreatedocument.

    enumenumSaveChanges
    {
    SAVECHANGES_Save,
    SAVECHANGES_Cancel,
    SAVECHANGES_Discard
    };

    staticboolfile_exists(constGlib::ustring&uri);

    protected:
    virtualvoidinit_create_document();//overridethistonew()thespecificdocumenttype.

    staticvoidadd_mime_type(constGlib::ustring&mime_type);

    virtualDocument*get_document();

    virtualconstDocument*get_document()const;

    virtualvoidset_document_modified(boolbModified=true);

    virtualboolopen_document(constGlib::ustring&file_uri);

    //Thiscannotbevirtual,becausethatwouldbreakourABI.
    //Hopefullythatisnotnecessary.
    boolopen_document_from_data(constguchar*data,std::size_tlength);

    virtualvoiddocument_history_add(constGlib::ustring&file_uri);
    virtualvoiddocument_history_remove(constGlib::ustring&file_uri);

    public:
    //Wecannottakefunctionpointersofthesemethodsin
    //aderivedclassiftheyareprotected-forinstance,withsigc::mem_fun()
    //Signalhandlers:

    //Menuitems:
    virtualvoidon_menu_file_open();
    virtualvoidon_menu_file_saveas();//signalhandler.
    virtualvoidoffer_saveas();//Fordirectuse.
    virtualvoidon_menu_file_save();//signalhandler.
    virtualvoidon_menu_file_close();

    virtualvoidon_menu_edit_copy();
    virtualvoidon_menu_edit_paste();
    virtualvoidon_menu_edit_clear();

    protected:
    //Document:

    virtualvoidon_document_modified(boolmodified);

    virtualboolon_document_load();

    virtualvoidoffer_to_save_changes();

    virtualvoidcancel_close_or_exit();

    virtualvoidclose_mark_or_destroy();

    virtualvoidupdate_window_title();

    virtualvoidafter_successful_save();//e.g.disableFile|Save.

    virtualvoidui_warning(constGlib::ustring&text,constGlib::ustring&secondary_text)=0;
    virtualGlib::ustringui_file_select_open(constGlib::ustring&ui_file_select_open=Glib::ustring())=0;

    virtualGlib::ustringui_file_select_save(constGlib::ustring&old_file_uri)=0;

    virtualvoidui_show_modification_status()=0;

    virtualenumSaveChangesui_offer_to_save_changes()=0;

    staticGlib::ustringget_conf_fullkey(constGlib::ustring&key);

    //Document:
    Document*m_pDocument;//Aninstanceofaderivedtype.
    boolm_bCloseAfterSave;

    //Mimetypeswhichthisapplicationcanloadandsave:
    typedefstd::list<Glib::ustring>type_list_strings;
    statictype_list_stringsm_mime_types;
    };

    }//namespace

    #endif//BAKERY_APP_WITHDOC_H