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