LibreOffice Module sfx2 (master) 1
request.cxx
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
20#include <memory>
21#include <com/sun/star/frame/DispatchStatement.hpp>
22#include <com/sun/star/container/XIndexReplace.hpp>
23#include <com/sun/star/beans/PropertyValue.hpp>
24#include <com/sun/star/uno/Sequence.hxx>
25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/util/URLTransformer.hpp>
27#include <com/sun/star/util/XURLTransformer.hpp>
28#include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
29#include <svl/itemiter.hxx>
30#include <sal/log.hxx>
31#include <osl/diagnose.h>
32#include <tools/debug.hxx>
33
34#include <svl/itempool.hxx>
35#include <itemdel.hxx>
36
38
39#include <svl/hint.hxx>
40
41#include <sfx2/request.hxx>
42#include <sfx2/dispatch.hxx>
43#include <sfx2/msg.hxx>
44#include <sfx2/viewfrm.hxx>
45#include <sfx2/objface.hxx>
46#include <sfx2/sfxuno.hxx>
47
48
49using namespace ::com::sun::star;
50
52
53/* [Description]
54
55 Implementation structure of the <SfxRequest> class.
56*/
57
58{
59 SfxRequest* pAnti; // Owner because of dying pool
60 OUString aTarget; // if possible from target object set by App
61 SfxItemPool* pPool; // ItemSet build with this pool
62 std::unique_ptr<SfxPoolItem> pRetVal; // Return value belongs to itself
63 SfxShell* pShell; // run from this shell
64 const SfxSlot* pSlot; // executed Slot
65 sal_uInt16 nModifier; // which Modifier was pressed?
66 bool bDone; // at all executed
67 bool bIgnored; // Cancelled by the User
68 bool bCancelled; // no longer notify
69 SfxCallMode nCallMode; // Synch/Asynch/API/Record
71 std::unique_ptr<SfxAllItemSet>
74
75 css::uno::Reference< css::frame::XDispatchRecorder > xRecorder;
76 css::uno::Reference< css::util::XURLTransformer > xTransform;
77
79 : pAnti( pOwner)
80 , pPool(nullptr)
81 , pShell(nullptr)
82 , pSlot(nullptr)
83 , nModifier(0)
84 , bDone(false)
85 , bIgnored(false)
86 , bCancelled(false)
88 , bAllowRecording( false )
89 , pViewFrame(nullptr)
90 {
91 }
92
93 void SetPool( SfxItemPool *pNewPool );
94 virtual void Notify( SfxBroadcaster &rBC, const SfxHint &rHint ) override;
95 void Record( const uno::Sequence < beans::PropertyValue >& rArgs );
96};
97
98
100{
101 if ( rHint.GetId() == SfxHintId::Dying )
102 pAnti->Cancel();
103}
104
105
107{
108 if ( pNewPool != pPool )
109 {
110 if ( pPool )
111 EndListening( pPool->BC() );
112 pPool = pNewPool;
113 if ( pNewPool )
114 StartListening( pNewPool->BC() );
115 }
116}
117
118
120{
121 // Leave out Done() marked requests with 'rem'
122 if ( pImpl->xRecorder.is() && !pImpl->bDone && !pImpl->bIgnored )
123 pImpl->Record( uno::Sequence < beans::PropertyValue >() );
124
125 // Clear object
126 pArgs.reset();
127 if ( pImpl->pRetVal )
128 DeleteItemOnIdle(std::move(pImpl->pRetVal));
129}
130
131
133(
134 const SfxRequest& rOrig
135)
136: SfxHint( rOrig ),
137 nSlot(rOrig.nSlot),
138 pArgs(rOrig.pArgs? new SfxAllItemSet(*rOrig.pArgs): nullptr),
139 pImpl( new SfxRequest_Impl(this) )
140{
141 pImpl->bAllowRecording = rOrig.pImpl->bAllowRecording;
142 pImpl->bDone = false;
143 pImpl->bIgnored = false;
144 pImpl->pShell = nullptr;
145 pImpl->pSlot = nullptr;
146 pImpl->nCallMode = rOrig.pImpl->nCallMode;
147 pImpl->aTarget = rOrig.pImpl->aTarget;
148 pImpl->nModifier = rOrig.pImpl->nModifier;
149
150 // deep copy needed !
151 pImpl->pInternalArgs.reset( rOrig.pImpl->pInternalArgs ? new SfxAllItemSet(*rOrig.pImpl->pInternalArgs) : nullptr);
152
153 if ( pArgs )
154 pImpl->SetPool( pArgs->GetPool() );
155 else
156 pImpl->SetPool( rOrig.pImpl->pPool );
157
158 // setup macro recording if it was in the original SfxRequest
159 if (!rOrig.pImpl->pViewFrame || !rOrig.pImpl->xRecorder.is())
160 return;
161
162 nSlot = rOrig.nSlot;
163 pImpl->pViewFrame = rOrig.pImpl->pViewFrame;
164 if (pImpl->pViewFrame->GetDispatcher()->GetShellAndSlot_Impl(nSlot, &pImpl->pShell, &pImpl->pSlot, true, true))
165 {
166 pImpl->SetPool( &pImpl->pShell->GetPool() );
167 pImpl->xRecorder = SfxRequest::GetMacroRecorder(*pImpl->pViewFrame);
168 if (pImpl->xRecorder)
169 pImpl->xTransform = util::URLTransformer::create(comphelper::getProcessComponentContext());
170 pImpl->aTarget = pImpl->pShell->GetName();
171 }
172 else
173 {
174 SAL_WARN("sfx", "Recording unsupported slot: " << pImpl->pPool->GetSlotId(nSlot));
175 }
176}
177
178
179/* [Description]
180
181 With this constructor events can subsequently be recorded that are not run
182 across SfxDispatcher (eg from KeyInput() or mouse events). For this, a
183 SfxRequest instance is created by this constructor and then proceed
184 exactly as with a SfxRequest that in a <Slot-Execute-Method> is given as a
185 parameter.
186*/
187
188SfxRequest::SfxRequest(SfxViewFrame& rViewFrame, sal_uInt16 nSlotId)
189 : nSlot(nSlotId)
190 , pImpl(new SfxRequest_Impl(this))
191{
192 pImpl->bDone = false;
193 pImpl->bIgnored = false;
194 pImpl->SetPool( &rViewFrame.GetPool() );
195 pImpl->pShell = nullptr;
196 pImpl->pSlot = nullptr;
197 pImpl->nCallMode = SfxCallMode::SYNCHRON;
198 pImpl->pViewFrame = &rViewFrame;
199 if( pImpl->pViewFrame->GetDispatcher()->GetShellAndSlot_Impl( nSlotId, &pImpl->pShell, &pImpl->pSlot, true, true ) )
200 {
201 pImpl->SetPool( &pImpl->pShell->GetPool() );
202 pImpl->xRecorder = SfxRequest::GetMacroRecorder(rViewFrame);
203 if (pImpl->xRecorder)
204 pImpl->xTransform = util::URLTransformer::create(comphelper::getProcessComponentContext());
205 pImpl->aTarget = pImpl->pShell->GetName();
206 }
207 else
208 {
209 SAL_WARN( "sfx", "Recording unsupported slot: " << pImpl->pPool->GetSlotId(nSlotId) );
210 }
211}
212
213
215(
216 sal_uInt16 nSlotId, // executed <Slot-Id>
217 SfxCallMode nMode, // Synch/API/...
218 SfxItemPool& rPool // necessary for the SfxItemSet for parameters
219)
220
221// creates a SfxRequest without arguments
222
223: nSlot(nSlotId),
224 pImpl( new SfxRequest_Impl(this) )
225{
226 pImpl->bDone = false;
227 pImpl->bIgnored = false;
228 pImpl->SetPool( &rPool );
229 pImpl->pShell = nullptr;
230 pImpl->pSlot = nullptr;
231 pImpl->nCallMode = nMode;
232}
233
235(
236 const SfxSlot* pSlot, // executed <Slot-Id>
237 const css::uno::Sequence < css::beans::PropertyValue >& rArgs,
238 SfxCallMode nMode, // Synch/API/...
239 SfxItemPool& rPool // necessary for the SfxItemSet for parameters
240)
241: nSlot(pSlot->GetSlotId()),
242 pArgs(new SfxAllItemSet(rPool)),
243 pImpl( new SfxRequest_Impl(this) )
244{
245 pImpl->bDone = false;
246 pImpl->bIgnored = false;
247 pImpl->SetPool( &rPool );
248 pImpl->pShell = nullptr;
249 pImpl->pSlot = nullptr;
250 pImpl->nCallMode = nMode;
251 TransformParameters( nSlot, rArgs, *pArgs, pSlot );
252}
253
254
256(
257 sal_uInt16 nSlotId,
258 SfxCallMode nMode,
259 const SfxAllItemSet& rSfxArgs
260)
261
262// creates a SfxRequest with arguments
263
264: nSlot(nSlotId),
265 pArgs(new SfxAllItemSet(rSfxArgs)),
266 pImpl( new SfxRequest_Impl(this) )
267{
268 pImpl->bDone = false;
269 pImpl->bIgnored = false;
270 pImpl->SetPool( rSfxArgs.GetPool() );
271 pImpl->pShell = nullptr;
272 pImpl->pSlot = nullptr;
273 pImpl->nCallMode = nMode;
274}
275
276
278(
279 sal_uInt16 nSlotId,
280 SfxCallMode nMode,
281 const SfxAllItemSet& rSfxArgs,
282 const SfxAllItemSet& rSfxInternalArgs
283)
284: SfxRequest(nSlotId, nMode, rSfxArgs)
285{
286 SetInternalArgs_Impl(rSfxInternalArgs);
287}
288
290{
291 return pImpl->nCallMode;
292}
293
294
296{
297 return SfxCallMode::SYNCHRON == ( SfxCallMode::SYNCHRON & pImpl->nCallMode );
298}
299
300
301void SfxRequest::SetSynchronCall( bool bSynchron )
302{
303 if ( bSynchron )
304 pImpl->nCallMode |= SfxCallMode::SYNCHRON;
305 else
306 pImpl->nCallMode &= ~SfxCallMode::SYNCHRON;
307}
308
310{
311 pImpl->pInternalArgs.reset( new SfxAllItemSet( rArgs ) );
312}
313
315{
316 return pImpl->pInternalArgs.get();
317}
318
319
321(
322 const uno::Sequence < beans::PropertyValue >& rArgs // current Parameter
323)
324
325/* [Description]
326
327 Internal helper method to create a repeatable description of the just
328 executed SfxRequest.
329*/
330
331{
332 if(!xRecorder.is())
333 return;
334
335 OUString aCmd = pSlot->GetCommand();
336
337 uno::Reference< container::XIndexReplace > xReplace( xRecorder, uno::UNO_QUERY );
338 if ( xReplace.is() && aCmd == ".uno:InsertText" )
339 {
340 sal_Int32 nCount = xReplace->getCount();
341 if ( nCount )
342 {
343 frame::DispatchStatement aStatement;
344 uno::Any aElement = xReplace->getByIndex(nCount-1);
345 if ( (aElement >>= aStatement) && aStatement.aCommand == aCmd )
346 {
347 OUString aStr;
348 OUString aNew;
349 aStatement.aArgs[0].Value >>= aStr;
350 rArgs[0].Value >>= aNew;
351 aStr += aNew;
352 aStatement.aArgs.getArray()[0].Value <<= aStr;
353 aElement <<= aStatement;
354 xReplace->replaceByIndex( nCount-1, aElement );
355 return;
356 }
357 }
358 }
359
360 css::util::URL aURL;
361 aURL.Complete = aCmd;
362 xTransform->parseStrict(aURL);
363
364 if (bDone)
365 xRecorder->recordDispatch(aURL,rArgs);
366 else
367 xRecorder->recordDispatchAsComment(aURL,rArgs);
368}
369
370
372(
373 SfxShell& rSh, // the <SfxShell>, which has executed the Request
374 const SfxSlot& rSlot, // the <SfxSlot>, which has executed the Request
375 const css::uno::Reference< css::frame::XDispatchRecorder >& xRecorder,
376 SfxViewFrame* pViewFrame
377)
378
379/* [Description]
380
381 This internal method marks the specified SfxMakro SfxRequest as recorded in
382 SfxMakro. Pointer to the parameters in Done() is used again, thus has to
383 still be alive.
384*/
385
386{
387 pImpl->pShell = &rSh;
388 pImpl->pSlot = &rSlot;
389 pImpl->xRecorder = xRecorder;
390 if (pImpl->xRecorder && !pImpl->xTransform)
391 pImpl->xTransform = util::URLTransformer::create(comphelper::getProcessComponentContext());
392 pImpl->aTarget = rSh.GetName();
393 pImpl->pViewFrame = pViewFrame;
394}
395
396
398{
399 pArgs.reset(new SfxAllItemSet(rArgs));
400 pImpl->SetPool( pArgs->GetPool() );
401}
402
403
405{
406 if(!pArgs)
407 pArgs.reset( new SfxAllItemSet(*pImpl->pPool) );
408 pArgs->Put(rItem, rItem.Which());
409}
410
411
412void SfxRequest::RemoveItem( sal_uInt16 nID )
413{
414 if (pArgs)
415 {
416 pArgs->ClearItem(nID);
417 if ( !pArgs->Count() )
418 pArgs.reset();
419 }
420}
421
423{
424 DBG_ASSERT(!pImpl->pRetVal, "Set Return value multiple times?");
425 pImpl->pRetVal.reset(rItem.Clone());
426}
427
428
430{
431 return pImpl->pRetVal.get();
432}
433
434
436(
437 const SfxItemSet& rSet /* parameters passed on by the application,
438 that for example were asked for by the user
439 in a dialogue, 0 if no parameters have been
440 set */
441)
442
443/* [Description]
444
445 This method must be called in the <Execute-Method> of the <SfxSlot>s, which
446 has performed the SfxRequest when the execution actually took place. If
447 'Done()' is not called, then the SfxRequest is considered canceled.
448
449 Any return values are passed only when 'Done()' was called. Similar, when
450 recording a macro only true statements are generated if 'Done()' was
451 called; for SfxRequests that were not identified as such will instead
452 be commented out by inserting ('rem').
453
454 [Note]
455
456 'Done ()' is not called, for example when a dialog started by the function
457 was canceled by the user or if the execution could not be performed due to
458 a wrong context (without use of separate <SfxShell>s). 'Done ()' will be
459 launched, when executing the function led to a regular error
460 (for example, file could not be opened).
461*/
462
463{
464 Done_Impl( &rSet );
465
466 // Keep items if possible, so they can be queried by StarDraw.
467 if ( !pArgs )
468 {
469 pArgs.reset( new SfxAllItemSet( rSet ) );
470 pImpl->SetPool( pArgs->GetPool() );
471 }
472 else
473 {
474 SfxItemIter aIter(rSet);
475 for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
476 {
477 if(!IsInvalidItem(pItem))
478 pArgs->Put(*pItem,pItem->Which());
479 }
480 }
481}
482
483
484void SfxRequest::Done( bool bRelease )
485// [<SfxRequest::Done(SfxItemSet&)>]
486{
487 Done_Impl( pArgs.get() );
488 if( bRelease )
489 pArgs.reset();
490}
491
492
494{
495 pArgs.reset();
496 pImpl->pInternalArgs.reset();
497}
498
499
501{
502 return pImpl->bCancelled;
503}
504
505
507
508/* [Description]
509
510 Marks this request as no longer executable. For example, if called when
511 the target (more precisely, its pool) dies.
512*/
513
514{
515 pImpl->bCancelled = true;
516 pImpl->SetPool( nullptr );
517 pArgs.reset();
518}
519
520
522
523/* [Description]
524
525 If this method is called instead of <SfxRequest::Done()>, then this
526 request is not recorded.
527
528 [Example]
529
530 The selecting of tools in StarDraw should not be recorded, but the same
531 slots are to be used from the generation of the tools to the generated
532 objects. Thus can NoRecords not be specified, i.e. should not be recorded.
533*/
534
535{
536 // Mark as actually executed
537 pImpl->bIgnored = true;
538}
539
540
542(
543 const SfxItemSet* pSet /* parameters passed on by the application,
544 that for example were asked for by the user
545 in a dialogue, 0 if no parameters have been
546 set */
547
548)
549
550/* [Description]
551
552 Internal method to mark SfxRequest with 'done' and to evaluate the
553 parameters in 'pSet' in case it is recorded.
554*/
555
556{
557 // Mark as actually executed
558 pImpl->bDone = true;
559
560 // not Recording
561 if ( !pImpl->xRecorder.is() )
562 return;
563
564 // was running a different slot than requested (Delegation)
565 if ( nSlot != pImpl->pSlot->GetSlotId() )
566 {
567 // Search Slot again
568 pImpl->pSlot = pImpl->pShell->GetInterface()->GetSlot(nSlot);
569 DBG_ASSERT( pImpl->pSlot, "delegated SlotId not found" );
570 if ( !pImpl->pSlot ) // playing it safe
571 return;
572 }
573
574 // recordable?
575 // new Recording uses UnoName!
576 SAL_WARN_IF( pImpl->pSlot->pUnoName.isEmpty(), "sfx", "Recording not exported slot: "
577 << pImpl->pSlot->GetSlotId() );
578
579 if ( pImpl->pSlot->pUnoName.isEmpty() ) // playing it safe
580 return;
581
582 // often required values
583 SfxItemPool &rPool = pImpl->pShell->GetPool();
584
585 // Property-Slot?
586 if ( !pImpl->pSlot->IsMode(SfxSlotMode::METHOD) )
587 {
588 // get the property as SfxPoolItem
589 const SfxPoolItem *pItem(nullptr);
590 const sal_uInt16 nWhich(rPool.GetWhich(pImpl->pSlot->GetSlotId()));
591 const bool bItemStateSet(nullptr != pSet);
592 const SfxItemState eState(bItemStateSet ? pSet->GetItemState( nWhich, false, &pItem ) : SfxItemState::DEFAULT);
593 SAL_WARN_IF( !bItemStateSet || SfxItemState::SET != eState, "sfx", "Recording property not available: "
594 << pImpl->pSlot->GetSlotId() );
595 uno::Sequence < beans::PropertyValue > aSeq;
596
597 if ( bItemStateSet && SfxItemState::SET == eState )
598 TransformItems( pImpl->pSlot->GetSlotId(), *pSet, aSeq, pImpl->pSlot );
599
600 pImpl->Record( aSeq );
601 }
602
603 // record everything in a single statement?
604 else if ( pImpl->pSlot->IsMode(SfxSlotMode::RECORDPERSET) )
605 {
606 uno::Sequence < beans::PropertyValue > aSeq;
607 if ( pSet )
608 TransformItems( pImpl->pSlot->GetSlotId(), *pSet, aSeq, pImpl->pSlot );
609 pImpl->Record( aSeq );
610 }
611
612 // record each item as a single statement
613 else if ( pImpl->pSlot->IsMode(SfxSlotMode::RECORDPERITEM) )
614 {
615 if ( pSet )
616 {
617 // iterate over Items
618 SfxItemIter aIter(*pSet);
619 for ( const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem() )
620 {
621 // to determine the slot ID for the individual item
622 sal_uInt16 nSlotId = rPool.GetSlotId( pItem->Which() );
623 if ( nSlotId == nSlot )
624 {
625 // play it safe; repair the wrong flags
626 OSL_FAIL( "recursion RecordPerItem - use RecordPerSet!" );
627 SfxSlot *pSlot = const_cast<SfxSlot*>(pImpl->pSlot);
630 }
631
632 // Record a Sub-Request
633 SfxRequest aReq( *pImpl->pViewFrame, nSlotId );
634 if ( aReq.pImpl->pSlot )
635 aReq.AppendItem( *pItem );
636 aReq.Done();
637 }
638 }
639 else
640 {
641 //HACK(think about this again)
642 pImpl->Record( uno::Sequence < beans::PropertyValue >() );
643 }
644 }
645}
646
647
649
650/* [Description]
651
652 With this method it can be queried whether the SfxRequest was actually
653 executed or not. If a SfxRequest was not executed, then this is for example
654 because it was canceled by the user or the context for this request was
655 wrong, this was not implemented on a separate <SfxShell>.
656
657 SfxRequest instances that return false will not be recorded.
658
659 [Cross-reference]
660
661 <SfxRequest::Done(const SfxItemSet&)>
662 <SfxRequest::Done()>
663*/
664
665{
666 return pImpl->bDone;
667}
668
669
670css::uno::Reference< css::frame::XDispatchRecorder > SfxRequest::GetMacroRecorder(const SfxViewFrame& rView)
671
672/* [Description]
673
674 This recorder is an attempt for dispatch () to get calls from the Frame.
675 This is then available through a property by a supplier but only when
676 recording was turned on.
677
678 (See also SfxViewFrame::MiscExec_Impl() and SID_RECORDING)
679*/
680
681{
682 css::uno::Reference< css::frame::XDispatchRecorder > xRecorder;
683
684 css::uno::Reference< css::beans::XPropertySet > xSet(
685 rView.GetFrame().GetFrameInterface(),
686 css::uno::UNO_QUERY);
687
688 if(xSet.is())
689 {
690 css::uno::Any aProp = xSet->getPropertyValue("DispatchRecorderSupplier");
691 css::uno::Reference< css::frame::XDispatchRecorderSupplier > xSupplier;
692 aProp >>= xSupplier;
693 if(xSupplier.is())
694 xRecorder = xSupplier->getDispatchRecorder();
695 }
696
697 return xRecorder;
698}
699
701{
702 return GetMacroRecorder(rView).is();
703}
704
706
707/* [Description]
708
709 Returns true if this SfxRequest was generated by an API (for example BASIC),
710 otherwise false.
711*/
712
713{
714 return SfxCallMode::API == ( SfxCallMode::API & pImpl->nCallMode );
715}
716
717
718void SfxRequest::SetModifier( sal_uInt16 nModi )
719{
720 pImpl->nModifier = nModi;
721}
722
723
724sal_uInt16 SfxRequest::GetModifier() const
725{
726 return pImpl->nModifier;
727}
728
729
731{
732 pImpl->bAllowRecording = bSet;
733}
734
736{
737 bool bAllow = pImpl->bAllowRecording;
738 if( !bAllow )
739 bAllow = ( SfxCallMode::API != ( SfxCallMode::API & pImpl->nCallMode ) ) &&
740 ( SfxCallMode::RECORD == ( SfxCallMode::RECORD & pImpl->nCallMode ) );
741 return bAllow;
742}
743
745{
746 pArgs.reset();
747 pImpl->pInternalArgs.reset();
748}
749
750/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void TransformItems(sal_uInt16 nSlotId, const SfxItemSet &rSet, uno::Sequence< beans::PropertyValue > &rArgs, const SfxSlot *pSlot)
Definition: appuno.cxx:908
void TransformParameters(sal_uInt16 nSlotId, const uno::Sequence< beans::PropertyValue > &rArgs, SfxAllItemSet &rSet, const SfxSlot *pSlot)
Definition: appuno.cxx:170
SfxCallMode
Definition: bindings.hxx:57
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
Definition: frame.cxx:515
SfxHintId GetId() const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
SfxBroadcaster & BC()
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
sal_uInt16 Which() const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
SAL_DLLPRIVATE const SfxItemSet * GetInternalArgs_Impl() const
Definition: request.cxx:314
void RemoveItem(sal_uInt16 nSlotId)
Definition: request.cxx:412
bool AllowsRecording() const
Definition: request.cxx:735
void Ignore()
Definition: request.cxx:521
void ReleaseArgs()
Definition: request.cxx:744
const SfxPoolItem * GetReturnValue() const
Definition: request.cxx:429
bool IsCancelled() const
Definition: request.cxx:500
SfxRequest(SfxViewFrame &, sal_uInt16 nSlotId)
Definition: request.cxx:188
void ForgetAllArgs()
Definition: request.cxx:493
std::unique_ptr< SfxAllItemSet > pArgs
Definition: request.hxx:48
virtual ~SfxRequest() override
Definition: request.cxx:119
void AppendItem(const SfxPoolItem &)
Definition: request.cxx:404
void Cancel()
Definition: request.cxx:506
void SetReturnValue(const SfxPoolItem &)
Definition: request.cxx:422
SAL_DLLPRIVATE void Done_Impl(const SfxItemSet *pSet)
Definition: request.cxx:542
sal_uInt16 GetModifier() const
Definition: request.cxx:724
sal_uInt16 nSlot
Definition: request.hxx:47
SfxCallMode GetCallMode() const
Definition: request.cxx:289
bool IsSynchronCall() const
Definition: request.cxx:295
void SetSynchronCall(bool bSynchron)
Definition: request.cxx:301
bool IsDone() const
Definition: request.cxx:648
void SetArgs(const SfxAllItemSet &rArgs)
Definition: request.cxx:397
SAL_DLLPRIVATE void Record_Impl(SfxShell &rSh, const SfxSlot &rSlot, const css::uno::Reference< css::frame::XDispatchRecorder > &xRecorder, SfxViewFrame *)
Definition: request.cxx:372
void SetModifier(sal_uInt16 nModi)
Definition: request.cxx:718
static css::uno::Reference< css::frame::XDispatchRecorder > GetMacroRecorder(const SfxViewFrame &rFrame)
Definition: request.cxx:670
static bool HasMacroRecorder(const SfxViewFrame &rFrame)
Definition: request.cxx:700
bool IsAPI() const
Definition: request.cxx:705
void SetInternalArgs_Impl(const SfxAllItemSet &rArgs)
Definition: request.cxx:309
void Done(bool bRemove=false)
Definition: request.cxx:484
std::unique_ptr< SfxRequest_Impl > pImpl
Definition: request.hxx:49
void AllowRecording(bool)
Definition: request.cxx:730
The class SfxShell is the base class for all classes, which provide the functionality of the form <Sl...
Definition: shell.hxx:128
SfxItemPool & GetPool() const
Each Subclass of SfxShell must reference a pool.
Definition: shell.hxx:511
const OUString & GetName() const
Returns the name of the Shell object.
Definition: shell.cxx:119
Definition: msg.hxx:184
SFX2_DLLPUBLIC OUString GetCommand() const
Definition: msg.cxx:46
SfxSlotMode nFlags
Definition: msg.hxx:188
SfxFrame & GetFrame() const
Definition: viewfrm.cxx:2782
int nCount
#define DBG_ASSERT(sCon, aError)
URL aURL
void DeleteItemOnIdle(std::unique_ptr< SfxPoolItem > pItem)
Definition: itemdel.cxx:50
SvLinkSource * pOwner
Definition: linksrc.cxx:41
Sequence< sal_Int8 > aSeq
Definition: lnkbase2.cxx:83
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
aStr
Definition: mgetempl.cxx:407
SfxSlotMode
Definition: msg.hxx:35
Reference< XComponentContext > getProcessComponentContext()
SfxItemState
bool IsInvalidItem(const SfxPoolItem *pItem)
static SfxItemSet & rSet
Definition: shell.cxx:534
std::unique_ptr< SfxPoolItem > pRetVal
Definition: request.cxx:62
css::uno::Reference< css::frame::XDispatchRecorder > xRecorder
Definition: request.cxx:75
bool bAllowRecording
Definition: request.cxx:70
SfxRequest_Impl(SfxRequest *pOwner)
Definition: request.cxx:78
sal_uInt16 nModifier
Definition: request.cxx:65
const SfxSlot * pSlot
Definition: request.cxx:64
SfxViewFrame * pViewFrame
Definition: request.cxx:73
SfxRequest * pAnti
Definition: request.cxx:59
std::unique_ptr< SfxAllItemSet > pInternalArgs
Definition: request.cxx:72
css::uno::Reference< css::util::XURLTransformer > xTransform
Definition: request.cxx:76
void SetPool(SfxItemPool *pNewPool)
Definition: request.cxx:106
SfxShell * pShell
Definition: request.cxx:63
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: request.cxx:99
SfxCallMode nCallMode
Definition: request.cxx:69
void Record(const uno::Sequence< beans::PropertyValue > &rArgs)
Definition: request.cxx:321
OUString aTarget
Definition: request.cxx:60
SfxItemPool * pPool
Definition: request.cxx:61