Bump version to 6.4-15
[LibreOffice.git] / include / sfx2 / docinsert.hxx
blobae819299079c5569e5bce0758d21762253330590
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_DOCINSERT_HXX
21 #define INCLUDED_SFX2_DOCINSERT_HXX
23 #include <rtl/ustring.hxx>
24 #include <sfx2/dllapi.h>
25 #include <vcl/errcode.hxx>
26 #include <tools/link.hxx>
27 #include <memory>
28 #include <vector>
30 namespace sfx2 { class FileDialogHelper; }
31 namespace weld { class Window; }
32 class SfxItemSet;
33 class SfxMedium;
34 enum class FileDialogFlags;
36 typedef ::std::vector< std::unique_ptr<SfxMedium> > SfxMediumList;
38 namespace sfx2 {
40 class SFX2_DLLPUBLIC DocumentInserter
42 private:
43 weld::Window* const m_pParent;
44 OUString const m_sDocFactory;
45 OUString m_sFilter;
46 Link<sfx2::FileDialogHelper*,void> m_aDialogClosedLink;
48 FileDialogFlags const m_nDlgFlags;
49 ErrCode m_nError;
51 std::unique_ptr<sfx2::FileDialogHelper>
52 m_pFileDlg;
53 std::shared_ptr<SfxItemSet> m_xItemSet;
54 std::vector<OUString> m_pURLList;
56 DECL_LINK(DialogClosedHdl, sfx2::FileDialogHelper*, void);
58 public:
59 enum class Mode {
60 Insert,
61 InsertMulti,
62 Compare,
63 Merge
65 DocumentInserter(weld::Window* pParent, const OUString& rFactory, const Mode mode = Mode::Insert);
66 ~DocumentInserter();
68 void StartExecuteModal( const Link<sfx2::FileDialogHelper*,void>& _rDialogClosedLink );
69 std::unique_ptr<SfxMedium> CreateMedium(char const* pFallbackHack = nullptr);
70 SfxMediumList CreateMediumList();
73 } // namespace sfx2
75 #endif // INCLUDED_SFX2_DOCINSERT_HXX
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */