Skip to content
Snippets Groups Projects
ProjectManagerStore.h 1.66 KiB
Newer Older
  • Learn to ignore specific revisions
  • //  ************************************************************************************************
    
    //  BornAgain: simulate and fit reflection and scattering
    
    t.knopff's avatar
    t.knopff committed
    //! @file      GUI/mainwindow/AppSvc.h
    
    //!
    //! @homepage  http://www.bornagainproject.org
    //! @license   GNU General Public License v3 or higher (see COPYING)
    
    //! @copyright Forschungszentrum Jülich GmbH 2018
    //! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
    
    //  ************************************************************************************************
    
    t.knopff's avatar
    t.knopff committed
    #ifndef BORNAGAIN_GUI_MAINWINDOW_APPSVC_H
    #define BORNAGAIN_GUI_MAINWINDOW_APPSVC_H
    
    #include "GUI/Models/ISingleton.h"
    
    class MaterialModel;
    
    //! The AppSvc class provides common access for key components of the GUI.
    
    class AppSvc : public ISingleton<AppSvc> {
    
        friend class ISingleton<AppSvc>;
    
        static ProjectManager* projectManager();
        static void subscribe(ProjectManager* projectManager);
        static void unsubscribe(ProjectManager* projectManager);
    
        static MaterialModel* materialModel();
        static void subscribe(MaterialModel* materialModel);
        static void unsubscribe(MaterialModel* materialModel);
    
    private:
        AppSvc();
        ProjectManager* this_projectManager();
        MaterialModel* this_materialModel();
        void this_subscribe(ProjectManager* projectManager);
        void this_unsubscribe(ProjectManager* projectManager);
        void this_subscribe(MaterialModel* materialModel);
        void this_unsubscribe(MaterialModel* materialModel);
    
        ProjectManager* m_projectManager;
        MaterialModel* m_materialModel;
    
    t.knopff's avatar
    t.knopff committed
    #endif // BORNAGAIN_GUI_MAINWINDOW_APPSVC_H