1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #include <com/sun/star/frame/DispatchStatement.hpp>
21 #include <com/sun/star/container/XIndexReplace.hpp>
22 #include <com/sun/star/beans/PropertyValue.hpp>
23 #include <com/sun/star/uno/Sequence.hxx>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/util/URLTransformer.hpp>
26 #include <com/sun/star/util/XURLTransformer.hpp>
27 #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
28 #include <svl/itemiter.hxx>
30 #include <svl/itempool.hxx>
31 #include <svtools/itemdel.hxx>
33 #include <comphelper/processfactory.hxx>
35 #include <svl/smplhint.hxx>
37 #include <sfx2/request.hxx>
38 #include <sfx2/dispatch.hxx>
39 #include <sfx2/msg.hxx>
40 #include <sfx2/viewfrm.hxx>
41 #include <sfx2/objface.hxx>
42 #include <sfx2/appuno.hxx>
43 #include <rtl/strbuf.hxx>
45 //===================================================================
47 using namespace ::com::sun::star
;
49 struct SfxRequest_Impl
: public SfxListener
53 Implementation structur of the <SfxRequest> class.
57 SfxRequest
* pAnti
; // Owner because of dying pool
58 String aTarget
; // if possible from target object set by App
59 SfxItemPool
* pPool
; // ItemSet build with this pool
60 SfxPoolItem
* pRetVal
; // Return value belongs to itself
61 SfxShell
* pShell
; // run from this shell
62 const SfxSlot
* pSlot
; // executed Slot
63 sal_uInt16 nModifier
; // which Modifier was pressed?
64 sal_Bool bDone
; // at all executed
65 sal_Bool bIgnored
; // Cancelled by the User
66 sal_Bool bCancelled
; // no longer notify
67 sal_Bool bUseTarget
; // aTarget was set by Application
68 sal_uInt16 nCallMode
; // Synch/Asynch/API/Record
69 sal_Bool bAllowRecording
;
70 SfxAllItemSet
* pInternalArgs
;
71 SfxViewFrame
* pViewFrame
;
73 com::sun::star::uno::Reference
< com::sun::star::frame::XDispatchRecorder
> xRecorder
;
75 SfxRequest_Impl( SfxRequest
*pOwner
)
79 , bCancelled(sal_False
)
80 , nCallMode( SFX_CALLMODE_SYNCHRON
)
81 , bAllowRecording( sal_False
)
85 ~SfxRequest_Impl() { delete pInternalArgs
; }
88 void SetPool( SfxItemPool
*pNewPool
);
89 virtual void Notify( SfxBroadcaster
&rBC
, const SfxHint
&rHint
);
90 void Record( const uno::Sequence
< beans::PropertyValue
>& rArgs
);
94 //====================================================================
96 void SfxRequest_Impl::Notify( SfxBroadcaster
&, const SfxHint
&rHint
)
98 SfxSimpleHint
*pSimpleHint
= PTR_CAST(SfxSimpleHint
, &rHint
);
99 if ( pSimpleHint
&& pSimpleHint
->GetId() == SFX_HINT_DYING
)
103 //====================================================================
105 void SfxRequest_Impl::SetPool( SfxItemPool
*pNewPool
)
107 if ( pNewPool
!= pPool
)
110 EndListening( pPool
->BC() );
113 StartListening( pNewPool
->BC() );
117 //====================================================================
120 SfxRequest::~SfxRequest()
122 // Leave out Done() marked requests with 'rem'
123 if ( pImp
->xRecorder
.is() && !pImp
->bDone
&& !pImp
->bIgnored
)
124 pImp
->Record( uno::Sequence
< beans::PropertyValue
>() );
129 DeleteItemOnIdle(pImp
->pRetVal
);
132 //--------------------------------------------------------------------
135 SfxRequest::SfxRequest
137 const SfxRequest
& rOrig
141 pArgs(rOrig
.pArgs
? new SfxAllItemSet(*rOrig
.pArgs
): 0),
142 pImp( new SfxRequest_Impl(this) )
144 pImp
->bAllowRecording
= rOrig
.pImp
->bAllowRecording
;
145 pImp
->bDone
= sal_False
;
146 pImp
->bIgnored
= sal_False
;
150 pImp
->nCallMode
= rOrig
.pImp
->nCallMode
;
151 pImp
->bUseTarget
= rOrig
.pImp
->bUseTarget
;
152 pImp
->aTarget
= rOrig
.pImp
->aTarget
;
153 pImp
->nModifier
= rOrig
.pImp
->nModifier
;
155 // deep copy needed !
156 pImp
->pInternalArgs
= (rOrig
.pImp
->pInternalArgs
? new SfxAllItemSet(*rOrig
.pImp
->pInternalArgs
) : 0);
159 pImp
->SetPool( pArgs
->GetPool() );
161 pImp
->SetPool( rOrig
.pImp
->pPool
);
163 //--------------------------------------------------------------------
166 SfxRequest::SfxRequest
168 SfxViewFrame
* pViewFrame
,
175 With this constructor events can subsequently be recorded that are not run
176 across SfxDispatcher (eg from KeyInput() or mouse events). For this, a
177 SfxRequest instance is created by this constructor and then proceed
178 exactly as with a SfxRequest that in a <Slot-Execute-Method> is given as a
184 pImp( new SfxRequest_Impl(this) )
186 pImp
->bDone
= sal_False
;
187 pImp
->bIgnored
= sal_False
;
188 pImp
->SetPool( &pViewFrame
->GetPool() );
192 pImp
->nCallMode
= SFX_CALLMODE_SYNCHRON
;
193 pImp
->bUseTarget
= sal_False
;
194 pImp
->pViewFrame
= pViewFrame
;
195 if( pImp
->pViewFrame
->GetDispatcher()->GetShellAndSlot_Impl( nSlotId
, &pImp
->pShell
, &pImp
->pSlot
, sal_True
, sal_True
) )
197 pImp
->SetPool( &pImp
->pShell
->GetPool() );
198 pImp
->xRecorder
= SfxRequest::GetMacroRecorder( pViewFrame
);
199 pImp
->aTarget
= pImp
->pShell
->GetName();
204 OStringBuffer
aStr(RTL_CONSTASCII_STRINGPARAM(
205 "Recording unsupported slot: "));
206 aStr
.append(static_cast<sal_Int32
>(pImp
->pPool
->GetSlotId(nSlotId
)));
207 OSL_FAIL(aStr
.getStr());
212 //--------------------------------------------------------------------
215 SfxRequest::SfxRequest
217 sal_uInt16 nSlotId
, // executed <Slot-Id>
218 SfxCallMode nMode
, // Synch/API/...
219 SfxItemPool
& rPool
// necessary for the SfxItemSet for parameters
222 // creates a SfxRequest without arguments
226 pImp( new SfxRequest_Impl(this) )
228 pImp
->bDone
= sal_False
;
229 pImp
->bIgnored
= sal_False
;
230 pImp
->SetPool( &rPool
);
234 pImp
->nCallMode
= nMode
;
235 pImp
->bUseTarget
= sal_False
;
238 SfxRequest::SfxRequest
240 const SfxSlot
* pSlot
, // executed <Slot-Id>
241 const com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>& rArgs
,
242 SfxCallMode nMode
, // Synch/API/...
243 SfxItemPool
& rPool
// necessary for the SfxItemSet for parameters
245 : nSlot(pSlot
->GetSlotId()),
246 pArgs(new SfxAllItemSet(rPool
)),
247 pImp( new SfxRequest_Impl(this) )
249 pImp
->bDone
= sal_False
;
250 pImp
->bIgnored
= sal_False
;
251 pImp
->SetPool( &rPool
);
255 pImp
->nCallMode
= nMode
;
256 pImp
->bUseTarget
= sal_False
;
257 TransformParameters( nSlot
, rArgs
, *pArgs
, pSlot
);
260 //-----------------------------------------------------------------------
262 SfxRequest::SfxRequest
266 const SfxAllItemSet
& rSfxArgs
269 // creates a SfxRequest with arguments
272 pArgs(new SfxAllItemSet(rSfxArgs
)),
273 pImp( new SfxRequest_Impl(this) )
275 pImp
->bDone
= sal_False
;
276 pImp
->bIgnored
= sal_False
;
277 pImp
->SetPool( rSfxArgs
.GetPool() );
281 pImp
->nCallMode
= nMode
;
282 pImp
->bUseTarget
= sal_False
;
284 //--------------------------------------------------------------------
286 sal_uInt16
SfxRequest::GetCallMode() const
288 return pImp
->nCallMode
;
291 //--------------------------------------------------------------------
293 sal_Bool
SfxRequest::IsSynchronCall() const
295 return SFX_CALLMODE_SYNCHRON
== ( SFX_CALLMODE_SYNCHRON
& pImp
->nCallMode
);
298 //--------------------------------------------------------------------
300 void SfxRequest::SetSynchronCall( sal_Bool bSynchron
)
303 pImp
->nCallMode
|= SFX_CALLMODE_SYNCHRON
;
305 pImp
->nCallMode
&= ~(sal_uInt16
) SFX_CALLMODE_SYNCHRON
;
308 void SfxRequest::SetInternalArgs_Impl( const SfxAllItemSet
& rArgs
)
310 delete pImp
->pInternalArgs
;
311 pImp
->pInternalArgs
= new SfxAllItemSet( rArgs
);
314 const SfxItemSet
* SfxRequest::GetInternalArgs_Impl() const
316 return pImp
->pInternalArgs
;
319 //--------------------------------------------------------------------
322 void SfxRequest_Impl::Record
324 const uno::Sequence
< beans::PropertyValue
>& rArgs
// current Parameter
329 Internal helper method to create a repeatable description of the just
334 String aCommand
= OUString(".uno:");
335 aCommand
.AppendAscii( pSlot
->GetUnoName() );
336 OUString
aCmd( aCommand
);
339 uno::Reference
< container::XIndexReplace
> xReplace( xRecorder
, uno::UNO_QUERY
);
340 if ( xReplace
.is() && aCmd
.compareToAscii(".uno:InsertText") == COMPARE_EQUAL
)
342 sal_Int32 nCount
= xReplace
->getCount();
345 frame::DispatchStatement aStatement
;
346 uno::Any aElement
= xReplace
->getByIndex(nCount
-1);
347 if ( (aElement
>>= aStatement
) && aStatement
.aCommand
== aCmd
)
351 aStatement
.aArgs
[0].Value
>>= aStr
;
352 rArgs
[0].Value
>>= aNew
;
354 aStatement
.aArgs
[0].Value
<<= aStr
;
355 aElement
<<= aStatement
;
356 xReplace
->replaceByIndex( nCount
-1, aElement
);
362 uno::Reference
< uno::XComponentContext
> xContext
= ::comphelper::getProcessComponentContext();
364 uno::Reference
< util::XURLTransformer
> xTransform
= util::URLTransformer::create( xContext
);
366 com::sun::star::util::URL aURL
;
367 aURL
.Complete
= aCmd
;
368 xTransform
->parseStrict(aURL
);
371 xRecorder
->recordDispatch(aURL
,rArgs
);
373 xRecorder
->recordDispatchAsComment(aURL
,rArgs
);
377 //--------------------------------------------------------------------
379 void SfxRequest::Record_Impl
381 SfxShell
& rSh
, // the <SfxShell>, which has excecuted the Request
382 const SfxSlot
& rSlot
, // the <SfxSlot>, which has executed the Request
383 com::sun::star::uno::Reference
< com::sun::star::frame::XDispatchRecorder
> xRecorder
,
384 SfxViewFrame
* pViewFrame
389 This internal method marks the specified SfxMakro SfxRequest as recorded in
390 SfxMakro. Pointer to the parameters in Done() is used again, thus has to
396 pImp
->pSlot
= &rSlot
;
397 pImp
->xRecorder
= xRecorder
;
398 pImp
->aTarget
= rSh
.GetName();
399 pImp
->pViewFrame
= pViewFrame
;
402 //--------------------------------------------------------------------
404 void SfxRequest::SetArgs( const SfxAllItemSet
& rArgs
)
407 pArgs
= new SfxAllItemSet(rArgs
);
408 pImp
->SetPool( pArgs
->GetPool() );
411 //--------------------------------------------------------------------
413 void SfxRequest::AppendItem(const SfxPoolItem
&rItem
)
416 pArgs
= new SfxAllItemSet(*pImp
->pPool
);
417 pArgs
->Put(rItem
, rItem
.Which());
420 //--------------------------------------------------------------------
422 void SfxRequest::RemoveItem( sal_uInt16 nID
)
426 pArgs
->ClearItem(nID
);
427 if ( !pArgs
->Count() )
432 //--------------------------------------------------------------------
434 const SfxPoolItem
* SfxRequest::GetArg
436 sal_uInt16 nSlotId
, // Slot-Id or Which-Id of the parameters
437 bool bDeep
, // sal_False: do not seach in the Parent-ItemSets
438 TypeId aType
// != 0: RTTI check with Assertion
441 return GetItem( pArgs
, nSlotId
, bDeep
, aType
);
445 //--------------------------------------------------------------------
446 const SfxPoolItem
* SfxRequest::GetItem
448 const SfxItemSet
* pArgs
,
449 sal_uInt16 nSlotId
, // Slot-Id or Which-Id of the parameters
450 bool bDeep
, // sal_False: do not seach in the Parent-ItemSets
451 TypeId aType
// != 0: RTTI check with Assertion
456 With this method the access to individual parameters in the SfxRequest is
457 simplified. In particular the type-examination (by Assertion) is performed,
458 whereby the application source code will be much clearer. In the product-
459 version is a 0 returned, if the found item is not of the specified class.
463 void MyShell::Execute( SfxRequest &rReq )
465 switch ( rReq.GetSlot() )
470 // An Example on not using the macros
471 const SfxInt32Item *pPosItem = (const SfxUInt32Item*)
472 rReq.GetArg( SID_POS, sal_False, TYPE(SfxInt32Item) );
473 sal_uInt16 nPos = pPosItem ? pPosItem->GetValue() : 0;
475 // An Example on using the macros
476 SFX_REQUEST_ARG(rReq, pSizeItem, SfxInt32Item, SID_SIZE, sal_False);
477 sal_uInt16 nSize = pSizeItem ? pPosItem->GetValue() : 0;
490 // Which may be converted to ID
491 sal_uInt16 nWhich
= pArgs
->GetPool()->GetWhich(nSlotId
);
493 // Is the item set or available at bDeep == sal_True?
494 const SfxPoolItem
*pItem
= 0;
495 if ( ( bDeep
? SFX_ITEM_AVAILABLE
: SFX_ITEM_SET
)
496 <= pArgs
->GetItemState( nWhich
, bDeep
, &pItem
) )
499 if ( !pItem
|| pItem
->IsA(aType
) )
502 // Item of wrong type => Programming error
503 OSL_FAIL( "invalid argument type" );
507 // No Parameter, not found or wrong type
511 //--------------------------------------------------------------------
513 void SfxRequest::SetReturnValue(const SfxPoolItem
&rItem
)
515 DBG_ASSERT(!pImp
->pRetVal
, "Set Return value multiple times?");
517 delete pImp
->pRetVal
;
518 pImp
->pRetVal
= rItem
.Clone();
521 //--------------------------------------------------------------------
523 const SfxPoolItem
* SfxRequest::GetReturnValue() const
525 return pImp
->pRetVal
;
528 //--------------------------------------------------------------------
530 void SfxRequest::Done
532 const SfxItemSet
& rSet
, /* parameters passed on by the application,
533 that for example were asked for by the user
534 in a dialogue, 0 if no parameters have been
537 bool bKeep
/* true (default)
538 'rSet' is saved and GetArgs() queriable.
541 'rSet' is not copied (faster) */
546 This method must be called in the <Execute-Method> of the <SfxSlot>s, which
547 has performed the SfxRequest when the execution actually took place. If
548 'Done()' is not called, then the SfxRequest is considered canceled.
550 Any return values are passed only when 'Done()' was called. Similar, when
551 recording a macro only true statements are generated if 'Done()' was
552 called; for SfxRequests that were not identified as such will instead
553 be commented out by inserting ('rem').
557 'Done ()' is not called, for example when a dialoge started by the function
558 was canceled by the user or if the execution could not be performed due to
559 a wrong context (without use of separate <SfxShell>s). 'Done ()' will be
560 launched, when executing the function led to a regular error
561 (for example, file could not be opened).
567 // Keep items if possible, so they can be queried by StarDraw.
572 pArgs
= new SfxAllItemSet( rSet
);
573 pImp
->SetPool( pArgs
->GetPool() );
577 SfxItemIter
aIter(rSet
);
578 const SfxPoolItem
* pItem
= aIter
.FirstItem();
581 if(!IsInvalidItem(pItem
))
582 pArgs
->Put(*pItem
,pItem
->Which());
583 pItem
= aIter
.NextItem();
589 //--------------------------------------------------------------------
592 void SfxRequest::Done( sal_Bool bRelease
)
593 // [<SfxRequest::Done(SfxItemSet&)>]
600 //--------------------------------------------------------------------
602 void SfxRequest::ForgetAllArgs()
605 DELETEZ( pImp
->pInternalArgs
);
608 //--------------------------------------------------------------------
610 sal_Bool
SfxRequest::IsCancelled() const
612 return pImp
->bCancelled
;
615 //--------------------------------------------------------------------
617 void SfxRequest::Cancel()
621 Marks this request as no longer executable. For example, if called when
622 the target (more precisely, its pool) dies.
626 pImp
->bCancelled
= sal_True
;
631 //--------------------------------------------------------------------
634 void SfxRequest::Ignore()
638 If this method is called instead of <SfxRequest::Done()>, then this
639 request is not recorded.
643 The selecting of tools in StarDraw should not be recorded, but the same
644 slots are to be used from the generation of the tools to the generated
645 objects. Thus can NoRecords not be specified, i.e. should not be recorded.
649 // Mark as actually executed
650 pImp
->bIgnored
= sal_True
;
653 //--------------------------------------------------------------------
655 void SfxRequest::Done_Impl
657 const SfxItemSet
* pSet
/* parameters passed on by the application,
658 that for example were asked for by the user
659 in a dialogue, 0 if no parameters have been
666 Internal method to mark SfxRequest with 'done' and to evaluate the
667 parameters in 'pSet' in case it is recorded.
671 // Mark as actually executed
672 pImp
->bDone
= sal_True
;
675 if ( !pImp
->xRecorder
.is() )
678 // was running a different slot than requested (Delegation)
679 if ( nSlot
!= pImp
->pSlot
->GetSlotId() )
682 pImp
->pSlot
= pImp
->pShell
->GetInterface()->GetSlot(nSlot
);
683 DBG_ASSERT( pImp
->pSlot
, "delegated SlotId not found" );
684 if ( !pImp
->pSlot
) // playing it safe
689 // new Recording uses UnoName!
690 if ( !pImp
->pSlot
->pUnoName
)
692 OStringBuffer
aStr(RTL_CONSTASCII_STRINGPARAM(
693 "Recording not exported slot: "));
694 aStr
.append(static_cast<sal_Int32
>(pImp
->pSlot
->GetSlotId()));
695 OSL_FAIL(aStr
.getStr());
698 if ( !pImp
->pSlot
->pUnoName
) // playing it safe
701 // often required values
702 SfxItemPool
&rPool
= pImp
->pShell
->GetPool();
705 if ( !pImp
->pSlot
->IsMode(SFX_SLOT_METHOD
) )
707 // get the property as SfxPoolItem
708 const SfxPoolItem
*pItem
;
709 sal_uInt16 nWhich
= rPool
.GetWhich(pImp
->pSlot
->GetSlotId());
710 SfxItemState eState
= pSet
? pSet
->GetItemState( nWhich
, sal_False
, &pItem
) : SFX_ITEM_UNKNOWN
;
712 if ( SFX_ITEM_SET
!= eState
)
714 OStringBuffer
aStr(RTL_CONSTASCII_STRINGPARAM(
715 "Recording property not available: "));
716 aStr
.append(static_cast<sal_Int32
>(pImp
->pSlot
->GetSlotId()));
717 OSL_FAIL(aStr
.getStr());
720 uno::Sequence
< beans::PropertyValue
> aSeq
;
721 if ( eState
== SFX_ITEM_SET
)
722 TransformItems( pImp
->pSlot
->GetSlotId(), *pSet
, aSeq
, pImp
->pSlot
);
723 pImp
->Record( aSeq
);
726 // record everything in a single statement?
727 else if ( pImp
->pSlot
->IsMode(SFX_SLOT_RECORDPERSET
) )
729 uno::Sequence
< beans::PropertyValue
> aSeq
;
731 TransformItems( pImp
->pSlot
->GetSlotId(), *pSet
, aSeq
, pImp
->pSlot
);
732 pImp
->Record( aSeq
);
735 // record each item as a single statement
736 else if ( pImp
->pSlot
->IsMode(SFX_SLOT_RECORDPERITEM
) )
740 // iterate over Items
741 SfxItemIter
aIter(*pSet
);
742 for ( const SfxPoolItem
* pItem
= aIter
.FirstItem(); pItem
; pItem
= aIter
.NextItem() )
744 // to determine the slot ID for the individual item
745 sal_uInt16 nSlotId
= rPool
.GetSlotId( pItem
->Which() );
746 if ( nSlotId
== nSlot
)
748 // play it safe; repair the wrong flags
749 OSL_FAIL( "recursion RecordPerItem - use RecordPerSet!" );
750 SfxSlot
*pSlot
= (SfxSlot
*) pImp
->pSlot
;
751 pSlot
->nFlags
&= ~((sal_uIntPtr
)SFX_SLOT_RECORDPERITEM
);
752 pSlot
->nFlags
&= SFX_SLOT_RECORDPERSET
;
755 // Record a Sub-Request
756 SfxRequest
aReq( pImp
->pViewFrame
, nSlotId
);
757 if ( aReq
.pImp
->pSlot
)
758 aReq
.AppendItem( *pItem
);
764 //HACK(think about this again)
765 pImp
->Record( uno::Sequence
< beans::PropertyValue
>() );
770 //--------------------------------------------------------------------
772 sal_Bool
SfxRequest::IsDone() const
776 With this method it can be queried whether the SfxRequest was actually
777 executed or not. If a SfxRequest was not executed, then this is for example
778 because it was canceled by the user or the context for this request was
779 wrong, this was not implemented on a separate <SfxShell>.
781 SfxRequest instances that return sal_False will not be recorded.
785 <SfxRequest::Done(const SfxItemSet&)>
793 //--------------------------------------------------------------------
795 com::sun::star::uno::Reference
< com::sun::star::frame::XDispatchRecorder
> SfxRequest::GetMacroRecorder( SfxViewFrame
* pView
)
799 This recorder is an attempt for dispatch () to get calls from the Frame.
800 This is then available through a property by a supplier but only when
801 recording was turned on.
803 (See also SfxViewFrame::MiscExec_Impl() and SID_RECORDING)
807 com::sun::star::uno::Reference
< com::sun::star::frame::XDispatchRecorder
> xRecorder
;
809 com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySet
> xSet(
810 (pView
? pView
: SfxViewFrame::Current())->GetFrame().GetFrameInterface(),
811 com::sun::star::uno::UNO_QUERY
);
815 com::sun::star::uno::Any aProp
= xSet
->getPropertyValue(OUString("DispatchRecorderSupplier"));
816 com::sun::star::uno::Reference
< com::sun::star::frame::XDispatchRecorderSupplier
> xSupplier
;
819 xRecorder
= xSupplier
->getDispatchRecorder();
825 sal_Bool
SfxRequest::HasMacroRecorder( SfxViewFrame
* pView
)
827 return GetMacroRecorder( pView
).is();
831 //--------------------------------------------------------------------
833 sal_Bool
SfxRequest::IsAPI() const
837 Returns sal_True if this SfxRequest was generated by an API (for example BASIC),
842 return SFX_CALLMODE_API
== ( SFX_CALLMODE_API
& pImp
->nCallMode
);
845 //--------------------------------------------------------------------
846 void SfxRequest::SetModifier( sal_uInt16 nModi
)
848 pImp
->nModifier
= nModi
;
851 //--------------------------------------------------------------------
852 sal_uInt16
SfxRequest::GetModifier() const
854 return pImp
->nModifier
;
857 //--------------------------------------------------------------------
859 void SfxRequest::AllowRecording( sal_Bool bSet
)
861 pImp
->bAllowRecording
= bSet
;
864 sal_Bool
SfxRequest::AllowsRecording() const
866 sal_Bool bAllow
= pImp
->bAllowRecording
;
868 bAllow
= ( SFX_CALLMODE_API
!= ( SFX_CALLMODE_API
& pImp
->nCallMode
) ) &&
869 ( SFX_CALLMODE_RECORD
== ( SFX_CALLMODE_RECORD
& pImp
->nCallMode
) );
873 void SfxRequest::ReleaseArgs()
876 DELETEZ( pImp
->pInternalArgs
);
879 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */