3 * Copyright (C) 2008-2009 Didier Villevalois
4 * Copyright (C) 2008-2012 Florian Brosch
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 * Didier 'Ptitjes Villevalois <ptitjes@free.fr>
25 public class Valadoc
.Content
.Run
: InlineContent
, Inline
{
48 public static Style?
from_string (string str
) {
60 return Style
.UNDERLINED
;
63 return Style
.MONOSPACED
;
69 return Style
.LANG_ESCAPE
;
72 return Style
.LANG_KEYWORD
;
75 return Style
.LANG_LITERAL
;
77 case "lang-basic-type":
78 return Style
.LANG_BASIC_TYPE
;
81 return Style
.LANG_TYPE
;
83 case "lang-preprocessor":
84 return Style
.LANG_PREPROCESSOR
;
87 return Style
.LANG_COMMENT
;
90 return Style
.XML_ESCAPE
;
93 return Style
.XML_ELEMENT
;
96 return Style
.XML_ATTRIBUTE
;
98 case "xml-attribute-value":
99 return Style
.XML_ATTRIBUTE_VALUE
;
102 return Style
.XML_COMMENT
;
105 return Style
.XML_CDATA
;
111 public unowned
string to_string () {
122 case Style
.UNDERLINED
:
125 case Style
.MONOSPACED
:
131 case Style
.LANG_ESCAPE
:
132 return "lang-escape";
134 case Style
.LANG_KEYWORD
:
135 return "lang-keyword";
137 case Style
.LANG_LITERAL
:
138 return "lang-literal";
140 case Style
.LANG_BASIC_TYPE
:
141 return "lang-basic-type";
143 case Style
.LANG_TYPE
:
146 case Style
.LANG_PREPROCESSOR
:
147 return "lang-preprocessor";
149 case Style
.LANG_COMMENT
:
150 return "lang-comment";
152 case Style
.XML_ESCAPE
:
155 case Style
.XML_ELEMENT
:
156 return "xml-element";
158 case Style
.XML_ATTRIBUTE
:
159 return "xml-attribute";
161 case Style
.XML_ATTRIBUTE_VALUE
:
162 return "xml-attribute-value";
164 case Style
.XML_COMMENT
:
165 return "xml-comment";
167 case Style
.XML_CDATA
:
176 public Style style
{ get; set; }
178 internal Run (Style style
) {
183 public override void check (Api
.Tree api_root
, Api
.Node container
, string file_path
,
184 ErrorReporter reporter
, Settings settings
)
186 // Check inline content
187 base.check (api_root
, container
, file_path
, reporter
, settings
);
190 public override void accept (ContentVisitor visitor
) {
191 visitor
.visit_run (this
);
194 public override ContentElement
copy (ContentElement? new_parent
= null) {
195 Run run
= new
Run (style
);
196 run
.parent
= new_parent
;
198 foreach (Inline element
in content
) {
199 Inline copy
= element
.copy (run
) as Inline
;
200 run
.content
.add (copy
);