Coverage Report

Created: 2026-09-28 10:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/sfx2/sfxdlg.hxx
Line
Count
Source
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
#ifndef INCLUDED_SFX2_SFXDLG_HXX
20
#define INCLUDED_SFX2_SFXDLG_HXX
21
22
#include <sal/config.h>
23
#include <sfx2/dllapi.h>
24
25
#include <vcl/abstdlg.hxx>
26
27
#include <sfx2/tabdlg.hxx>
28
29
class SfxItemSet;
30
class SfxItemPool;
31
class SvObjectServerList;
32
class TransferableDataHelper;
33
class SvGlobalName;
34
enum class SotClipboardFormatId : sal_uInt32;
35
36
namespace sfx2
37
{
38
    class LinkManager;
39
    class SvBaseLink;
40
}
41
42
namespace com::sun::star::embed { class XEmbeddedObject; }
43
namespace com::sun::star::embed { class XStorage; }
44
namespace com::sun::star::io { class XInputStream; }
45
namespace com::sun::star::uno { class Any; }
46
namespace com::sun::star::uno { template <class interface_type> class Reference; }
47
48
class SfxAbstractDialog : virtual public VclAbstractDialog
49
{
50
protected:
51
    virtual ~SfxAbstractDialog() override = default;
52
public:
53
    /** Get a set of items changed in the dialog.
54
      */
55
    virtual const SfxItemSet*   GetOutputItemSet() const = 0;
56
    virtual void                SetText( const OUString& rStr ) = 0;
57
};
58
59
class SfxAbstractTabDialog : virtual public SfxAbstractDialog
60
{
61
protected:
62
    virtual ~SfxAbstractTabDialog() override = default;
63
public:
64
    virtual void                SetCurPageId( const OUString &rName ) = 0;
65
    virtual WhichRangesContainer GetInputRanges( const SfxItemPool& ) = 0;
66
    virtual void                SetInputSet( const SfxItemSet* pInSet ) = 0;
67
    virtual const std::set<sal_uInt16>& GetInvalidatedWhichIds() const
68
0
    {
69
0
        static const std::set<sal_uInt16> empty;
70
0
        return empty;
71
0
    }
72
};
73
74
class SfxAbstractApplyTabDialog : virtual public SfxAbstractTabDialog
75
{
76
protected:
77
    virtual ~SfxAbstractApplyTabDialog() override = default;
78
public:
79
    virtual void                SetApplyHdl( const Link<LinkParamNone*,void>& rLink ) = 0;
80
};
81
82
class SfxAbstractInsertObjectDialog : virtual public VclAbstractDialog
83
{
84
protected:
85
    virtual ~SfxAbstractInsertObjectDialog() override = default;
86
public:
87
    virtual css::uno::Reference < css::embed::XEmbeddedObject > GetObject()=0;
88
    virtual css::uno::Reference< css::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType )=0;
89
    virtual bool IsCreateNew()=0;
90
};
91
92
class SfxAbstractPasteDialog : virtual public VclAbstractDialog
93
{
94
protected:
95
    virtual ~SfxAbstractPasteDialog() override = default;
96
public:
97
    virtual void Insert( SotClipboardFormatId nFormat, const OUString & rFormatName ) = 0;
98
    virtual void InsertUno( const OUString& sCmd, const OUString& sLabel ) = 0;
99
    virtual void SetObjName( const SvGlobalName & rClass, const OUString & rObjName ) = 0;
100
    virtual void PreGetFormat( const TransferableDataHelper& aHelper ) = 0;
101
    virtual SotClipboardFormatId GetFormatOnly() = 0;
102
    virtual SotClipboardFormatId GetFormat( const TransferableDataHelper& aHelper ) = 0;
103
};
104
105
class SfxAbstractLinksDialog : virtual public VclAbstractDialog
106
{
107
protected:
108
    virtual ~SfxAbstractLinksDialog() override = default;
109
};
110
111
class AbstractScriptSelectorDialog : virtual public VclAbstractDialog
112
{
113
protected:
114
    virtual ~AbstractScriptSelectorDialog() override = default;
115
public:
116
    virtual OUString       GetScriptURL() const = 0;
117
    virtual void                SetRunLabel() = 0;
118
    // Return the model containing the selected script, or a null reference if the script isn’t
119
    // embedded in a document.
120
    virtual css::uno::Reference<css::frame::XModel> GetScriptModel() const = 0;
121
};
122
123
class AbstractMacroManagerDialog : virtual public VclAbstractDialog
124
{
125
protected:
126
    virtual ~AbstractMacroManagerDialog() override = default;
127
128
public:
129
    virtual OUString GetScriptURL() const = 0;
130
    virtual void LoadLastUsedMacro() const = 0;
131
    // Return the model containing the selected script, or a null reference if the script isn’t
132
    // embedded in a document.
133
    virtual css::uno::Reference<css::frame::XModel> GetScriptModel() const = 0;
134
};
135
136
namespace com::sun::star::frame { class XFrame; }
137
138
class SFX2_DLLPUBLIC SfxAbstractDialogFactory : virtual public VclAbstractDialogFactory
139
{
140
public:
141
                                        virtual ~SfxAbstractDialogFactory() override;    // needed for export of vtable
142
    static SfxAbstractDialogFactory*    Create();
143
    virtual VclPtr<VclAbstractDialog>          CreateFrameDialog(weld::Window* pParent, const css::uno::Reference< css::frame::XFrame >& rFrame, sal_uInt32 nResId, sal_uInt16 nPageId, const OUString& rParameter) = 0;
144
    virtual VclPtr<SfxAbstractTabDialog>       CreateAutoCorrTabDialog(weld::Window* pParent, const SfxItemSet* pAttrSet) = 0;
145
    virtual VclPtr<SfxAbstractTabDialog>       CreateCustomizeTabDialog(weld::Window* pParent,
146
                                            const SfxItemSet* pAttrSet,
147
                                            const css::uno::Reference< css::frame::XFrame >& xViewFrame ) = 0;
148
    virtual CreateTabPage               GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
149
    virtual GetTabPageRanges            GetTabPageRangesFunc( sal_uInt16 nId ) = 0;
150
    virtual VclPtr<SfxAbstractInsertObjectDialog> CreateInsertObjectDialog(weld::Window* pParent, const OUString& rCommand,
151
            const css::uno::Reference < css::embed::XStorage >& xStor,
152
            const SvObjectServerList* pList )=0;
153
    virtual VclPtr<VclAbstractDialog>          CreateEditObjectDialog(weld::Window* pParent, const OUString& rCommand,
154
            const css::uno::Reference < css::embed::XEmbeddedObject >& xObj )=0;
155
    virtual VclPtr<SfxAbstractPasteDialog>    CreatePasteDialog(weld::Window* pParent) = 0;
156
    virtual VclPtr<SfxAbstractLinksDialog>    CreateLinksDialog(weld::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML=false, sfx2::SvBaseLink* p=nullptr) = 0;
157
    virtual VclPtr<VclAbstractDialog>         CreateSvxScriptOrgDialog(weld::Window* pParent,  const OUString& rLanguage) = 0;
158
159
    virtual VclPtr<AbstractSecurityOptionsDialog> CreateSvxSecurityOptionsDialog(weld::Window* pParent) = 0;
160
161
    virtual VclPtr<AbstractScriptSelectorDialog> CreateScriptSelectorDialog(weld::Window* pParent,
162
            const css::uno::Reference< css::frame::XFrame >& rxFrame) = 0;
163
164
    virtual VclPtr<AbstractMacroManagerDialog>
165
    CreateMacroManagerDialog(weld::Window* pParent,
166
                             const css::uno::Reference<css::frame::XFrame>& rxFrame)
167
        = 0;
168
169
    virtual void ShowAsyncScriptErrorDialog( weld::Window* pParent, const css::uno::Any& rException ) = 0;
170
171
    virtual VclPtr<VclAbstractDialog>  CreateOptionsDialog(
172
        weld::Window* pParent, const OUString& rExtensionId ) = 0;
173
174
    virtual VclPtr<VclAbstractDialog> CreateAboutDialog(weld::Window* _pParent) = 0;
175
176
    virtual VclPtr<VclAbstractDialog> CreateTipOfTheDayDialog(weld::Window* _pParent) = 0;
177
178
    virtual VclPtr<VclAbstractDialog> CreateUIPickerDialog(weld::Window* _pParent) = 0;
179
180
    virtual VclPtr<VclAbstractDialog> CreateHyperlinkDialog(weld::Window* pParent,
181
                                                            SfxChildWindow* pChildWindow) = 0;
182
183
    virtual VclPtr<VclAbstractDialog> CreateWidgetTestDialog(weld::Window* _pParent) = 0;
184
185
    virtual VclPtr<SfxAbstractTabDialog> CreateWelcomeDialog(weld::Window* pParent, const bool bIsFirstStart) =0;
186
};
187
188
#endif
189
190
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */