1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: metainforeader.hxx,v $
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 METAINFOREADER_HXX_INCLUDED
32 #define METAINFOREADER_HXX_INCLUDED
34 #include "internal/basereader.hxx"
35 #include "internal/types.hxx"
42 class CMetaInfoReader
: public CBaseReader
45 virtual ~CMetaInfoReader();
47 CMetaInfoReader( const std::string
& DocumentName
);
49 CMetaInfoReader( void* stream
, zlib_filefunc_def
* fa
);
51 /** check if the Tag is in the target meta.xml file.
54 the name of the tag that will be retrive.
56 bool hasTag(std::wstring TagName
) const;
59 /** Get a specific tag content, compound tags will be returned as comma separated list.
62 the name of the tag that will be retrive.
64 std::wstring
getTagData( const std::wstring
& TagName
);
66 /** check if the a tag has the specific attribute.
71 the name of the attribute.
73 bool hasTagAttribute( const std::wstring TagName
, std::wstring AttributeName
);
75 /** Get a specific attribute content.
80 the name of the attribute.
82 std::wstring
getTagAttribute( const std::wstring TagName
, std::wstring AttributeName
);
84 /** Get the default language of the whole document.
86 LocaleSet_t
getDefaultLocale( );
88 protected: // protected because its only an implementation relevant class
90 /** start_element occurs when a tag is start.
95 local name of the tag.
99 virtual void start_element(
100 const std::wstring
& raw_name
,
101 const std::wstring
& local_name
,
102 const XmlTagAttributes_t
& attributes
);
104 /** end_element occurs when a tag is closed
109 local name of the tag.
111 virtual void end_element(
112 const std::wstring
& raw_name
, const std::wstring
& local_name
);
114 /** characters occurs when receiving characters
117 content of the information received.
119 virtual void characters(const std::wstring
& character
);
122 /** choose an appropriate tag reader to handle the tag.
127 attribute structure of the tag to save in.
129 ITag
* chooseTagReader(
130 const std::wstring
& tag_name
, const XmlTagAttributes_t
& XmlAttributes
);
132 /** save the received content into structure.
137 void saveTagContent( const std::wstring
& tag_name
);
140 XmlTags_t m_AllMetaInfo
;
143 std::stack
<ITag
*> m_TagBuilderStack
;
146 CKeywordsTag
* m_pKeywords_Builder
;
147 CDummyTag
* m_pDummy_Builder
;
148 CSimpleTag
* m_pSimple_Builder
;