LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / sfx2 / source / doc / doctemplateslocal.hxx
blob466c847db1b5ad883678bcf4e21df246a3e866e4
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_SFX2_SOURCE_DOC_DOCTEMPLATESLOCAL_HXX
21 #define INCLUDED_SFX2_SOURCE_DOC_DOCTEMPLATESLOCAL_HXX
23 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
24 #include <com/sun/star/beans/StringPair.hpp>
25 #include <com/sun/star/io/XInputStream.hpp>
26 #include <com/sun/star/io/XOutputStream.hpp>
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include <cppuhelper/implbase.hxx>
29 #include <vector>
32 class DocTemplLocaleHelper : public cppu::WeakImplHelper < css::xml::sax::XDocumentHandler >
34 std::vector< css::beans::StringPair > m_aResultSeq;
35 std::vector< OUString > m_aElementsSeq; // stack of elements being parsed
37 DocTemplLocaleHelper();
38 std::vector< css::beans::StringPair > const & GetParsingResult() const;
40 /// @throws css::uno::Exception
41 static std::vector< css::beans::StringPair > ReadLocalizationSequence_Impl( const css::uno::Reference< css::io::XInputStream >& xInStream, const OUString& aStringID, const css::uno::Reference< css::uno::XComponentContext >& xContext );
43 public:
44 virtual ~DocTemplLocaleHelper() override;
46 // returns sequence of pairs ( GroupName, GroupUIName )
47 /// @throws css::uno::Exception
48 static
49 std::vector< css::beans::StringPair >
50 ReadGroupLocalizationSequence(
51 const css::uno::Reference< css::io::XInputStream >& xInStream,
52 const css::uno::Reference< css::uno::XComponentContext >& xContext );
54 // writes sequence of elements ( GroupName, GroupUIName )
55 /// @throws css::uno::Exception
56 static
57 void WriteGroupLocalizationSequence(
58 const css::uno::Reference< css::io::XOutputStream >& xOutStream,
59 const std::vector< css::beans::StringPair >& aSequence,
60 const css::uno::Reference< css::uno::XComponentContext >& xContext );
62 static OUString GetStandardGroupString();
63 static std::vector<OUString> GetBuiltInGroupNames();
65 // XDocumentHandler
66 virtual void SAL_CALL startDocument() override;
67 virtual void SAL_CALL endDocument() override;
68 virtual void SAL_CALL startElement( const OUString& aName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs ) override;
69 virtual void SAL_CALL endElement( const OUString& aName ) override;
70 virtual void SAL_CALL characters( const OUString& aChars ) override;
71 virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) override;
72 virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) override;
73 virtual void SAL_CALL setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >& xLocator ) override;
76 #endif
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */