LibreOffice Module sfx2 (master)
1
include
sfx2
request.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
#ifndef INCLUDED_SFX2_REQUEST_HXX
20
#define INCLUDED_SFX2_REQUEST_HXX
21
22
#include <
sal/config.h
>
23
#include <
sfx2/dllapi.h
>
24
#include <
sal/types.h
>
25
#include <
svl/itemset.hxx
>
26
#include <
svl/hint.hxx
>
27
28
#include <memory>
29
30
class
SfxPoolItem
;
31
class
SfxItemPool
;
32
class
SfxShell
;
33
class
SfxSlot
;
34
class
SfxViewFrame
;
35
struct
SfxRequest_Impl
;
36
enum class
SfxCallMode
: sal_uInt16;
37
38
namespace
com::sun::star::beans
{
struct
PropertyValue; }
39
namespace
com::sun::star::frame
{
class
XDispatchRecorder; }
40
namespace
com::sun::star::uno
{
template
<
class
E>
class
Sequence
; }
41
namespace
weld
{
class
Window
; }
42
43
class
SFX2_DLLPUBLIC
SfxRequest
final :
public
SfxHint
44
{
45
friend
struct
SfxRequest_Impl
;
46
47
sal_uInt16
nSlot
;
48
std::unique_ptr<SfxAllItemSet>
pArgs
;
49
std::unique_ptr< SfxRequest_Impl >
pImpl
;
50
51
public
:
52
SAL_DLLPRIVATE
void
Record_Impl(
SfxShell
&rSh,
const
SfxSlot
&rSlot,
53
const
css::uno::Reference< css::frame::XDispatchRecorder >&
xRecorder
,
54
SfxViewFrame
* );
55
private
:
56
SAL_DLLPRIVATE
void
Done_Impl(
const
SfxItemSet
*pSet );
57
58
public
:
59
SfxRequest
(
SfxViewFrame
&, sal_uInt16 nSlotId );
60
SfxRequest
( sal_uInt16 nSlot,
SfxCallMode
nCallMode
,
SfxItemPool
&rPool );
61
SfxRequest
(
const
SfxSlot
*
pSlot
,
const
css::uno::Sequence < css::beans::PropertyValue >& rArgs,
62
SfxCallMode
nCallMode
,
SfxItemPool
&rPool );
63
SfxRequest
(sal_uInt16 nSlot,
SfxCallMode
nCallMode
,
const
SfxAllItemSet
& rSfxArgs);
64
SfxRequest
( sal_uInt16 nSlot,
SfxCallMode
nCallMode
,
const
SfxAllItemSet
& rSfxArgs,
const
SfxAllItemSet
& rSfxInternalArgs );
65
SfxRequest
(
const
SfxRequest
& rOrig );
66
virtual
~SfxRequest
()
override
;
67
68
sal_uInt16
GetSlot
()
const
{
return
nSlot; }
69
void
SetSlot
(sal_uInt16 nNewSlot) { nSlot = nNewSlot; }
70
71
sal_uInt16 GetModifier()
const
;
72
void
SetModifier( sal_uInt16 nModi );
73
void
SetInternalArgs_Impl(
const
SfxAllItemSet
& rArgs );
74
SAL_DLLPRIVATE
const
SfxItemSet
* GetInternalArgs_Impl()
const
;
75
const
SfxItemSet
*
GetArgs
()
const
{
return
pArgs.get(); }
76
void
SetArgs(
const
SfxAllItemSet
& rArgs );
77
void
AppendItem
(
const
SfxPoolItem
&);
78
void
RemoveItem( sal_uInt16 nSlotId );
79
84
template
<
class
T>
const
T*
GetArg
(sal_uInt16 nSlotId)
const
85
{
86
if
(!pArgs)
87
return
nullptr
;
88
return
pArgs->GetItem<T>(nSlotId,
false
);
89
}
90
template
<
class
T>
const
T*
GetArg
(
TypedWhichId<T>
nSlotId)
const
91
{
92
if
(!pArgs)
93
return
nullptr
;
94
return
pArgs->GetItem(nSlotId,
false
);
95
}
96
97
void
ReleaseArgs();
98
void
SetReturnValue(
const
SfxPoolItem
&);
99
const
SfxPoolItem
* GetReturnValue()
const
;
100
101
static
css::uno::Reference< css::frame::XDispatchRecorder > GetMacroRecorder(
const
SfxViewFrame
& rFrame);
102
static
bool
HasMacroRecorder(
const
SfxViewFrame
& rFrame);
103
SfxCallMode
GetCallMode()
const
;
104
void
AllowRecording(
bool
);
105
bool
AllowsRecording()
const
;
106
bool
IsAPI()
const
;
107
bool
IsSynchronCall()
const
;
108
void
SetSynchronCall(
bool
bSynchron );
109
110
bool
IsDone()
const
;
111
void
Done(
bool
bRemove =
false
);
112
113
void
Ignore
();
114
void
Cancel
();
115
bool
IsCancelled()
const
;
116
void
Done(
const
SfxItemSet
&);
117
118
void
ForgetAllArgs();
119
122
weld::Window
*
GetFrameWeld
()
const
;
123
private
:
124
const
SfxRequest
&
operator=
(
const
SfxRequest
&) =
delete
;
125
};
126
127
#endif
128
129
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
RedlineFlags::Ignore
@ Ignore
SfxCallMode
SfxCallMode
Definition:
bindings.hxx:57
ButtonDialogFlags::Cancel
@ Cancel
SfxAllItemSet
SfxHint
SfxItemSet
SfxPoolItem
SfxRequest
Definition:
request.hxx:44
SfxRequest::GetSlot
sal_uInt16 GetSlot() const
Definition:
request.hxx:68
SfxRequest::GetArgs
const SfxItemSet * GetArgs() const
Definition:
request.hxx:75
SfxRequest::SetSlot
void SetSlot(sal_uInt16 nNewSlot)
Definition:
request.hxx:69
SfxRequest::pArgs
std::unique_ptr< SfxAllItemSet > pArgs
Definition:
request.hxx:48
SfxRequest::GetArg
const T * GetArg(sal_uInt16 nSlotId) const
Templatized access to the individual parameters of the SfxRequest.
Definition:
request.hxx:84
SfxRequest::operator=
const SfxRequest & operator=(const SfxRequest &)=delete
SfxRequest::nSlot
sal_uInt16 nSlot
Definition:
request.hxx:47
SfxRequest::GetArg
const T * GetArg(TypedWhichId< T > nSlotId) const
Definition:
request.hxx:90
SfxRequest::pImpl
std::unique_ptr< SfxRequest_Impl > pImpl
Definition:
request.hxx:49
SfxShell
The class SfxShell is the base class for all classes, which provide the functionality of the form <Sl...
Definition:
shell.hxx:128
SfxSlot
Definition:
msg.hxx:184
SfxViewFrame
Definition:
viewfrm.hxx:50
TypedWhichId
weld::Window
config.h
GetFrameWeld
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
dllapi.h
SFX2_DLLPUBLIC
#define SFX2_DLLPUBLIC
Definition:
dllapi.h:29
SwFieldTypesEnum::Sequence
@ Sequence
hint.hxx
itemset.hxx
AppendItem
UNOTOOLS_DLLPUBLIC void AppendItem(EHistoryType eHistory, const OUString &sURL, const OUString &sFilter, const OUString &sTitle, const std::optional< OUString > &sThumbnail, std::optional< bool > oIsReadOnly)
com::sun::star::beans
com::sun::star::frame
com::sun::star::uno
weld
SfxItemPool
SfxRequest_Impl
Definition:
request.cxx:58
SfxRequest_Impl::xRecorder
css::uno::Reference< css::frame::XDispatchRecorder > xRecorder
Definition:
request.cxx:75
SfxRequest_Impl::pSlot
const SfxSlot * pSlot
Definition:
request.cxx:64
SfxRequest_Impl::nCallMode
SfxCallMode nCallMode
Definition:
request.cxx:69
types.h
EViewType::Window
@ Window
Generated on Sun Jul 30 2023 04:33:34 for LibreOffice Module sfx2 (master) by
1.9.3