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

    #include"ViewBase.h"
    #include"../Document/Document.h"
    #include<sigc++/sigc++.h>

    namespaceBakery
    {

    template<classT_Document>
    classView:publicViewBase
    {
    public:
    View()
    :m_pDocument(0)
    {
    }

    virtual~View()
    {
    }

    typedefView<T_Document>type_self;

    //typedeftypenameT_Documenttype_document;

    virtualT_Document*get_document()
    {
    returnm_pDocument;
    }

    virtualconstT_Document*get_document()const
    {
    returnm_pDocument;
    }

    virtualvoidset_document(T_Document*pDocument)
    {
    m_pDocument=pDocument;
    if(m_pDocument)
    m_pDocument->signal_forget().connect(sigc::mem_fun(*this,&type_self::on_document_forget));
    }

    virtualvoidset_modified(boolval=true)
    {
    if(m_pDocument)
    m_pDocument->set_modified(val);
    }

    protected:

    voidon_document_forget()
    {
    //Thisshouldpreventsomesegfaults:
    m_pDocument=0;
    }

    T_Document*m_pDocument;
    };

    }//namespace

    #endif//BAKERY_VIEW_H