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 <xfilter/ixfattrlist.hxx>
61 #include <xfilter/ixfstream.hxx>
62 #include <xfilter/xfdocfield.hxx>
63 
SetType(const OUString & sType)64 void XFFileName::SetType(const OUString& sType)
65 {
66     m_strType = sType;
67 }
68 
ToXml(IXFStream * pStrm)69 void XFFileName::ToXml(IXFStream *pStrm)
70 {
71     IXFAttrList *pAttrList = pStrm->GetAttrList();
72     pAttrList->Clear();
73     if (m_strType == "FileName")
74         pAttrList->AddAttribute( "text:display", "name-and-extension" );
75     else if (m_strType == "Path")
76         pAttrList->AddAttribute( "text:display", "path" );
77     pStrm->StartElement( "text:file-name" );
78     pStrm->EndElement( "text:file-name" );
79 }
80 
ToXml(IXFStream * pStrm)81 void XFWordCount::ToXml(IXFStream *pStrm)
82 {
83     IXFAttrList *pAttrList = pStrm->GetAttrList();
84     pAttrList->Clear();
85     pStrm->StartElement( "text:word-count" );
86     pStrm->EndElement( "text:word-count" );
87 }
88 
ToXml(IXFStream * pStrm)89 void XFCharCount::ToXml(IXFStream *pStrm)
90 {
91     IXFAttrList *pAttrList = pStrm->GetAttrList();
92     pAttrList->Clear();
93     pStrm->StartElement( "text:character-count" );
94     pStrm->EndElement( "text:character-count" );
95 }
96 
ToXml(IXFStream * pStrm)97 void XFDescription::ToXml(IXFStream *pStrm)
98 {
99     IXFAttrList *pAttrList = pStrm->GetAttrList();
100     pAttrList->Clear();
101     pStrm->StartElement( "text:description" );
102     pStrm->EndElement( "text:description" );
103 }
104 
ToXml(IXFStream * pStrm)105 void XFPageCountStart::ToXml(IXFStream *pStrm)
106 {
107     IXFAttrList *pAttrList = pStrm->GetAttrList();
108     pAttrList->Clear();
109     pStrm->StartElement( "text:page-count" );
110 }
ToXml(IXFStream * pStrm)111 void XFPageCountEnd::ToXml(IXFStream *pStrm)
112 {
113     pStrm->EndElement( "text:page-count" );
114 }
115 
ToXml(IXFStream * pStrm)116 void XFWordCountStart::ToXml(IXFStream *pStrm)
117 {
118     IXFAttrList *pAttrList = pStrm->GetAttrList();
119     pAttrList->Clear();
120     pStrm->StartElement( "text:word-count" );
121 }
122 
ToXml(IXFStream * pStrm)123 void XFCharCountStart::ToXml(IXFStream *pStrm)
124 {
125     IXFAttrList *pAttrList = pStrm->GetAttrList();
126     pAttrList->Clear();
127     pStrm->StartElement( "text:character-count" );
128 }
129 
ToXml(IXFStream * pStrm)130 void XFDescriptionStart::ToXml(IXFStream *pStrm)
131 {
132     IXFAttrList *pAttrList = pStrm->GetAttrList();
133     pAttrList->Clear();
134     pStrm->StartElement( "text:description" );
135 }
136 
ToXml(IXFStream * pStrm)137 void XFWordCountEnd::ToXml(IXFStream *pStrm)
138 {
139     pStrm->EndElement( "text:word-count" );
140 }
141 
ToXml(IXFStream * pStrm)142 void XFCharCountEnd::ToXml(IXFStream *pStrm)
143 {
144     pStrm->EndElement( "text:character-count" );
145 }
146 
ToXml(IXFStream * pStrm)147 void XFDescriptionEnd::ToXml(IXFStream *pStrm)
148 {
149     pStrm->EndElement( "text:description" );
150 }
151 
ToXml(IXFStream * pStrm)152 void XFKeywords::ToXml(IXFStream *pStrm)
153 {
154     IXFAttrList *pAttrList = pStrm->GetAttrList();
155     pAttrList->Clear();
156     pStrm->StartElement( "text:keywords" );
157     pStrm->EndElement( "text:keywords" );
158 }
159 
ToXml(IXFStream * pStrm)160 void XFTotalEditTime::ToXml(IXFStream *pStrm)
161 {
162     IXFAttrList *pAttrList = pStrm->GetAttrList();
163     pAttrList->Clear();
164     if (!m_strStyleName.isEmpty())
165         pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
166     pStrm->StartElement( "text:editing-duration" );
167     pStrm->EndElement( "text:editing-duration" );
168 }
ToXml(IXFStream * pStrm)169 void XFTotalEditTimeStart::ToXml(IXFStream *pStrm)
170 {
171     IXFAttrList *pAttrList = pStrm->GetAttrList();
172     pAttrList->Clear();
173     if (!m_strStyleName.isEmpty())
174         pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
175     pStrm->StartElement( "text:editing-duration" );
176 }
ToXml(IXFStream * pStrm)177 void XFTotalEditTimeEnd::ToXml(IXFStream *pStrm)
178 {
179     pStrm->EndElement( "text:editing-duration" );
180 }
ToXml(IXFStream * pStrm)181 void XFCreateTime::ToXml(IXFStream *pStrm)
182 {
183     IXFAttrList *pAttrList = pStrm->GetAttrList();
184     pAttrList->Clear();
185     if (!m_strStyleName.isEmpty())
186         pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
187     pStrm->StartElement( "text:creation-time" );
188     pStrm->EndElement( "text:creation-time" );
189 }
ToXml(IXFStream * pStrm)190 void XFLastEditTime::ToXml(IXFStream *pStrm)
191 {
192     IXFAttrList *pAttrList = pStrm->GetAttrList();
193     pAttrList->Clear();
194     if (!m_strStyleName.isEmpty())
195         pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
196     pStrm->StartElement( "text:modification-time" );
197     pStrm->EndElement( "text:modification-time" );
198 }
199 
ToXml(IXFStream * pStrm)200 void XFCreateTimeStart::ToXml(IXFStream *pStrm)
201 {
202     IXFAttrList *pAttrList = pStrm->GetAttrList();
203     pAttrList->Clear();
204     if (!m_strStyleName.isEmpty())
205         pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
206     pStrm->StartElement( "text:creation-time" );
207 }
208 
ToXml(IXFStream * pStrm)209 void XFLastEditTimeStart::ToXml(IXFStream *pStrm)
210 {
211     IXFAttrList *pAttrList = pStrm->GetAttrList();
212     pAttrList->Clear();
213     if (!m_strStyleName.isEmpty())
214         pAttrList->AddAttribute( "style:data-style-name", m_strStyleName );
215     pStrm->StartElement( "text:modification-time" );
216 }
ToXml(IXFStream * pStrm)217 void XFCreateTimeEnd::ToXml(IXFStream *pStrm)
218 {
219     pStrm->EndElement( "text:creation-time" );
220 }
221 
ToXml(IXFStream * pStrm)222 void XFLastEditTimeEnd::ToXml(IXFStream *pStrm)
223 {
224     pStrm->EndElement( "text:modification-time" );
225 }
226 
ToXml(IXFStream * pStrm)227 void XFInitialCreator::ToXml(IXFStream *pStrm)
228 {
229     IXFAttrList *pAttrList = pStrm->GetAttrList();
230     pAttrList->Clear();
231     pStrm->StartElement( "text:initial-creator" );
232     pStrm->EndElement( "text:initial-creator" );
233 }
234 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
235