Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*************************************************************************
3 : *
4 : * The Contents of this file are made available subject to the terms of
5 : * either of the following licenses
6 : *
7 : * - GNU Lesser General Public License Version 2.1
8 : * - Sun Industry Standards Source License Version 1.1
9 : *
10 : * Sun Microsystems Inc., October, 2000
11 : *
12 : * GNU Lesser General Public License Version 2.1
13 : * =============================================
14 : * Copyright 2000 by Sun Microsystems, Inc.
15 : * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 : *
17 : * This library is free software; you can redistribute it and/or
18 : * modify it under the terms of the GNU Lesser General Public
19 : * License version 2.1, as published by the Free Software Foundation.
20 : *
21 : * This library is distributed in the hope that it will be useful,
22 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 : * Lesser General Public License for more details.
25 : *
26 : * You should have received a copy of the GNU Lesser General Public
27 : * License along with this library; if not, write to the Free Software
28 : * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 : * MA 02111-1307 USA
30 : *
31 : *
32 : * Sun Industry Standards Source License Version 1.1
33 : * =================================================
34 : * The contents of this file are subject to the Sun Industry Standards
35 : * Source License Version 1.1 (the "License"); You may not use this file
36 : * except in compliance with the License. You may obtain a copy of the
37 : * License at http://www.openoffice.org/license.html.
38 : *
39 : * Software provided under this License is provided on an "AS IS" basis,
40 : * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 : * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 : * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 : * See the License for the specific provisions governing your rights and
44 : * obligations concerning the Software.
45 : *
46 : * The Initial Developer of the Original Code is: IBM Corporation
47 : *
48 : * Copyright: 2008 by IBM Corporation
49 : *
50 : * All Rights Reserved.
51 : *
52 : * Contributor(s): _______________________________________
53 : *
54 : *
55 : ************************************************************************/
56 : /*************************************************************************
57 : * @file
58 : * doc field.
59 : ************************************************************************/
60 : #include "xfdocfield.hxx"
61 :
62 2 : void XFFileName::SetType(const OUString& sType)
63 : {
64 2 : m_strType = sType;
65 2 : }
66 :
67 1 : void XFFileName::ToXml(IXFStream *pStrm)
68 : {
69 1 : IXFAttrList *pAttrList = pStrm->GetAttrList();
70 1 : pAttrList->Clear();
71 1 : if (m_strType.equals("FileName"))
72 1 : pAttrList->AddAttribute( "text:display", "name-and-extension" );
73 0 : else if (m_strType.equals("Path"))
74 0 : pAttrList->AddAttribute( "text:display", "path" );
75 1 : pStrm->StartElement( "text:file-name" );
76 1 : pStrm->EndElement( "text:file-name" );
77 1 : }
78 :
79 0 : void XFWordCount::ToXml(IXFStream *pStrm)
80 : {
81 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
82 0 : pAttrList->Clear();
83 0 : pStrm->StartElement( "text:word-count" );
84 0 : pStrm->EndElement( "text:word-count" );
85 0 : }
86 :
87 0 : void XFCharCount::ToXml(IXFStream *pStrm)
88 : {
89 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
90 0 : pAttrList->Clear();
91 0 : pStrm->StartElement( "text:character-count" );
92 0 : pStrm->EndElement( "text:character-count" );
93 0 : }
94 :
95 0 : void XFDescription::ToXml(IXFStream *pStrm)
96 : {
97 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
98 0 : pAttrList->Clear();
99 0 : pStrm->StartElement( "text:description" );
100 0 : pStrm->EndElement( "text:description" );
101 0 : }
102 :
103 0 : void XFPageCountStart::ToXml(IXFStream *pStrm)
104 : {
105 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
106 0 : pAttrList->Clear();
107 0 : pStrm->StartElement( "text:page-count" );
108 0 : }
109 0 : void XFPageCountEnd::ToXml(IXFStream *pStrm)
110 : {
111 0 : pStrm->EndElement( "text:page-count" );
112 0 : }
113 :
114 0 : void XFWordCountStart::ToXml(IXFStream *pStrm)
115 : {
116 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
117 0 : pAttrList->Clear();
118 0 : pStrm->StartElement( "text:word-count" );
119 0 : }
120 :
121 0 : void XFCharCountStart::ToXml(IXFStream *pStrm)
122 : {
123 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
124 0 : pAttrList->Clear();
125 0 : pStrm->StartElement( "text:character-count" );
126 0 : }
127 :
128 0 : void XFDescriptionStart::ToXml(IXFStream *pStrm)
129 : {
130 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
131 0 : pAttrList->Clear();
132 0 : pStrm->StartElement( "text:description" );
133 0 : }
134 :
135 0 : void XFWordCountEnd::ToXml(IXFStream *pStrm)
136 : {
137 0 : pStrm->EndElement( "text:word-count" );
138 0 : }
139 :
140 0 : void XFCharCountEnd::ToXml(IXFStream *pStrm)
141 : {
142 0 : pStrm->EndElement( "text:character-count" );
143 0 : }
144 :
145 0 : void XFDescriptionEnd::ToXml(IXFStream *pStrm)
146 : {
147 0 : pStrm->EndElement( "text:description" );
148 0 : }
149 :
150 0 : void XFKeywords::ToXml(IXFStream *pStrm)
151 : {
152 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
153 0 : pAttrList->Clear();
154 0 : pStrm->StartElement( "text:keywords" );
155 0 : pStrm->EndElement( "text:keywords" );
156 0 : }
157 :
158 0 : void XFTotalEditTime::ToXml(IXFStream *pStrm)
159 : {
160 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
161 0 : pAttrList->Clear();
162 0 : if (!m_strStyleName.isEmpty())
163 0 : pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
164 0 : pStrm->StartElement( "text:editing-duration" );
165 0 : pStrm->EndElement( "text:editing-duration" );
166 0 : }
167 0 : void XFTotalEditTimeStart::ToXml(IXFStream *pStrm)
168 : {
169 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
170 0 : pAttrList->Clear();
171 0 : if (!m_strStyleName.isEmpty())
172 0 : pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
173 0 : pStrm->StartElement( "text:editing-duration" );
174 0 : }
175 0 : void XFTotalEditTimeEnd::ToXml(IXFStream *pStrm)
176 : {
177 0 : pStrm->EndElement( "text:editing-duration" );
178 0 : }
179 0 : void XFCreateTime::ToXml(IXFStream *pStrm)
180 : {
181 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
182 0 : pAttrList->Clear();
183 0 : if (!m_strStyleName.isEmpty())
184 0 : pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
185 0 : pStrm->StartElement( "text:creation-time" );
186 0 : pStrm->EndElement( "text:creation-time" );
187 0 : }
188 0 : void XFLastEditTime::ToXml(IXFStream *pStrm)
189 : {
190 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
191 0 : pAttrList->Clear();
192 0 : if (!m_strStyleName.isEmpty())
193 0 : pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
194 0 : pStrm->StartElement( "text:modification-time" );
195 0 : pStrm->EndElement( "text:modification-time" );
196 0 : }
197 :
198 0 : void XFCreateTimeStart::ToXml(IXFStream *pStrm)
199 : {
200 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
201 0 : pAttrList->Clear();
202 0 : if (!m_strStyleName.isEmpty())
203 0 : pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
204 0 : pStrm->StartElement( "text:creation-time" );
205 0 : }
206 :
207 0 : void XFLastEditTimeStart::ToXml(IXFStream *pStrm)
208 : {
209 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
210 0 : pAttrList->Clear();
211 0 : if (!m_strStyleName.isEmpty())
212 0 : pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
213 0 : pStrm->StartElement( "text:modification-time" );
214 0 : }
215 0 : void XFCreateTimeEnd::ToXml(IXFStream *pStrm)
216 : {
217 0 : pStrm->EndElement( "text:creation-time" );
218 0 : }
219 :
220 0 : void XFLastEditTimeEnd::ToXml(IXFStream *pStrm)
221 : {
222 0 : pStrm->EndElement( "text:modification-time" );
223 0 : }
224 :
225 0 : void XFInitialCreator::ToXml(IXFStream *pStrm)
226 : {
227 0 : IXFAttrList *pAttrList = pStrm->GetAttrList();
228 0 : pAttrList->Clear();
229 0 : pStrm->StartElement( "text:initial-creator" );
230 0 : pStrm->EndElement( "text:initial-creator" );
231 0 : }
232 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|