merge the formfield patch from ooo-build
[ooovba.git] / xml2cmp / source / x2cclass / xml_cdff.hxx
blob78738baad49424d1075ee10d6abdf11a9671c4a4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xml_cdff.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef UDKSERVICE_XML_CDFF_HXX
32 #define UDKSERVICE_XML_CDFF_HXX
35 #include <tools/string.hxx>
36 #include "xml_cd.hxx"
38 class ComponentDescriptionImpl;
41 /** @descr
42 Is able to parse an XML file with Component descriptions. Gives access
43 to the parsed data.
45 Use:
46 CompDescrsFromAnXmlFile aCds;
47 UniString aFilepath(...);
48 if (! aCds.Parse(aFilepath) )
50 // react on:
51 aCds.Status();
54 With operator[] you get access to ComponentDescriptions
55 on indices 0 to NrOfDescriptions()-1 .
57 For further handling see class ComponentDescription
58 in xml_cd.hxx .
60 It is possible to parse more than one time. Then the old data
61 are discarded.
62 **/
63 class CompDescrsFromAnXmlFile
65 public:
66 enum E_Status
68 ok = 0,
69 not_yet_parsed,
70 cant_read_file,
71 inconsistent_file,
72 no_tag_found_in_file
75 // LIFECYCLE
76 CompDescrsFromAnXmlFile();
77 ~CompDescrsFromAnXmlFile();
79 // OPERATIONS
80 BOOL Parse(
81 const UniString & i_sXmlFilePath );
83 // INQUIRY
84 INT32 NrOfDescriptions() const;
85 const ComponentDescription &
86 operator[]( /// @return an empty description, if index does not exist.
87 INT32 i_nIndex ) const;
88 CompDescrsFromAnXmlFile::E_Status
89 Status() const;
91 private:
92 // PRIVATE SERVICES
93 void Empty();
95 // DATA
96 std::vector< ComponentDescriptionImpl* > *
97 dpDescriptions;
98 E_Status eStatus;
105 #endif