Verovio
Source code documentation
facsimileinterface.h
1 // Name: facsimileinterface.h
3 // Author: Juliette Regimbal
4 // Created: 2018
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_FACSIMILE_INTERFACE_H__
9 #define __VRV_FACSIMILE_INTERFACE_H__
10 
11 #include "atts_facsimile.h"
12 #include "atts_shared.h"
13 #include "interface.h"
14 
15 namespace vrv {
16 
17 class Facsimile;
18 class PrepareFacsimileFunctor;
19 class ResetDataFunctor;
20 class Surface;
21 class Zone;
22 
23 //----------------------------------------------------------------------------
24 // FacsimileInterface
25 //----------------------------------------------------------------------------
26 
27 class FacsimileInterface : public Interface, public AttFacsimile {
28 public:
35  virtual ~FacsimileInterface();
36  void Reset() override;
37  InterfaceId IsInterface() const override { return INTERFACE_FACSIMILE; }
39 
40  virtual int GetDrawingX() const;
41  virtual int GetDrawingY() const;
42 
43  int GetWidth() const;
44  int GetHeight() const;
45 
46  double GetDrawingRotate() const;
47 
49  bool HasFacsimile() const { return this->HasFacs(); }
50 
52  void AttachZone(Zone *zone);
53 
54  int GetSurfaceY() const;
55 
57  Zone *GetZone() { return m_zone; }
59  const Zone *GetZone() const { return m_zone; }
62 
64  Surface *GetSurface() { return m_surface; }
66  const Surface *GetSurface() const { return m_surface; }
68 
69  //-----------------//
70  // Pseudo functors //
71  //-----------------//
72 
78  FunctorCode InterfacePrepareFacsimile(PrepareFacsimileFunctor &functor, Object *object);
80  FunctorCode InterfaceResetData(ResetDataFunctor &functor, Object *object);
82 
83 private:
84  Zone *m_zone;
85  Surface *m_surface;
86 };
87 } // namespace vrv
88 #endif
vrv::FacsimileInterface::InterfacePrepareFacsimile
FunctorCode InterfacePrepareFacsimile(PrepareFacsimileFunctor &functor, Object *object)
We have functor code in the interface for avoiding code duplication in each implementation class.
vrv::FacsimileInterface::GetZone
Zone * GetZone()
Get the zone.
Definition: facsimileinterface.h:58
vrv::Zone
Implements the zone element in MEI.
Definition: zone.h:30
vrv::FacsimileInterface::AttachZone
void AttachZone(Zone *zone)
Link to the zone.
vrv::Interface
This is a base class for regrouping MEI att classes.
Definition: interface.h:32
vrv::FacsimileInterface::Reset
void Reset() override
Virtual reset method.
vrv::FacsimileInterface::IsInterface
InterfaceId IsInterface() const override
Virtual method returning the InterfaceId of the interface.
Definition: facsimileinterface.h:37
vrv::FacsimileInterface::GetSurface
Surface * GetSurface()
Get the surface.
Definition: facsimileinterface.h:65
vrv::FacsimileInterface
Definition: facsimileinterface.h:27
vrv::FacsimileInterface::HasFacsimile
bool HasFacsimile() const
Check if the object has a facsimile.
Definition: facsimileinterface.h:49