Document.h
bakery/View/View.h
glibmm.h
iostream
App_WithDoc.h
App_WithDoc_Gtk.h
Document_XML.h
View.h
Document.h
ViewBase.h
sigc++/sigc++.h
iostream
sigc++/trackable.h
bakery/View/View.h
glibmm.h
GtkDialogs.h
App_WithDoc.h
Document.h
Document_XML.h
View_Composite.h
bakery.h
App_WithDoc_Gtk.h
View.h
Bakery::Document
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_DOCUMENT_H
    #defineBAKERY_DOCUMENT_H

    #include"bakery/View/View.h"
    #include<glibmm.h>

    #include<iostream>

    namespaceBakery
    {

    classDocument
    {
    public:
    Document();
    virtual~Document();

    /*Savesthedatatodisk.
    *AskstheViewtoupdatethisdocumentbeforesavingtodisk,
    *butyoushouldprobablyensurethatthedocumentisupdatedmoreregularlythanthis,
    *sothatdifferentpartsoftheGUIaresynchronized.
    *Onlysavesifthedocumenthasbeenmodified.
    *boolindicatessuccess.
    */
    boolsave();

    /*Loadsdatafromdisk,usingtheURI(setwithset_file_uri())thenaskstheViewtoupdateitself.
    *boolindicatessuccess.
    */
    boolload();

    //Thiscan'tbevirtualbecausethatwouldbreakABI.
    //Hopefullyitdoesn'tneedtobe.
    /*Loadsdatafromdisk,usingtheURI(setwithset_file_uri())thenaskstheViewtoupdateitself.
    *boolindicatessuccess.
    */
    boolload_from_data(constguchar*data,std::size_tlength);

    virtualboolget_modified()const;
    virtualvoidset_modified(boolbVal=true);

    virtualboolget_is_new()const;
    voidset_is_new(boolbVal);

    virtualGlib::ustringget_contents()const;
    virtualvoidset_contents(constGlib::ustring&strVal);

    virtualGlib::ustringget_file_uri_with_extension(constGlib::ustring&uri);

    virtualGlib::ustringget_file_uri()const;
    virtualvoidset_file_uri(constGlib::ustring&file_uri,boolbEnforceFileExtension=false);

    virtualGlib::ustringget_name()const;
    staticGlib::ustringutil_file_uri_get_name(constGlib::ustring&file_uri,constGlib::ustring&file_extension);

    virtualboolget_read_only()const;
    virtualvoidset_read_only(boolbVal);

    virtualvoidset_view(ViewBase*pView);
    virtualViewBase*get_view();

    virtualvoidset_file_extension(constGlib::ustring&strVal);
    virtualGlib::ustringget_file_extension()const;

    //Signals
    typedefsigc::signal<void,bool>type_signal_modified;

    type_signal_modified&signal_modified();

    typedefsigc::signal<void>type_signal_forget;

    type_signal_forget&signal_forget();

    protected:
    virtualboolload_after();

    virtualboolsave_before();

    virtualboolread_from_disk();
    virtualboolwrite_to_disk();

    Glib::ustringm_strContents;
    Glib::ustringm_file_uri;
    Glib::ustringm_file_extension;

    ViewBase*m_pView;

    type_signal_modifiedsignal_modified_;
    type_signal_forgetsignal_forget_;

    boolm_bModified;
    boolm_bIsNew;//seeget_is_new().
    boolm_bReadOnly;
    };

    }//namespace

    #endif//GNOME_APPWITHDOCS_DOCUMENT_H