LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / sfx2 / inc / guisaveas.hxx
blob88a69711c8fd5a8d9ee843caa8d054979df1162e
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_INC_GUISAVEAS_HXX
21 #define INCLUDED_SFX2_INC_GUISAVEAS_HXX
23 #include <sal/config.h>
25 #include <string_view>
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <com/sun/star/beans/PropertyValue.hpp>
29 #include <com/sun/star/container/XNameAccess.hpp>
30 #include <com/sun/star/container/XContainerQuery.hpp>
31 #include <com/sun/star/frame/XModel.hpp>
32 #include <com/sun/star/frame/XModuleManager2.hpp>
34 #include <comphelper/sequenceashashmap.hxx>
36 #include <sfx2/bindings.hxx>
37 #include <sfx2/signaturestate.hxx>
39 #include <svtools/dialogclosedlistener.hxx>
41 #include <tools/urlobj.hxx>
44 namespace com::sun::star::document { class XDocumentProperties; }
46 namespace weld { class Window; }
47 class ModelData_Impl;
49 class SfxStoringHelper
51 friend class ModelData_Impl;
53 private:
54 css::uno::Reference< css::container::XNameAccess > m_xFilterCFG;
55 css::uno::Reference< css::container::XContainerQuery > m_xFilterQuery;
56 css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager;
58 std::shared_ptr<ModelData_Impl> m_xModelData;
59 css::uno::Sequence< css::beans::PropertyValue > m_aArgsSequence;
61 css::uno::Reference< css::container::XNameAccess > const & GetFilterConfiguration();
62 css::uno::Reference< css::container::XContainerQuery > const & GetFilterQuery();
63 css::uno::Reference< css::frame::XModuleManager2 > const & GetModuleManager();
65 bool m_xDialogUsed;
66 bool m_bRemote;
67 bool m_bPreselectPassword;
68 bool m_bDialogUsed;
69 bool m_bSetStandardName;
70 sal_Int16 m_nStoreMode;
72 DECL_LINK(FilterDialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void);
74 static bool FinishGUIStoreModel(::comphelper::SequenceAsHashMap::const_iterator& aFileNameIter,
75 ModelData_Impl& aModelData, bool bRemote, sal_Int16 nStoreMode,
76 css::uno::Sequence< css::beans::PropertyValue >& aFilterProps,
77 bool bSetStandardName, bool bPreselectPassword, bool bDialogUsed,
78 std::u16string_view aFilterFromMediaDescr, std::u16string_view aOldFilterName,
79 css::uno::Sequence< css::beans::PropertyValue >& aArgsSequence,
80 OUString aFilterName);
82 void CallFinishGUIStoreModel();
84 public:
85 SfxStoringHelper();
87 bool GUIStoreModel(
88 const css::uno::Reference< css::frame::XModel >& xModel,
89 std::u16string_view aSlotName,
90 css::uno::Sequence< css::beans::PropertyValue >& aArgsSequence,
91 bool bPreselectPassword,
92 SignatureState nDocumentSignatureState,
93 bool bIsAsync );
95 static bool CheckFilterOptionsAppearance(
96 const css::uno::Reference< css::container::XNameAccess >& xFilterCFG,
97 const OUString& aFilterName );
100 static void SetDocInfoState(
101 const css::uno::Reference< css::frame::XModel >& xModel,
102 const css::uno::Reference< css::document::XDocumentProperties>& i_xOldDocInfo );
104 static bool WarnUnacceptableFormat(
105 const css::uno::Reference< css::frame::XModel >& xModel,
106 std::u16string_view aOldUIName,
107 const OUString& aDefExtension,
108 bool rDefaultIsAlien );
110 static css::uno::Reference<css::awt::XWindow> GetModelXWindow(const css::uno::Reference<css::frame::XModel>& rModel);
111 static weld::Window* GetModelWindow( const css::uno::Reference< css::frame::XModel >& xModel );
115 #endif
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */