LibMusicXML  3.18
msrWords.h
1 /*
2  MusicXML Library
3  Copyright (C) Grame 2006-2013
4 
5  This Source Code Form is subject to the terms of the Mozilla Public
6  License, v. 2.0. If a copy of the MPL was not distributed with this
7  file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
10  research@grame.fr
11 */
12 
13 #ifndef ___msrWords___
14 #define ___msrWords___
15 
16 #include "msrElements.h"
17 
18 #include "msrBasicTypes.h"
19 
20 
21 namespace MusicXML2
22 {
23 
24 //______________________________________________________________________________
25 class msrWords : public msrElement
26 {
27  public:
28 
29  // data types
30  // ------------------------------------------------------
31 
32  enum msrWordsFontStyleKind {
33  kNormalStyle, KItalicStyle };
34 
35  static string wordsFontStyleKindAsString (
36  msrWordsFontStyleKind wordsFontStyleKind);
37 
38  enum msrWordsFontWeightKind {
39  kNormalWeight, kBoldWeight };
40 
41  static string msrWordsFontWeightKindAsString (
42  msrWordsFontWeightKind wordsFontWeightKind);
43 
44  // creation from MusicXML
45  // ------------------------------------------------------
46 
47  static SMARTP<msrWords> create (
48  int inputLineNumber,
49  msrPlacementKind wordsPlacementKind,
50  string wordsContents,
51  msrJustifyKind wordsJustifyKind,
52  msrHorizontalAlignmentKind wordsHorizontalAlignmentKind,
53  msrVerticalAlignmentKind wordsVerticalAlignmentKind,
54  msrFontStyleKind wordsFontStyleKind,
55  S_msrFontSize wordsFontSize,
56  msrFontWeightKind wordsFontWeightKind,
57  msrXMLLangKind wordsXMLLangKind);
58 
59  protected:
60 
61  // constructors/destructor
62  // ------------------------------------------------------
63 
64  msrWords (
65  int inputLineNumber,
66  msrPlacementKind wordsPlacementKind,
67  string wordsContents,
68  msrJustifyKind wordsJustifyKind,
69  msrHorizontalAlignmentKind wordsHorizontalAlignmentKind,
70  msrVerticalAlignmentKind wordsVerticalAlignmentKind,
71  msrFontStyleKind wordsFontStyleKind,
72  S_msrFontSize wordsFontSize,
73  msrFontWeightKind wordsFontWeightKind,
74  msrXMLLangKind wordsXMLLangKind);
75 
76  virtual ~msrWords ();
77 
78  public:
79 
80  // set and get
81  // ------------------------------------------------------
82 
83  msrPlacementKind getWordsPlacementKind () const
84  { return fWordsPlacementKind; }
85 
86  string getWordsContents () const
87  { return fWordsContents; }
88 
89  msrJustifyKind getWordsJustifyKind () const
90  { return fWordsJustifyKind; }
91 
92  msrHorizontalAlignmentKind
93  getWordsHorizontalAlignmentKind () const
94  { return fWordsHorizontalAlignmentKind; }
95 
96  msrVerticalAlignmentKind
97  getWordsVerticalAlignmentKind () const
98  { return fWordsVerticalAlignmentKind; }
99 
100  msrFontStyleKind getWordsFontStyleKind () const
101  { return fWordsFontStyleKind; }
102 
103  S_msrFontSize getWordsFontSize () const
104  { return fWordsFontSize; }
105 
106  msrFontWeightKind getWordsFontWeightKind () const
107  { return fWordsFontWeightKind; }
108 
109  msrXMLLangKind getWordsXMLLangKind () const
110  { return fWordsXMLLangKind; }
111 
112  // services
113  // ------------------------------------------------------
114 
115  public:
116 
117  // visitors
118  // ------------------------------------------------------
119 
120  virtual void acceptIn (basevisitor* v);
121  virtual void acceptOut (basevisitor* v);
122 
123  virtual void browseData (basevisitor* v);
124 
125  public:
126 
127  // print
128  // ------------------------------------------------------
129 
130  string wordsPlacementKindAsString () const;
131 
132  string wordsJustifyKindAsString () const;
133 
134  string wordsHorizontalAlignmentKindAsString () const;
135  string wordsVerticalAlignmentKindAsString () const;
136 
137  string wordsFontStyleKindAsString () const;
138 
139  string wordsFontSizeAsString () const;
140 
141  string wordsFontWeightKindAsString () const;
142 
143  string asString () const;
144 
145  virtual void print (ostream& os) const;
146 
147  private:
148 
149  // fields
150  // ------------------------------------------------------
151 
152  msrPlacementKind fWordsPlacementKind;
153 
154  string fWordsContents;
155 
156  msrJustifyKind fWordsJustifyKind;
157 
158  msrHorizontalAlignmentKind
159  fWordsHorizontalAlignmentKind;
160  msrVerticalAlignmentKind
161  fWordsVerticalAlignmentKind;
162 
163  msrFontStyleKind fWordsFontStyleKind;
164  S_msrFontSize fWordsFontSize;
165  msrFontWeightKind fWordsFontWeightKind;
166 
167  msrXMLLangKind fWordsXMLLangKind;
168 };
170 EXP ostream& operator<< (ostream& os, const S_msrWords& elt);
171 
172 
173 } // namespace MusicXML2
174 
175 
176 #endif
MusicXML2::msrWords
Definition: msrWords.h:26
MusicXML2::SMARTP
the smart pointer implementation
Definition: smartpointer.h:58
MusicXML2::basevisitor
Definition: basevisitor.h:25
MusicXML2::msrElement
Definition: msrElements.h:26