Impress: Implement getPartName.
[LibreOffice.git] / include / unotools / xmlaccelcfg.hxx
blob54fec55bcd90bcec5a965daead132d67d771d38b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_UNOTOOLS_XMLACCELCFG_HXX
21 #define INCLUDED_UNOTOOLS_XMLACCELCFG_HXX
23 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
24 #include <cppuhelper/weak.hxx>
26 struct SvtAcceleratorConfigItem
28 sal_uInt16 nCode;
29 sal_uInt16 nModifier;
30 OUString aCommand;
33 #include <list>
34 typedef ::std::list < SvtAcceleratorConfigItem > SvtAcceleratorItemList;
36 class OReadAccelatorDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
37 public ::cppu::OWeakObject
39 public:
40 OReadAccelatorDocumentHandler( SvtAcceleratorItemList& aNewAcceleratorItemList ) :
41 m_nElementDepth( 0 ),
42 m_bAcceleratorMode( false ),
43 m_bItemCloseExpected( false ),
44 m_xLocator( 0 ),
45 m_aReadAcceleratorList( aNewAcceleratorItemList ) {}
46 virtual ~OReadAccelatorDocumentHandler() {}
48 // XInterface
49 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE
50 { OWeakObject::acquire(); }
51 virtual void SAL_CALL release() throw() SAL_OVERRIDE
52 { OWeakObject::release(); }
53 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
54 const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
56 // XDocumentHandler
57 virtual void SAL_CALL startDocument(void)
58 throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
59 virtual void SAL_CALL endDocument(void)
60 throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
61 virtual void SAL_CALL startElement(
62 const OUString& aName,
63 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs )
64 throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
65 virtual void SAL_CALL endElement(const OUString& aName) throw
66 ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
67 virtual void SAL_CALL characters(const OUString& aChars)
68 throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
69 virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces)
70 throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
71 virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData )
72 throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
73 virtual void SAL_CALL setDocumentLocator(
74 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
75 throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
77 private:
78 OUString getErrorLineString();
80 int m_nElementDepth;
81 bool m_bAcceleratorMode;
82 bool m_bItemCloseExpected;
83 ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
84 SvtAcceleratorItemList& m_aReadAcceleratorList;
87 #endif // INCLUDED_UNOTOOLS_XMLACCELCFG_HXX
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */