1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_OOXML_FAST_TOKEN_HANDLER_HXX
25 #define INCLUDED_OOXML_FAST_TOKEN_HANDLER_HXX
26 
27 #include "sal/config.h"
28 #include "com/sun/star/uno/XComponentContext.hpp"
29 #include "cppuhelper/implbase1.hxx"
30 #include "com/sun/star/xml/sax/XFastTokenHandler.hpp"
31 
32 namespace css = ::com::sun::star;
33 
34 namespace writerfilter {
35 namespace ooxml
36 {
37 
38 class OOXMLFastTokenHandler:
39     public ::cppu::WeakImplHelper1<
40         css::xml::sax::XFastTokenHandler>
41 {
42 public:
43     explicit OOXMLFastTokenHandler(css::uno::Reference< css::uno::XComponentContext > const & context);
44 
45     // ::com::sun::star::xml::sax::XFastTokenHandler:
46     virtual ::sal_Int32 SAL_CALL getToken(const ::rtl::OUString & Identifier) throw (css::uno::RuntimeException);
47     virtual ::rtl::OUString SAL_CALL getIdentifier(::sal_Int32 Token) throw (css::uno::RuntimeException);
48     virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getUTF8Identifier(::sal_Int32 Token) throw (css::uno::RuntimeException);
49     virtual ::sal_Int32 SAL_CALL getTokenFromUTF8(const css::uno::Sequence< ::sal_Int8 > & Identifier) throw (css::uno::RuntimeException);
50 
51 private:
52     OOXMLFastTokenHandler(OOXMLFastTokenHandler &); // not defined
53     void operator =(OOXMLFastTokenHandler &); // not defined
54 
~OOXMLFastTokenHandler()55     virtual ~OOXMLFastTokenHandler() {}
56 
57     css::uno::Reference< css::uno::XComponentContext > m_xContext;
58 };
59 
60 }}
61 #endif // INCLUDED_OOXML_FAST_TOKEN_HANDLER_HXX
62