LibreOffice Module framework (master) 1
statusbardocumenthandler.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 <rtl/ustring.hxx>
28
29#include <unordered_map>
30
31namespace framework{
32
33// Hash code function for using in all hash maps of follow implementation.
34
35// workaround for incremental linking bugs in MSVC2015
36class SAL_DLLPUBLIC_TEMPLATE OReadStatusBarDocumentHandler_Base : public cppu::WeakImplHelper< css::xml::sax::XDocumentHandler > {};
37
39{
40 public:
42 {
55 };
56
58 {
61 };
62
63 OReadStatusBarDocumentHandler( const css::uno::Reference< css::container::XIndexContainer >& aStatusBarItems );
64 virtual ~OReadStatusBarDocumentHandler() override;
65
66 // XDocumentHandler
67 virtual void SAL_CALL startDocument() override;
68
69 virtual void SAL_CALL endDocument() override;
70
71 virtual void SAL_CALL startElement(
72 const OUString& aName,
73 const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override;
74
75 virtual void SAL_CALL endElement(const OUString& aName) override;
76
77 virtual void SAL_CALL characters(const OUString& aChars) override;
78
79 virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces) override;
80
81 virtual void SAL_CALL processingInstruction(const OUString& aTarget,
82 const OUString& aData) override;
83
84 virtual void SAL_CALL setDocumentLocator(
85 const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override;
86
87 private:
88 OUString getErrorLineString();
89
90 class StatusBarHashMap : public std::unordered_map<OUString,
91 StatusBar_XML_Entry >
92 {
93 };
94
98 css::uno::Reference< css::container::XIndexContainer > m_aStatusBarItems;
99 css::uno::Reference< css::xml::sax::XLocator > m_xLocator;
100};
101
103{
104 public:
106 const css::uno::Reference< css::container::XIndexAccess >& rStatusBarItems,
107 const css::uno::Reference< css::xml::sax::XDocumentHandler >& rWriteDocHandler );
109
113
114 private:
118 const OUString& rCommandURL,
119 sal_Int16 nOffset,
120 sal_Int16 nStyle,
121 sal_Int16 nWidth );
122
123 css::uno::Reference< css::container::XIndexAccess > m_aStatusBarItems;
124 css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
125 css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList;
129};
130
131} // namespace framework
132
133/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
virtual void SAL_CALL characters(const OUString &aChars) override
virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override
virtual void SAL_CALL startElement(const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
virtual void SAL_CALL startDocument() override
css::uno::Reference< css::xml::sax::XLocator > m_xLocator
virtual void SAL_CALL endElement(const OUString &aName) override
virtual void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override
OReadStatusBarDocumentHandler(const css::uno::Reference< css::container::XIndexContainer > &aStatusBarItems)
css::uno::Reference< css::container::XIndexContainer > m_aStatusBarItems
css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler
OWriteStatusBarDocumentHandler(const css::uno::Reference< css::container::XIndexAccess > &rStatusBarItems, const css::uno::Reference< css::xml::sax::XDocumentHandler > &rWriteDocHandler)
css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList
void WriteStatusBarItem(const OUString &rCommandURL, sal_Int16 nOffset, sal_Int16 nStyle, sal_Int16 nWidth)
css::uno::Reference< css::container::XIndexAccess > m_aStatusBarItems