GUIDOLib  1.7.7
Guido Engine Internal Documentation
ARPageFormat.h
1 #ifndef ARPageFormat_H
2 #define ARPageFormat_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2002 Holger Hoos, Juergen Kilian, Kai Renz
7  Copyright (C) 2002-2017 Grame
8 
9  This Source Code Form is subject to the terms of the Mozilla Public
10  License, v. 2.0. If a copy of the MPL was not distributed with this
11  file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 
13  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
14  research@grame.fr
15 
16 */
17 
18 #include <vector>
19 #include <string>
20 
21 #include "ARMTParameter.h"
22 
23 /*@mkdoc
24 
25 @group:Layout
26 
27 @tagname:\pageFormat
28 @tagalias:
29 @tagtype:P
30 @tagnotation:sets the page format
31 @tagdesc
32 The **\pageFormat** tag indicates the score page format. It should be set at the beginning of the first staff.
33 When no page format is encountered, the default page format is 21cm x 29.6 (A4) and the margins are set to 2 cm.
34 @tagend
35 
36 @params:
37 @param:type:string:A4, A3 or letter:*none*:false when w and h are not present
38 @param:w:unit:the page width:*none*:false when type is not present
39 @param:h:unit:the page height:*none*:false when type is not present
40 @param:lm:unit:the left margin size:2cm:true
41 @param:tm:unit:the top margin size:5cm:true
42 @param:rm:unit:the right margin size:2cm:true
43 @param:bm:unit:the bottom margin size:3cm:true
44 @paramdesc
45 See the [Layout](@EXAMPLES/layout/) example.
46 @paramend
47 
48 */
49 
53 {
54  public:
55  ARPageFormat();
56  virtual ~ARPageFormat() {}
57 
58  void getPageFormat(float * sx, float * sy, float * ml, float * mt, float * mr, float * mb ) const;
59  void setPageFormat(float sx, float sy, float ml, float mt, float mr, float mb );
60 
61  void operator=(const ARPageFormat& format);
62  virtual bool IsStateTag() const { return true; }
63 
64  virtual TagParameterMap checkTagParameters (TagParametersList& params, const std::string pTemplate);
65  virtual void setTagParameters (const TagParameterMap& params);
66 
67  virtual const char* getParamsStr() const { return kARPageFormatParams; };
68  virtual const char* getTagName() const { return "ARPageFormat"; };
69  virtual std::string getGMNName() const { return "\\pageFormat"; };
70 
71  protected:
72  void ClipSize();
73  void AdjustMargins();
74 
75  float mSizeX; // All sizes are in internal (logical) units.
76  float mSizeY;
77  float mLeft;
78  float mTop;
79  float mRight;
80  float mBottom;
81  std::string mFormat;
82 
83  private:
84  void getMargins (const TagParameterMap& params);
85 };
86 
87 #endif
ARPageFormat::setTagParameters
virtual void setTagParameters(const TagParameterMap &params)
ARPageFormat::getParamsStr
virtual const char * getParamsStr() const
Definition: ARPageFormat.h:67
ARPageFormat::setPageFormat
void setPageFormat(float sx, float sy, float ml, float mt, float mr, float mb)
ARPageFormat::mSizeY
float mSizeY
Definition: ARPageFormat.h:76
ARPageFormat::mLeft
float mLeft
Definition: ARPageFormat.h:77
ARPageFormat::mBottom
float mBottom
Definition: ARPageFormat.h:80
ARPageFormat::operator=
void operator=(const ARPageFormat &format)
ARMTParameter
not yet documented
Definition: ARMTParameter.h:24
ARPageFormat::mTop
float mTop
Definition: ARPageFormat.h:78
ARPageFormat::getPageFormat
void getPageFormat(float *sx, float *sy, float *ml, float *mt, float *mr, float *mb) const
ARPageFormat::checkTagParameters
virtual TagParameterMap checkTagParameters(TagParametersList &params, const std::string pTemplate)
ARPageFormat::AdjustMargins
void AdjustMargins()
ARPageFormat::~ARPageFormat
virtual ~ARPageFormat()
Definition: ARPageFormat.h:56
ARPageFormat::mSizeX
float mSizeX
Definition: ARPageFormat.h:75
ARPageFormat::getGMNName
virtual std::string getGMNName() const
Definition: ARPageFormat.h:69
ARPageFormat
not yet documented
Definition: ARPageFormat.h:52
ARPageFormat::IsStateTag
virtual bool IsStateTag() const
Definition: ARPageFormat.h:62
ARPageFormat::getTagName
virtual const char * getTagName() const
Definition: ARPageFormat.h:68
TagParameterMap
A list of tag parameters represented as a map.
Definition: TagParameterMap.h:31
ARPageFormat::ARPageFormat
ARPageFormat()
ARPageFormat::mFormat
std::string mFormat
Definition: ARPageFormat.h:81
ARPageFormat::ClipSize
void ClipSize()
ARPageFormat::mRight
float mRight
Definition: ARPageFormat.h:79

Guido Project Copyright © 2019 Grame-CNCM