Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
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 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : :
21 : : #include <xmltree.hxx>
22 : :
23 : :
24 : : // NOT FULLY DEFINED SERVICES
25 : : #include <cr_html.hxx>
26 : :
27 : :
28 : : char C_sMODULEDESCRIPTION[] = "module-description";
29 : : char C_sCOMPONENTDESCRIPTION[] = "component-description";
30 : : char C_sAuthor[] = "author";
31 : : char C_sName[] = "name";
32 : : char C_sDescription[] = "description";
33 : : char C_sReferenceDocu[] = "reference-docu";
34 : : char C_sModuleName[] = "module-name";
35 : : char C_sLoaderName[] = "loader-name";
36 : : char C_sSupportedService[] = "supported-service";
37 : : char C_sServiceDependency[] = "service-dependency";
38 : : char C_sProjectBuildDependency[] = "project-build-dependency";
39 : : char C_sRuntimeModuleDependency[] = "runtime-module-dependency";
40 : : char C_sLanguage[] = "language";
41 : : char C_sStatus[] = "status";
42 : : char C_sType[] = "type";
43 : : char C_sAttr_value[] = "value";
44 : : char C_sAttr_xl_href[] = "xlink:href";
45 : : char C_sAttr_xl_role[] = "xlink:role";
46 : : char C_sAttr_xl_title[] = "xlink:title";
47 : : char C_sAttr_xmlns[] = "xmlns:xlink";
48 : : char C_sAttr_xl_type[] = "xlink:type";
49 : : char C_sCompDescrListTitle[] = "Component Descriptions";
50 : :
51 : :
52 : : FreeChoiceElement * Create_ModuleDescrOptional_Element(
53 : : MultipleTextElement * &
54 : : o_rTypes,
55 : : MultipleTextElement * &
56 : : o_rServiceDependencies );
57 : : FreeChoiceElement * Create_CompDescrOptional_Element(
58 : : MultipleTextElement * &
59 : : o_rTypes,
60 : : MultipleTextElement * &
61 : : o_rServiceDependencies );
62 : :
63 : :
64 : :
65 : 2 : ModuleDescription::ModuleDescription()
66 : : : SequenceElement(C_sMODULEDESCRIPTION),
67 : : pModuleName(0),
68 : : pCdList(0),
69 : : pTypes(0),
70 : 2 : pServiceDependencies(0)
71 : : {
72 [ + - ][ + - ]: 2 : pModuleName = new MdName;
73 [ + - ]: 2 : AddChild( *pModuleName );
74 [ + - ][ + - ]: 2 : pCdList = new CompDescrList;
75 [ + - ]: 2 : AddChild( *pCdList );
76 [ + - ][ + - ]: 2 : AddChild( *Create_ModuleDescrOptional_Element( pTypes, pServiceDependencies ) );
77 : 2 : }
78 : :
79 : : const Simstr &
80 : 0 : ModuleDescription::ModuleName() const
81 : : {
82 : 0 : return pModuleName->Data();
83 : : }
84 : :
85 : : void
86 : 0 : ModuleDescription::Get_SupportedServices( List< const MultipleTextElement * > & o_rServices ) const
87 : : {
88 [ # # ]: 0 : o_rServices.push_back(pServiceDependencies);
89 : 0 : pCdList->Get_SupportedServices( o_rServices );
90 : 0 : }
91 : :
92 : : void
93 : 2 : ModuleDescription::Get_Types( List< const MultipleTextElement * > & o_rTypes ) const
94 : : {
95 [ + - ]: 2 : o_rTypes.push_back(pTypes);
96 : 2 : pCdList->Get_Types( o_rTypes );
97 : 2 : }
98 : :
99 : : void
100 : 0 : ModuleDescription::Get_ServiceDependencies( List< const MultipleTextElement * > & o_rServices ) const
101 : : {
102 : 0 : pCdList->Get_ServiceDependencies( o_rServices );
103 : 0 : }
104 : :
105 : 18 : ComponentDescription::ComponentDescription()
106 : : : SequenceElement(C_sCOMPONENTDESCRIPTION,1),
107 : : pComponentName(0),
108 : : pSupportedServices(0),
109 : : pTypes(0),
110 : 18 : pServiceDependencies(0)
111 : : {
112 [ + - ][ + - ]: 18 : AddChild( *new SglTextElement(C_sAuthor, lt_nolink, false) );
[ + - ]
113 [ + - ][ + - ]: 18 : pComponentName = new CdName;
114 [ + - ]: 18 : AddChild( *pComponentName );
115 [ + - ][ + - ]: 18 : AddChild( *new SglTextElement(C_sDescription, lt_nolink, false) );
[ + - ]
116 [ + - ][ + - ]: 18 : AddChild( *new SglTextElement(C_sLoaderName, lt_idl, true) );
[ + - ]
117 [ + - ][ + - ]: 18 : AddChild( *new SglTextElement(C_sLanguage, lt_nolink, false) );
[ + - ]
118 [ + - ][ + - ]: 18 : AddChild( *new SglAttrElement(C_sStatus, C_sAttr_value) );
[ + - ]
119 [ + - ][ + - ]: 18 : pSupportedServices = new SupportedService;
120 [ + - ]: 18 : AddChild( *pSupportedServices );
121 [ + - ][ + - ]: 18 : AddChild( *Create_CompDescrOptional_Element( pTypes, pServiceDependencies ) );
122 : 18 : }
123 : :
124 : 2 : CompDescrList::CompDescrList()
125 [ + - ]: 2 : : ListElement(C_sCOMPONENTDESCRIPTION, 0)
126 : : {
127 : 2 : }
128 : :
129 : : void
130 : 0 : CompDescrList::Write2Html( HtmlCreator & io_rHC ) const
131 : : {
132 : 0 : io_rHC.StartBigCell(C_sCompDescrListTitle);
133 : 0 : ListElement::Write2Html(io_rHC);
134 : 0 : io_rHC.FinishBigCell();
135 : 0 : }
136 : :
137 : : XmlElement *
138 : 18 : CompDescrList::Create_and_Add_NewElement()
139 : : {
140 [ + - ][ + - ]: 18 : ComponentDescription * pCD = new ComponentDescription;
141 [ + - ]: 18 : Children().push_back(pCD);
142 [ + - ]: 18 : aCDs.push_back(pCD);
143 : 18 : return pCD;
144 : : }
145 : :
146 : : void
147 : 0 : CompDescrList::Get_SupportedServices( List< const MultipleTextElement * > & o_rResult ) const
148 : : {
149 : 0 : unsigned i_max = aCDs.size();
150 [ # # ]: 0 : for (unsigned i = 0; i < i_max; ++i)
151 : : {
152 [ # # ]: 0 : o_rResult.push_back(& aCDs[i]->SupportedServices());
153 : : } // end for
154 : 0 : }
155 : :
156 : : void
157 : 2 : CompDescrList::Get_Types( List< const MultipleTextElement * > & o_rResult ) const
158 : : {
159 : 2 : unsigned i_max = aCDs.size();
160 [ + + ]: 20 : for (unsigned i = 0; i < i_max; ++i)
161 : : {
162 [ + - ]: 18 : o_rResult.push_back(& aCDs[i]->Types());
163 : : } // end for
164 : 2 : }
165 : :
166 : : void
167 : 0 : CompDescrList::Get_ServiceDependencies( List< const MultipleTextElement * > & o_rResult ) const
168 : : {
169 : 0 : unsigned i_max = aCDs.size();
170 [ # # ]: 0 : for (unsigned i = 0; i < i_max; ++i)
171 : : {
172 [ # # ]: 0 : o_rResult.push_back(& aCDs[i]->ServiceDependencies());
173 : : } // end for
174 : 0 : }
175 : :
176 : 2 : MdName::MdName()
177 : 2 : : SglTextElement(C_sModuleName, lt_html, false)
178 : : {
179 : 2 : }
180 : :
181 : : void
182 : 0 : MdName::Write2Html( HtmlCreator & io_rHC ) const
183 : : {
184 : 0 : io_rHC.Write_SglTextElement( *this, true );
185 : 0 : }
186 : :
187 : 18 : CdName::CdName()
188 : 18 : : SglTextElement(C_sName, lt_html, true)
189 : : {
190 : 18 : }
191 : :
192 : : void
193 : 0 : CdName::Write2Html( HtmlCreator & io_rHC ) const
194 : : {
195 : 0 : io_rHC.Write_SglTextElement( *this, true );
196 : 0 : }
197 : :
198 : 18 : SupportedService::SupportedService()
199 : 18 : : MultipleTextElement(C_sSupportedService, lt_idl, true)
200 : : {
201 : 18 : }
202 : :
203 : : FreeChoiceElement *
204 : 2 : Create_ModuleDescrOptional_Element( MultipleTextElement * & o_rTypes,
205 : : MultipleTextElement * & o_rServiceDependencies )
206 : : {
207 : 2 : FreeChoiceElement * ret = Create_CompDescrOptional_Element( o_rTypes, o_rServiceDependencies );
208 : :
209 [ + - ]: 2 : ret->AddChild( *new MultipleTextElement(C_sProjectBuildDependency, lt_nolink, false) );
210 [ + - ]: 2 : ret->AddChild( *new MultipleTextElement(C_sRuntimeModuleDependency, lt_nolink, false) );
211 : 2 : return ret;
212 : : }
213 : :
214 : : FreeChoiceElement *
215 : 20 : Create_CompDescrOptional_Element( MultipleTextElement * & o_rTypes,
216 : : MultipleTextElement * & o_rServiceDependencies )
217 : : {
218 [ + - ]: 20 : FreeChoiceElement * ret = new FreeChoiceElement;
219 : 20 : const unsigned C_sRefDocuAttrNumber = 5;
220 : : static const char * C_sRefDocuAttrNames[C_sRefDocuAttrNumber]
221 : : = { C_sAttr_xl_href, C_sAttr_xl_role, C_sAttr_xl_title, C_sAttr_xmlns, C_sAttr_xl_type };
222 : :
223 [ + - ]: 20 : ret->AddChild( *new MultipleAttrElement(C_sReferenceDocu, C_sRefDocuAttrNames, C_sRefDocuAttrNumber) );
224 [ + - ]: 20 : o_rServiceDependencies = new MultipleTextElement(C_sServiceDependency, lt_idl, true);
225 : 20 : ret->AddChild( *o_rServiceDependencies );
226 [ + - ]: 20 : o_rTypes = new MultipleTextElement(C_sType, lt_idl, true);
227 : 20 : ret->AddChild( *o_rTypes );
228 : 20 : return ret;
229 [ + - ][ + - ]: 6 : }
230 : :
231 : :
232 : :
233 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|