1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <accelerators/acceleratorcache.hxx>
24 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
26 #include <com/sun/star/xml/sax/XLocator.hpp>
28 #include <cppuhelper/implbase.hxx>
29 #include <rtl/ustring.hxx>
33 class AcceleratorConfigurationReader final
: public ::cppu::WeakImplHelper
< css::xml::sax::XDocumentHandler
>
40 /** @short classification of XML elements. */
43 E_ELEMENT_ACCELERATORLIST
,
47 /** @short classification of XML attributes. */
51 E_ATTRIBUTE_MOD_SHIFT
,
62 /** @short reference to the outside container, where this
63 reader/writer must work on. */
64 AcceleratorCache
& m_rContainer
;
66 /** @short used to detect if an accelerator list
67 occurs recursive inside xml. */
68 bool m_bInsideAcceleratorList
;
70 /** @short used to detect if an accelerator item
71 occurs recursive inside xml. */
72 bool m_bInsideAcceleratorItem
;
74 /** @short provide information about the parsing state.
76 @descr We use it to find out the line and column, where
79 css::uno::Reference
< css::xml::sax::XLocator
> m_xLocator
;
85 /** @short connect this new reader/writer instance
86 to an outside container, which should be used
87 flushed to the underlying XML configuration or
91 a reference to the outside container.
93 AcceleratorConfigurationReader(AcceleratorCache
& rContainer
);
95 /** @short does nothing real ... */
96 virtual ~AcceleratorConfigurationReader() override
;
99 virtual void SAL_CALL
startDocument() override
;
101 virtual void SAL_CALL
endDocument() override
;
103 virtual void SAL_CALL
startElement(const OUString
& sElement
,
104 const css::uno::Reference
< css::xml::sax::XAttributeList
>& xAttributeList
) override
;
106 virtual void SAL_CALL
endElement(const OUString
& sElement
) override
;
108 virtual void SAL_CALL
characters(const OUString
& sChars
) override
;
110 virtual void SAL_CALL
ignorableWhitespace(const OUString
& sWhitespaces
) override
;
112 virtual void SAL_CALL
processingInstruction(const OUString
& sTarget
,
113 const OUString
& sData
) override
;
115 virtual void SAL_CALL
setDocumentLocator(const css::uno::Reference
< css::xml::sax::XLocator
>& xLocator
) override
;
121 /** TODO document me */
122 static EXMLElement
implst_classifyElement(std::u16string_view sElement
);
124 /** TODO document me */
125 static EXMLAttribute
implst_classifyAttribute(std::u16string_view sAttribute
);
127 /** TODO document me */
128 OUString
implts_getErrorLineString();
131 } // namespace framework
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */