1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _SFX_DOCTEMPLATESLOCAL_HXX
30 #define _SFX_DOCTEMPLATESLOCAL_HXX
32 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
33 #include <com/sun/star/beans/StringPair.hpp>
34 #include <com/sun/star/io/XInputStream.hpp>
35 #include <com/sun/star/io/XOutputStream.hpp>
36 #include <cppuhelper/implbase1.hxx>
39 class DocTemplLocaleHelper
: public cppu::WeakImplHelper1
< com::sun::star::xml::sax::XDocumentHandler
>
41 // Relations info related strings
42 ::rtl::OUString m_aGroupListElement
;
43 ::rtl::OUString m_aGroupElement
;
44 ::rtl::OUString m_aNameAttr
;
45 ::rtl::OUString m_aUINameAttr
;
47 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
> m_aResultSeq
;
48 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> m_aElementsSeq
; // stack of elements being parsed
50 DocTemplLocaleHelper(); // must not be created directly
51 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
> GetParsingResult();
53 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
)
54 throw( ::com::sun::star::uno::Exception
);
57 ~DocTemplLocaleHelper();
59 // returns sequence of pairs ( GroupName, GroupUIName )
61 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
>
62 ReadGroupLocalizationSequence(
63 const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
>& xInStream
,
64 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> xFactory
)
65 throw( ::com::sun::star::uno::Exception
);
67 // writes sequence of elements ( GroupName, GroupUIName )
69 void SAL_CALL
WriteGroupLocalizationSequence(
70 const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XOutputStream
>& xOutStream
,
71 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
>& aSequence
,
72 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> xFactory
)
73 throw( ::com::sun::star::uno::Exception
);
76 virtual void SAL_CALL
startDocument() throw (::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
77 virtual void SAL_CALL
endDocument() throw (::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
78 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
);
79 virtual void SAL_CALL
endElement( const ::rtl::OUString
& aName
) throw (::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
80 virtual void SAL_CALL
characters( const ::rtl::OUString
& aChars
) throw (::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
81 virtual void SAL_CALL
ignorableWhitespace( const ::rtl::OUString
& aWhitespaces
) throw (::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
82 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
);
83 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
);
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */