LibreOffice Module framework (master) 1
acceleratorconfigurationreader.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
23
24#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
25
26#include <com/sun/star/xml/sax/XLocator.hpp>
27
29#include <rtl/ustring.hxx>
30
31namespace framework{
32
33class AcceleratorConfigurationReader final : public ::cppu::WeakImplHelper< css::xml::sax::XDocumentHandler >
34{
35
36 // const, types
37
38 private:
39
42 {
45 };
46
49 {
56 };
57
58 // member
59
60 private:
61
65
69
73
79 css::uno::Reference< css::xml::sax::XLocator > m_xLocator;
80
81 // interface
82
83 public:
84
94
96 virtual ~AcceleratorConfigurationReader() override;
97
98 // XDocumentHandler
99 virtual void SAL_CALL startDocument() override;
100
101 virtual void SAL_CALL endDocument() override;
102
103 virtual void SAL_CALL startElement(const OUString& sElement ,
104 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttributeList) override;
105
106 virtual void SAL_CALL endElement(const OUString& sElement) override;
107
108 virtual void SAL_CALL characters(const OUString& sChars) override;
109
110 virtual void SAL_CALL ignorableWhitespace(const OUString& sWhitespaces) override;
111
112 virtual void SAL_CALL processingInstruction(const OUString& sTarget,
113 const OUString& sData ) override;
114
115 virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator >& xLocator) override;
116
117 // helper
118
119 private:
120
122 static EXMLElement implst_classifyElement(std::u16string_view sElement);
123
125 static EXMLAttribute implst_classifyAttribute(std::u16string_view sAttribute);
126
128 OUString implts_getErrorLineString();
129};
130
131} // namespace framework
132
133/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
implements a cache for any accelerator configuration.
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
css::uno::Reference< css::xml::sax::XLocator > m_xLocator
provide information about the parsing state.
static EXMLElement implst_classifyElement(std::u16string_view sElement)
TODO document me.
virtual ~AcceleratorConfigurationReader() override
does nothing real ...
AcceleratorConfigurationReader(AcceleratorCache &rContainer)
connect this new reader/writer instance to an outside container, which should be used flushed to the ...
virtual void SAL_CALL ignorableWhitespace(const OUString &sWhitespaces) override
bool m_bInsideAcceleratorList
used to detect if an accelerator list occurs recursive inside xml.
virtual void SAL_CALL characters(const OUString &sChars) override
AcceleratorCache & m_rContainer
reference to the outside container, where this reader/writer must work on.
static EXMLAttribute implst_classifyAttribute(std::u16string_view sAttribute)
TODO document me.
bool m_bInsideAcceleratorItem
used to detect if an accelerator item occurs recursive inside xml.
virtual void SAL_CALL startElement(const OUString &sElement, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttributeList) override
virtual void SAL_CALL endElement(const OUString &sElement) override
virtual void SAL_CALL processingInstruction(const OUString &sTarget, const OUString &sData) override