Update ooo320-m1
[ooovba.git] / sfx2 / source / doc / doctemplateslocal.hxx
blob90138a891c91274d60698d3e24a00c4c09f24510
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: doctemplateslocal.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 _SFX_DOCTEMPLATESLOCAL_HXX
32 #define _SFX_DOCTEMPLATESLOCAL_HXX
34 #ifndef _COM_SUN_STAR_XML_SAX_XDUCUMENTHANDLER_HPP_
35 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
36 #endif
37 #include <com/sun/star/beans/StringPair.hpp>
38 #include <com/sun/star/io/XInputStream.hpp>
39 #include <com/sun/star/io/XOutputStream.hpp>
40 #include <cppuhelper/implbase1.hxx>
43 class DocTemplLocaleHelper : public cppu::WeakImplHelper1 < com::sun::star::xml::sax::XDocumentHandler >
45 // Relations info related strings
46 ::rtl::OUString m_aGroupListElement;
47 ::rtl::OUString m_aGroupElement;
48 ::rtl::OUString m_aNameAttr;
49 ::rtl::OUString m_aUINameAttr;
51 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > m_aResultSeq;
52 ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aElementsSeq; // stack of elements being parsed
54 DocTemplLocaleHelper(); // must not be created directly
55 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > GetParsingResult();
57 static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > SAL_CALL ReadLocalizationSequence_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, const ::rtl::OUString& aStringID, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory )
58 throw( ::com::sun::star::uno::Exception );
60 public:
61 ~DocTemplLocaleHelper();
63 // returns sequence of pairs ( GroupName, GroupUIName )
64 static
65 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >
66 ReadGroupLocalizationSequence(
67 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream,
68 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory )
69 throw( ::com::sun::star::uno::Exception );
71 // writes sequence of elements ( GroupName, GroupUIName )
72 static
73 void SAL_CALL WriteGroupLocalizationSequence(
74 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutStream,
75 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aSequence,
76 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory )
77 throw( ::com::sun::star::uno::Exception );
79 // XDocumentHandler
80 virtual void SAL_CALL startDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
81 virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
82 virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
83 virtual void SAL_CALL endElement( const ::rtl::OUString& aName ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
84 virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
85 virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
86 virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
87 virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
90 #endif