Scroom 0.14-48-ga0fee447
Loading...
Searching...
No Matches
PresentationInterface Class Referenceabstract

#include <presentationinterface.hh>

Inheritance diagram for PresentationInterface:
Inheritance graph
Collaboration diagram for PresentationInterface:
Collaboration graph

Public Types

using Ptr = std::shared_ptr< PresentationInterface >
 
using WeakPtr = std::weak_ptr< PresentationInterface >
 
- Public Types inherited from Viewable
using Ptr = std::shared_ptr< Viewable >
 
using WeakPtr = std::weak_ptr< Viewable >
 
- Public Types inherited from Scroom::Utils::Observable< T >
using Observer = std::shared_ptr< T >
 
using Ptr = std::shared_ptr< Observable< T > >
 

Public Member Functions

virtual Scroom::Utils::Rectangle< double > getRect ()=0
 
virtual void redraw (ViewInterface::Ptr const &vi, cairo_t *cr, Scroom::Utils::Rectangle< double > presentationArea, int zoom)=0
 
virtual bool getProperty (const std::string &name, std::string &value)=0
 
virtual bool isPropertyDefined (const std::string &name)=0
 
virtual std::string getTitle ()=0
 
virtual Scroom::Utils::Context::ConstPtr getContext () const =0
 
- Public Member Functions inherited from Viewable
virtual void open (ViewInterface::WeakPtr vi)=0
 
virtual void close (ViewInterface::WeakPtr vi)=0
 
- Public Member Functions inherited from Scroom::Utils::Observable< T >
 Observable ()
 
 ~Observable () override
 
 Observable (const Observable &)=delete
 
 Observable (Observable &&)=delete
 
Observable operator= (const Observable &)=delete
 
Observable operator= (Observable &&)=delete
 
Scroom::Bookkeeping::Token registerStrongObserver (Observer const &observer)
 
Scroom::Bookkeeping::Token registerObserver (ObserverWeak const &observer)
 
- Public Member Functions inherited from Scroom::Utils::Base
 Base ()=default
 
 Base (const Base &)=delete
 
 Base (Base &&)=delete
 
Baseoperator= (const Base &)=delete
 
Baseoperator= (Base &&)=delete
 
virtual ~Base ()=default
 
template<typename R >
std::shared_ptr< R > shared_from_this ()
 
template<typename R >
std::shared_ptr< R const > shared_from_this () const
 

Additional Inherited Members

- Protected Member Functions inherited from Scroom::Utils::Observable< T >
std::list< ObservergetObservers ()
 
virtual void observerAdded (Observer const &observer, Scroom::Bookkeeping::Token const &token)
 

Detailed Description

Represent some 2D content

Anything that should be shown by Scroom in a window should implement this interface.

Objects implementing this interface are typically returned by NewPresentationInterface::createNew() and OpenPresentationInterface::open().

Member Typedef Documentation

◆ Ptr

◆ WeakPtr

Member Function Documentation

◆ getContext()

◆ getProperty()

virtual bool PresentationInterface::getProperty ( const std::string &  name,
std::string &  value 
)
pure virtual

Return the value of the requested property

Parameters
[in]nameThe name of the requested property
[out]valueThe value of the requested property
Return values
trueif the property existed
falseif the property didn't exist

Implemented in DummyPresentation, anonymous_namespace{determine-size-test.cc}::PresentationInterfaceStub, TransformPresentation, ExamplePresentation, TransparentOverlayPresentation, and anonymous_namespace{tiledbitmappresentation.cc}::TiledBitmapPresentation.

◆ getRect()

◆ getTitle()

◆ isPropertyDefined()

virtual bool PresentationInterface::isPropertyDefined ( const std::string &  name)
pure virtual

◆ redraw()

virtual void PresentationInterface::redraw ( ViewInterface::Ptr const &  vi,
cairo_t *  cr,
Scroom::Utils::Rectangle< double >  presentationArea,
int  zoom 
)
pure virtual

Draw the requested ara at the requested zoom level

Parameters
viThe ViewInterface on whose behalf the request is made
crThe context to draw the area on
presentationAreathe area that is to be drawn. The given x and y coordinates should map on 0,0 of the given context cr.
zoomThe requested zoom level. One pixel of your presentation should have size 2**zoom when drawn. zoom may be negative.

Implemented in anonymous_namespace{tiledbitmappresentation.cc}::TiledBitmapPresentation, DummyPresentation, anonymous_namespace{determine-size-test.cc}::PresentationInterfaceStub, TransformPresentation, ExamplePresentation, and TransparentOverlayPresentation.


The documentation for this class was generated from the following file: