Scroom  0.14
scroominterface.hh
Go to the documentation of this file.
1 /*
2  * Scroom - Generic viewer for 2D data
3  * Copyright (C) 2009-2022 Kees-Jan Dijkzeul
4  *
5  * SPDX-License-Identifier: LGPL-2.1
6  */
7 
8 #pragma once
9 
10 #include <list>
11 #include <string>
12 
13 #include <boost/shared_ptr.hpp>
14 
15 #include <gtk/gtk.h>
16 
17 #include <scroom/bookkeeping.hh>
18 #include <scroom/interface.hh>
20 #include <scroom/viewinterface.hh>
21 
22 class ScroomInterface : private Interface
23 {
24 public:
25  using Ptr = boost::shared_ptr<ScroomInterface>;
26 
27 public:
28  virtual PresentationInterface::Ptr newPresentation(const std::string& name) = 0;
29  virtual Aggregate::Ptr newAggregate(const std::string& name) = 0;
30  virtual PresentationInterface::Ptr loadPresentation(const std::string& name, const std::string& relativeTo = std::string()) = 0;
31 
32  virtual void showPresentation(PresentationInterface::Ptr const& presentation) = 0;
33 };
34 
36 {
37 public:
38  using Ptr = boost::shared_ptr<NewPresentationInterface>;
39 
40 public:
42 };
43 
45 {
46 public:
47  using Ptr = boost::shared_ptr<NewAggregateInterface>;
48 
49 public:
50  virtual Aggregate::Ptr createNew() = 0;
51 };
52 
54 {
55 public:
56  using Ptr = boost::shared_ptr<OpenPresentationInterface>;
57 
58 public:
59  virtual std::list<GtkFileFilter*> getFilters() = 0;
60 
61  virtual PresentationInterface::Ptr open(const std::string& fileName) = 0;
62 };
63 
64 namespace Scroom::TiledBitmap
65 {
66  class OpenTiledBitmapInterface;
67 } // namespace Scroom::TiledBitmap
68 
69 class OpenInterface : private Interface
70 {
71 public:
72  using Ptr = boost::shared_ptr<OpenInterface>;
73 
74 public:
75  virtual std::list<GtkFileFilter*> getFilters() = 0;
76 
77  virtual void open(const std::string& fileName, ScroomInterface::Ptr const& scroomInterface) = 0;
78 };
79 
81 {
82 public:
83  using Ptr = boost::shared_ptr<PresentationObserver>;
84 
85 public:
87  virtual void presentationDeleted() = 0;
88 };
89 
90 class ViewObserver : private Interface
91 {
92 public:
93  using Ptr = boost::shared_ptr<ViewObserver>;
94 
95 public:
97 };
98 
100 {
101 public:
102  using Ptr = boost::shared_ptr<ScroomPluginInterface>;
103 
104 public:
105  virtual void registerNewPresentationInterface(const std::string& identifier,
106  NewPresentationInterface::Ptr newPresentationInterface) = 0;
107  virtual void registerNewAggregateInterface(const std::string& identifier, NewAggregateInterface::Ptr newAggregateInterface) = 0;
108  virtual void registerOpenPresentationInterface(const std::string& identifier,
109  OpenPresentationInterface::Ptr openPresentationInterface) = 0;
111  const std::string& identifier,
112  boost::shared_ptr<Scroom::TiledBitmap::OpenTiledBitmapInterface> openTiledBitmapInterface) = 0;
113  virtual void registerOpenInterface(const std::string& identifier, OpenInterface::Ptr openInterface) = 0;
114  virtual void registerViewObserver(const std::string& identifier, ViewObserver::Ptr observer) = 0;
115  virtual void registerPresentationObserver(const std::string& identifier, PresentationObserver::Ptr observer) = 0;
116 };
OpenPresentationInterface::Ptr
boost::shared_ptr< OpenPresentationInterface > Ptr
Definition: scroominterface.hh:56
ViewObserver
Definition: scroominterface.hh:90
PresentationObserver::Ptr
boost::shared_ptr< PresentationObserver > Ptr
Definition: scroominterface.hh:83
ScroomInterface::loadPresentation
virtual PresentationInterface::Ptr loadPresentation(const std::string &name, const std::string &relativeTo=std::string())=0
PresentationObserver
Definition: scroominterface.hh:80
ScroomPluginInterface::registerNewAggregateInterface
virtual void registerNewAggregateInterface(const std::string &identifier, NewAggregateInterface::Ptr newAggregateInterface)=0
presentationinterface.hh
ScroomInterface::showPresentation
virtual void showPresentation(PresentationInterface::Ptr const &presentation)=0
ViewInterface::Ptr
boost::shared_ptr< ViewInterface > Ptr
Definition: viewinterface.hh:193
NewAggregateInterface::Ptr
boost::shared_ptr< NewAggregateInterface > Ptr
Definition: scroominterface.hh:47
ScroomPluginInterface::registerOpenTiledBitmapInterface
virtual void registerOpenTiledBitmapInterface(const std::string &identifier, boost::shared_ptr< Scroom::TiledBitmap::OpenTiledBitmapInterface > openTiledBitmapInterface)=0
OpenPresentationInterface::open
virtual PresentationInterface::Ptr open(const std::string &fileName)=0
ViewObserver::viewAdded
virtual Scroom::Bookkeeping::Token viewAdded(ViewInterface::Ptr v)=0
OpenInterface::open
virtual void open(const std::string &fileName, ScroomInterface::Ptr const &scroomInterface)=0
NewAggregateInterface
Definition: scroominterface.hh:44
NewPresentationInterface
Definition: scroominterface.hh:35
OpenInterface::Ptr
boost::shared_ptr< OpenInterface > Ptr
Definition: scroominterface.hh:72
ScroomPluginInterface::registerPresentationObserver
virtual void registerPresentationObserver(const std::string &identifier, PresentationObserver::Ptr observer)=0
ScroomInterface
Definition: scroominterface.hh:22
ScroomPluginInterface::registerNewPresentationInterface
virtual void registerNewPresentationInterface(const std::string &identifier, NewPresentationInterface::Ptr newPresentationInterface)=0
ScroomPluginInterface::registerViewObserver
virtual void registerViewObserver(const std::string &identifier, ViewObserver::Ptr observer)=0
OpenPresentationInterface
Definition: scroominterface.hh:53
PresentationInterface::Ptr
boost::shared_ptr< PresentationInterface > Ptr
Definition: presentationinterface.hh:74
NewPresentationInterface::createNew
virtual PresentationInterface::Ptr createNew()=0
ScroomInterface::newAggregate
virtual Aggregate::Ptr newAggregate(const std::string &name)=0
Scroom::TiledBitmap
Definition: opentiledbitmapinterface.hh:21
OpenInterface::getFilters
virtual std::list< GtkFileFilter * > getFilters()=0
ScroomPluginInterface
Definition: scroominterface.hh:99
ScroomInterface::Ptr
boost::shared_ptr< ScroomInterface > Ptr
Definition: scroominterface.hh:25
ViewObserver::Ptr
boost::shared_ptr< ViewObserver > Ptr
Definition: scroominterface.hh:93
OpenInterface
Definition: scroominterface.hh:69
ScroomPluginInterface::registerOpenPresentationInterface
virtual void registerOpenPresentationInterface(const std::string &identifier, OpenPresentationInterface::Ptr openPresentationInterface)=0
NewAggregateInterface::createNew
virtual Aggregate::Ptr createNew()=0
viewinterface.hh
NewPresentationInterface::Ptr
boost::shared_ptr< NewPresentationInterface > Ptr
Definition: scroominterface.hh:38
Interface
Definition: interface.hh:10
ScroomPluginInterface::Ptr
boost::shared_ptr< ScroomPluginInterface > Ptr
Definition: scroominterface.hh:102
PresentationObserver::presentationDeleted
virtual void presentationDeleted()=0
PresentationObserver::presentationAdded
virtual void presentationAdded(PresentationInterface::Ptr p)=0
Scroom::Bookkeeping::Token
Definition: bookkeeping.hh:37
interface.hh
OpenPresentationInterface::getFilters
virtual std::list< GtkFileFilter * > getFilters()=0
Aggregate::Ptr
boost::shared_ptr< Aggregate > Ptr
Definition: presentationinterface.hh:147
bookkeeping.hh
ScroomInterface::newPresentation
virtual PresentationInterface::Ptr newPresentation(const std::string &name)=0
ScroomPluginInterface::registerOpenInterface
virtual void registerOpenInterface(const std::string &identifier, OpenInterface::Ptr openInterface)=0