LibreOffice Module sfx2 (master) 1
|
#include <dispatch.hxx>
Public Member Functions | |
SfxDispatcher () | |
SfxDispatcher (SfxViewFrame *pFrame) | |
The constructor of the SfxDispatcher class places a stack of empty <SfxShell> pointers. More... | |
SAL_DLLPRIVATE void | Construct_Impl () |
~SfxDispatcher () | |
The destructor of the SfxDispatcher class should not be called when the SfxDispatcher instance is active. More... | |
const SfxPoolItem * | Execute (sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr) |
Method to execute a <SfxSlot>s over the Slot-Id. More... | |
const SfxPoolItem * | Execute (sal_uInt16 nSlot, SfxCallMode nCall, SfxItemSet const *pArgs, SfxItemSet const *pInternalArgs, sal_uInt16 nModi) |
const SfxPoolItem * | ExecuteList (sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >()) |
Method to execute a <SfxSlot>s over the Slot-Id. More... | |
const SfxPoolItem * | Execute (sal_uInt16 nSlot, SfxCallMode nCall, const SfxItemSet &rArgs) |
Method to execute a <SfxSlot>s over the Slot-Id. More... | |
const SfxSlot * | GetSlot (const OUString &rCommand) |
bool | IsActive (const SfxShell &rShell) |
This method checks whether a particular <SfxShell> instance is on the SfxDispatcher. More... | |
sal_uInt16 | GetShellLevel (const SfxShell &rShell) |
Determines the position of a given SfxShell in the stack of the dispatcher. More... | |
SfxBindings * | GetBindings () const |
This method returns a pointer to the <SfxBinding> Instance on which the SfxDispatcher is currently bound. More... | |
void | Push (SfxShell &rShell) |
With this method, a <SfxShell> pushed on to the SfxDispatcher. More... | |
void | Pop (SfxShell &rShell, SfxDispatcherPopFlags nMode=SfxDispatcherPopFlags::NONE) |
With this method, one or more <SfxShell> are popped from the SfxDispatcher. More... | |
SfxShell * | GetShell (sal_uInt16 nIdx) const |
Returns a pointer to the <SfxShell> which is at the position nIdx (from the top, last pushed is 0) on the stack. More... | |
SfxViewFrame * | GetFrame () const |
Returns a pointer to the <SfxViewFrame> instance, which belongs to this SfxDispatcher. More... | |
SfxModule * | GetModule () const |
void | ExecutePopup (const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr) |
bool | IsAppDispatcher () const |
With this method it can be determined if the SfxDispacher is the applications dispatcher. More... | |
bool | IsFlushed () const |
This method checks if the stack of the SfxDispatchers is flushed, or if push- or pop- commands are pending. More... | |
void | Flush () |
This method performs outstanding push- and pop- commands. More... | |
void | Lock (bool bLock) |
With this method the SfxDispatcher can be locked and released. More... | |
bool | IsLocked () const |
With this method it can be determined whether the SfxDispatcher is locked or unlocked. More... | |
void | SetSlotFilter (SfxSlotFilterState nEnable=SfxSlotFilterState::DISABLED, o3tl::span< sal_uInt16 const > pSIDs=o3tl::span< sal_uInt16 const >()) |
With this method a filter set, the target slots can be enabled or disabled. More... | |
void | HideUI (bool bHide=true) |
ToolbarId | GetObjectBarId (sal_uInt16 nPos) const |
SfxItemState | QueryState (sal_uInt16 nSID, const SfxPoolItem *&rpState) |
template<class T > | |
SfxItemState | QueryState (TypedWhichId< T > nSID, const T *&rpState) |
SfxItemState | QueryState (sal_uInt16 nSID, css::uno::Any &rAny) |
void | SetDisableFlags (SfxDisableFlags nFlags) |
SfxDisableFlags | GetDisableFlags () const |
SAL_DLLPRIVATE void | SetMenu_Impl () |
SAL_DLLPRIVATE void | Update_Impl (bool bForce=false) |
SAL_DLLPRIVATE bool | IsUpdated_Impl () const |
SAL_DLLPRIVATE bool | GetShellAndSlot_Impl (sal_uInt16 nSlot, SfxShell **ppShell, const SfxSlot **ppSlot, bool bOwnShellsOnly, bool bRealSlot) |
This method searches in SfxDispatcher after <SfxShell> , from the Slot Id nSlot currently being handled. More... | |
SAL_DLLPRIVATE void | SetReadOnly_Impl (bool bOn) |
SAL_DLLPRIVATE bool | GetReadOnly_Impl () const |
SAL_DLLPRIVATE SfxSlotFilterState | IsSlotEnabledByFilter_Impl (sal_uInt16 nSID) const |
Searches for 'nSID' in the Filter set by <SetSlotFilter()> and returns sal_True, if the SIDis allowed, or sal_False, if it is disabled by the Filter. More... | |
SAL_DLLPRIVATE void | SetQuietMode_Impl (bool bOn) |
With 'bOn' the Dispatcher is quasi dead and transfers everything to the Parent-Dispatcher. More... | |
SAL_DLLPRIVATE bool | IsReadOnlyShell_Impl (sal_uInt16 nShell) const |
SAL_DLLPRIVATE void | RemoveShell_Impl (SfxShell &rShell) |
SAL_DLLPRIVATE void | DoActivate_Impl (bool bMDI) |
This method controls the activation of a dispatcher. More... | |
SAL_DLLPRIVATE void | DoDeactivate_Impl (bool bMDI, SfxViewFrame const *pNew) |
This method controls the deactivation of a dispatcher. More... | |
SAL_DLLPRIVATE void | InvalidateBindings_Impl (bool) |
Static Public Member Functions | |
static void | ExecutePopup (vcl::Window *pWin=nullptr, const Point *pPosPixel=nullptr) |
static boost::property_tree::ptree | fillPopupMenu (const rtl::Reference< VCLXPopupMenu > &rMenu) |
Private Member Functions | |
SAL_DLLPRIVATE bool | CheckVirtualStack (const SfxShell &rShell) |
With this method it can be tested whether the <SfxShell> rShell is on the stack, when it was flushed. More... | |
DECL_DLLPRIVATE_LINK (EventHdl_Impl, Timer *, void) | |
void | PostMsgHandler (std::unique_ptr< SfxRequest >) |
Helper method to receive the asynchronously executed <SfxRequest>s. More... | |
SAL_DLLPRIVATE void | Call_Impl (SfxShell &rShell, const SfxSlot &rSlot, SfxRequest &rReq, bool bRecord) |
Helper function to check whether a slot can be executed and check the execution itself. More... | |
SAL_DLLPRIVATE void | Update_Impl_ (bool, bool, bool, SfxWorkWindow *) |
bool | FindServer_ (sal_uInt16 nId, SfxSlotServer &rServer) |
This helper method searches for the <Slot-Server> which currently serves the nSlot. More... | |
bool | FillState_ (const SfxSlotServer &rServer, SfxItemSet &rState, const SfxSlot *pRealSlot) |
Helper method to obtain the status of the <Slot-Server>s rSvr. More... | |
void | Execute_ (SfxShell &rShell, const SfxSlot &rSlot, SfxRequest &rReq, SfxCallMode eCall) |
This method performs a request for a cached <Slot-Server>. More... | |
void | FlushImpl () |
Helper method to execute the outstanding push and pop commands. More... | |
Private Attributes | |
std::unique_ptr< SfxDispatcher_Impl > | xImp |
Friends | |
class | SfxApplication |
class | SfxViewFrame |
class | SfxBindings |
class | SfxStateCache |
class | SfxPopupMenuManager |
class | SfxHelp |
Definition at line 69 of file dispatch.hxx.
SfxDispatcher::SfxDispatcher | ( | ) |
Definition at line 312 of file dispatch.cxx.
References Construct_Impl(), and xImp.
SfxDispatcher::SfxDispatcher | ( | SfxViewFrame * | pViewFrame | ) |
The constructor of the SfxDispatcher class places a stack of empty <SfxShell> pointers.
It is not initially locked and is considered flushed.
Definition at line 321 of file dispatch.cxx.
References Construct_Impl(), and xImp.
SfxDispatcher::~SfxDispatcher | ( | ) |
The destructor of the SfxDispatcher class should not be called when the SfxDispatcher instance is active.
It may, however, still be a <SfxShell> pointer on the stack.
Definition at line 331 of file dispatch.cxx.
References DBG_ASSERT, GetBindings(), SfxBindings::GetDispatcher_Impl(), SfxBindings::GetSubBindings_Impl(), SfxApplication::IsDowning(), SAL_INFO, SfxBindings::SetDispatcher(), SfxGetpApp(), and xImp.
|
private |
Helper function to check whether a slot can be executed and check the execution itself.
Definition at line 214 of file dispatch.cxx.
References AUTOUPDATE, Call_Impl(), SfxShell::CanExecuteSlot_Impl(), FASTCALL, GetBindings(), SfxSlot::GetExecFnc(), GetFrame(), SfxSlot::GetSlotId(), SfxBindings::Invalidate(), SfxShell::IsConditionalFastCall(), SfxRequest::IsDone(), SfxSlot::IsMode(), NORECORD, SfxRequest::Record_Impl(), SFX_STACK, SfxBindings::Update(), and xImp.
Referenced by Call_Impl(), Execute_(), and PostMsgHandler().
|
private |
With this method it can be tested whether the <SfxShell> rShell is on the stack, when it was flushed.
This way the SfxDispatcher is not actually flushed.
This method is intended among other things to make assertions possible without the side effect of having to flush the SfxDispatcher.
Definition at line 471 of file dispatch.cxx.
References CheckVirtualStack(), DBG_ASSERT, i, SFX_STACK, and xImp.
Referenced by CheckVirtualStack(), and IsActive().
void SfxDispatcher::Construct_Impl | ( | ) |
Definition at line 285 of file dispatch.cxx.
References DISABLED, LINK, NONE, None, PostMsgHandler(), and xImp.
Referenced by SfxDispatcher().
|
private |
References Execute(), GetBindings(), and GetShell().
void SfxDispatcher::DoActivate_Impl | ( | bool | bMDI | ) |
This method controls the activation of a dispatcher.
Since the application dispatcher is always active, either as a sub dispatcher of the <SfxViewFrame> dispatcher or as itself, it is never activated as a whole, instead only its individual <SfxShell>s at <SfxDispatcher::Push(SfxShell&)>.
When activating a SfxDispatcher all of the SfxShells located on its stack are called with the handler <SfxShell::Activate(bool)>, starting with the lowest.
Definition at line 573 of file dispatch.cxx.
References DBG_ASSERT, GetBindings(), i, IsAppDispatcher(), SAL_INFO, SfxBindings::SetActiveFrame(), SfxBindings::SetDispatcher(), SFX_STACK, and xImp.
void SfxDispatcher::DoDeactivate_Impl | ( | bool | bMDI, |
SfxViewFrame const * | pNew | ||
) |
This method controls the deactivation of a dispatcher.
Since the application dispatcher is always active, either as a sub dispatcher of the <SfxViewFrame> dispatcher or as itself, it is never deactivated as a whole, instead only its individual <SfxShell>s at <SfxDispatcher::Pop(SfxShell&)>.
When deactivating a SfxDispatcher all of the SfxShells located on its stack are called with the handler <SfxShell::Deactivate(bool)>, starting with the lowest.
Definition at line 624 of file dispatch.cxx.
References DBG_ASSERT, Flush(), SfxChildWindow::GetAlignment(), SfxWorkWindow::GetChildWindow_Impl(), GetFrame(), SfxViewFrame::GetFrame(), SfxFrame::GetFrameInterface(), i, IsAppDispatcher(), SfxApplication::IsDowning(), n, NOALIGNMENT, SAL_INFO, SFX_STACK, SfxGetpApp(), and xImp.
const SfxPoolItem * SfxDispatcher::Execute | ( | sal_uInt16 | nSlot, |
SfxCallMode | eCall, | ||
const SfxItemSet & | rArgs | ||
) |
Method to execute a <SfxSlot>s over the Slot-Id.
nSlot | the Id of the executing function |
eCall | SfxCallMode::SYNCRHON, ..._ASYNCHRON or ..._SLOT |
rArgs | <SfxItemSet> with the parameters |
Or a NULL-Pointer, when the function was not executed (for example canceled by the user).
Definition at line 881 of file dispatch.cxx.
References Execute_(), SfxItemIter::GetCurItem(), SfxShell::GetPool(), SfxRequest::GetReturnValue(), GetShellAndSlot_Impl(), IsLocked(), MappedPut_Impl(), SfxItemIter::NextItem(), and SfxRequest::SetModifier().
const SfxPoolItem * SfxDispatcher::Execute | ( | sal_uInt16 | nSlot, |
SfxCallMode | nCall, | ||
SfxItemSet const * | pArgs, | ||
SfxItemSet const * | pInternalArgs, | ||
sal_uInt16 | nModi | ||
) |
Definition at line 789 of file dispatch.cxx.
References Execute_(), SfxItemIter::GetCurItem(), SfxShell::GetPool(), SfxRequest::GetReturnValue(), GetShellAndSlot_Impl(), IsLocked(), MappedPut_Impl(), SfxItemIter::NextItem(), SfxRequest::SetInternalArgs_Impl(), and SfxRequest::SetModifier().
const SfxPoolItem * SfxDispatcher::Execute | ( | sal_uInt16 | nSlot, |
SfxCallMode | eCall = SfxCallMode::SLOT , |
||
const SfxPoolItem ** | pArgs = nullptr , |
||
sal_uInt16 | nModi = 0 , |
||
const SfxPoolItem ** | pInternalArgs = nullptr |
||
) |
Method to execute a <SfxSlot>s over the Slot-Id.
nSlot | the Id of the executing function |
eCall | SfxCallMode::SYNCRHON, ..._ASYNCHRON or ..._SLOT |
pArgs | Zero terminated C-Array of Parameters |
pInternalArgs | Zero terminated C-Array of Parameters |
Or a NULL-Pointer, when the function was not executed (for example canceled by the user).
Definition at line 833 of file dispatch.cxx.
References Execute_(), SfxShell::GetPool(), GetShellAndSlot_Impl(), IsLocked(), MappedPut_Impl(), SfxItemSet::Put(), and SfxGetpApp().
Referenced by SfxCommonTemplateDialog_Impl::ActionSelect(), SfxDispatchController_Impl::dispatch(), SfxObjectShell::ExecFile_Impl(), SfxViewFrame::ExecReload_Impl(), SfxCommonTemplateDialog_Impl::Execute_Impl(), SfxManageStyleSheetPage::Execute_Impl(), IMPL_LINK(), IMPL_LINK_NOARG(), SfxApplication::OpenDocExec_Impl(), SfxApplication::OpenRemoteExec_Impl(), SfxApplication::SignPDFExec_Impl(), and SfxObjectShell::SignSignatureLine().
|
private |
This method performs a request for a cached <Slot-Server>.
rShell | to the calling <SfxShell> |
rSlot | to the calling <SfxSlot> |
rReq | function to be performed (Id and optional parameters) |
eCallMode | Synchronously, asynchronously or as shown in the slot |
Definition at line 726 of file dispatch.cxx.
References SfxRequest::AllowRecording(), ASYNCHRON, Call_Impl(), DBG_ASSERT, Execute_(), IsLocked(), SfxSlot::IsMode(), n, RECORD, SFX_STACK, SLOT, SYNCHRON, and xImp.
Referenced by Execute(), Execute_(), SfxBindings::Execute_Impl(), and ExecuteList().
const SfxPoolItem * SfxDispatcher::ExecuteList | ( | sal_uInt16 | nSlot, |
SfxCallMode | eCall, | ||
std::initializer_list< SfxPoolItem const * > | args, | ||
std::initializer_list< SfxPoolItem const * > | internalargs = std::initializer_list<SfxPoolItem const*>() |
||
) |
Method to execute a <SfxSlot>s over the Slot-Id.
[Note]
The parameters are copied, can therefore be passed on as the address of stack objects.
nSlot | the Id of the executing function |
eCall | SfxCallMode::SYNCRHON, ..._ASYNCHRON or ..._SLOT |
args | list of SfxPoolItem arguments |
Or a NULL-Pointer, when the function was not executed (for example canceled by the user).
[Example]
pDispatcher->Execute( SID_OPENDOCUMENT, SfxCallMode::SYNCHRON, { &SfxStringItem( SID_FILE_NAME, "\\tmp\\temp.sdd" ), &SfxStringItem( SID_FILTER_NAME, "StarDraw Presentation" ), &SfxBoolItem( SID_DOC_READONLY, sal_False ), });
Definition at line 931 of file dispatch.cxx.
References args, Execute_(), SfxShell::GetPool(), SfxRequest::GetReturnValue(), GetShellAndSlot_Impl(), IsLocked(), MappedPut_Impl(), SfxItemSet::Put(), SfxRequest::SetInternalArgs_Impl(), and SfxGetpApp().
Referenced by SfxViewFrame::AddDispatchMacroToBasic_Impl(), SfxModelessDialogController::Close(), SfxDockingWindow::Close(), StyleList::FamilySelect(), IMPL_LINK_NOARG(), SfxViewShell::JumpToMark(), SfxApplication::LoadTemplate(), SfxApplication::MiscExec_Impl(), SfxApplication::NewDocExec_Impl(), SfxViewFrame::Notify(), SfxVersionDialog::Open_Impl(), SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(), and SfxRecordingFloatWrapper_Impl::~SfxRecordingFloatWrapper_Impl().
void SfxDispatcher::ExecutePopup | ( | const OUString & | rResName, |
vcl::Window * | pWin = nullptr , |
||
const Point * | pPos = nullptr |
||
) |
Definition at line 1838 of file dispatch.cxx.
References aEvent, fillPopupMenu(), GetFrame(), VCLUnoHelper::GetInterface(), vcl::Window::GetPointerPosPixel(), comphelper::getProcessComponentContext(), comphelper::LibreOfficeKit::isActive(), comphelper::makePropertyValue(), Point::X(), xImp, and Point::Y().
Referenced by ExecutePopup().
|
static |
Definition at line 1716 of file dispatch.cxx.
References ExecutePopup(), SfxApplication::GetDispatcher_Impl(), SfxShell::GetInterface(), SfxInterface::GetPopupMenuName(), GetShell(), SfxGetpApp(), and xImp.
|
static |
Definition at line 1832 of file dispatch.cxx.
Referenced by ExecutePopup().
|
private |
Helper method to obtain the status of the <Slot-Server>s rSvr.
The required slots IDs (partly converted to Which-IDs of the pool) must be present in rstate.
The SfxDispatcher is flushed before the query.
rSvr | Slot-Server to query |
rState | SfxItemSet to be filled |
pRealSlot | The actual Slot if possible |
Definition at line 1655 of file dispatch.cxx.
References SfxItemSet::Count(), DBG_ASSERT, FillState_(), SfxInterface::GetClassName(), SfxItemIter::GetCurItem(), SfxShell::GetInterface(), SfxItemSet::GetPool(), GetShell(), SfxSlotServer::GetShellLevel(), SfxSlotServer::GetSlot(), SfxInterface::GetSlot(), SfxItemPool::GetSlotId(), SfxSlot::GetStateFnc(), SfxSlot::GetType(), IsInvalidItem(), IsLocked(), SfxItemIter::NextItem(), SAL_INFO_IF, SFX_STACK, SfxType::Type(), and xImp.
Referenced by FillState_(), and SfxBindings::Update_Impl().
|
private |
This helper method searches for the <Slot-Server> which currently serves the nSlot.
As the result, rServe is filled accordingly.
If known the SfxInterface which is currently served by nSlot can be passed along.
The SfxDispatcher is flushed while searching for nSlot.
nSlot | Slot-Id to search for |
rServer | <SfxSlotServer>-Instance to fill |
false The Slot is currently not served, rServer is invalid.
Definition at line 1535 of file dispatch.cxx.
References bReadOnly, CONTAINER, DISABLED, ENABLED_READONLY, FindServer_(), Flush(), SfxShell::GetDisableFlags(), SfxShell::GetInterface(), GetShell(), SfxInterface::GetSlot(), SfxViewShell::GetUIActiveClient(), SfxShell::GetVerbSlot_Impl(), i, IsLocked(), SfxSlot::IsMode(), IsSlotEnabledByFilter_Impl(), SfxSlot::nDisableFlags, SfxSlot::nFlags, NONE, READONLYDOC, SfxSlotServer::SetShellLevel(), SfxSlotServer::SetSlot(), SFX_STACK, and xImp.
Referenced by FindServer_(), GetShellAndSlot_Impl(), SfxStateCache::GetSlotServer(), and PostMsgHandler().
void SfxDispatcher::Flush | ( | void | ) |
This method performs outstanding push- and pop- commands.
For <SfxShell>s, which are new on the stack, the <SfxShell::Activate(bool)> is invoked with bMDI == sal_True, for SfxShells that are removed from the stack, the <SfxShell::Deactivate(bool)> is invoked with bMDI == sal_True
Definition at line 155 of file dispatch.cxx.
References FlushImpl(), and xImp.
Referenced by SfxViewShell::AddSubShell(), SfxBaseController::ConnectSfxFrame_Impl(), DoDeactivate_Impl(), SfxBindings::Execute_Impl(), FindServer_(), GetShellAndSlot_Impl(), GetShellLevel(), GetSlot(), SfxBindings::InvalidateShell(), PostMsgHandler(), SfxViewShell::PushSubShells_Impl(), SfxBindings::QueryControlState(), RemoveShell_Impl(), SfxViewShell::RemoveSubShell(), SfxApplication::SetOptions(), SfxApplication::SetViewFrame_Impl(), SfxBindings::Update(), Update_Impl(), and SfxBindings::UpdateSlotServer_Impl().
|
private |
Helper method to execute the outstanding push and pop commands.
Definition at line 1286 of file dispatch.cxx.
References DBG_ASSERT, FlushImpl(), GetBindings(), i, InvalidateBindings_Impl(), SfxApplication::IsDowning(), NONE, None, SAL_INFO, SfxShell::SetDisableFlags(), SFX_STACK, SfxGetpApp(), and xImp.
Referenced by Flush(), and FlushImpl().
SfxBindings * SfxDispatcher::GetBindings | ( | ) | const |
This method returns a pointer to the <SfxBinding> Instance on which the SfxDispatcher is currently bound.
A SfxDispatcher is only bound to the SfxBindings when it is <UI-aktiv>. If it is not UI-active, a NULL-pointer is returned.
The returned pointer is only valid in the immediate context of the method call.
Definition at line 545 of file dispatch.cxx.
References xImp.
Referenced by Call_Impl(), SfxDispatchController_Impl::dispatch(), DoActivate_Impl(), FlushImpl(), InvalidateBindings_Impl(), Lock(), SfxViewFrame::Notify(), Pop(), SfxShell::PutItem(), SfxBindings::SetDispatcher(), SetQuietMode_Impl(), SetSlotFilter(), SfxShell::SetVerbs(), Update_Impl(), and ~SfxDispatcher().
SfxDisableFlags SfxDispatcher::GetDisableFlags | ( | ) | const |
Definition at line 2085 of file dispatch.cxx.
References xImp.
SfxViewFrame * SfxDispatcher::GetFrame | ( | ) | const |
Returns a pointer to the <SfxViewFrame> instance, which belongs to this SfxDispatcher.
If it is about the application dispatcher, a NULL-pointer is returned.
Definition at line 557 of file dispatch.cxx.
References xImp.
Referenced by Call_Impl(), sfx2::SfxNotebookBar::CloseMethod(), SfxChildWindow::CreateChildWindow(), DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(), SfxDispatchController_Impl::dispatch(), DoDeactivate_Impl(), SfxBindings::Execute_Impl(), ExecutePopup(), StyleList::FillTreeBox(), SfxBindings::GetActiveFrame(), SfxWorkWindow::GetFrameInterface(), sfx2::sidebar::SidebarDockingWindow::GetOrCreateSidebarController(), SfxStateCache::GetSlotServer(), SfxDockingWindow::Initialize_Impl(), SfxWorkWindow::InitializeChild_Impl(), SfxCommonTemplateDialog_Impl::IsUpdate(), SfxBindings::LeaveRegistrations(), SfxBindings::NextJob_Impl(), StyleList::Notify(), SfxBindings::QueryState(), SfxBindings::SetActiveFrame(), SfxBindings::SetDispatcher(), SfxDispatchController_Impl::SfxDispatchController_Impl(), SfxDockingWrapper::SfxDockingWrapper(), SfxPartDockWnd_Impl::SfxPartDockWnd_Impl(), SfxRecordingFloatWrapper_Impl::SfxRecordingFloatWrapper_Impl(), SfxDispatchController_Impl::StateChanged(), sfx2::SfxNotebookBar::StateMethod(), StyleList::StyleList(), SfxInfoBarContainerChild::Update(), StyleList::Update(), Update_Impl_(), StyleList::UpdateFamily(), SfxWorkWindow::UpdateObjectBars_Impl2(), and StyleList::UpdateStyles().
SfxModule * SfxDispatcher::GetModule | ( | ) | const |
Definition at line 2090 of file dispatch.cxx.
References GetShell().
ToolbarId SfxDispatcher::GetObjectBarId | ( | sal_uInt16 | nPos | ) | const |
Definition at line 1915 of file dispatch.cxx.
bool SfxDispatcher::GetReadOnly_Impl | ( | ) | const |
Definition at line 1954 of file dispatch.cxx.
References xImp.
Referenced by SfxViewFrame::Notify().
SfxShell * SfxDispatcher::GetShell | ( | sal_uInt16 | nIdx | ) | const |
Returns a pointer to the <SfxShell> which is at the position nIdx (from the top, last pushed is 0) on the stack.
Thus the SfxDispatcher is not flushed.
Is the stack not deep enough a NULL-Pointer is returned.
Definition at line 529 of file dispatch.cxx.
References xImp.
Referenced by SfxBindings::CreateSet_Impl(), SfxViewFrame::ExecHistory_Impl(), SfxBindings::Execute_Impl(), ExecutePopup(), FillState_(), FindServer_(), SfxControllerItem::GetCoreMetric(), GetModule(), GetShellAndSlot_Impl(), GetSlot(), PostMsgHandler(), SfxApplication::SetOptions(), SfxDispatchController_Impl::StateChanged(), SfxViewFrame::StateHistory_Impl(), and Update_Impl_().
bool SfxDispatcher::GetShellAndSlot_Impl | ( | sal_uInt16 | nSlot, |
SfxShell ** | ppShell, | ||
const SfxSlot ** | ppSlot, | ||
bool | bOwnShellsOnly, | ||
bool | bRealSlot | ||
) |
This method searches in SfxDispatcher after <SfxShell> , from the Slot Id nSlot currently being handled.
For this, the dispatcher is first flushed.
nSlot | the searchable Slot-Id |
ppShell | the SfxShell, which are currently handled the nSlot |
ppSlot | the SfxSlot, which are currently handled the nSlot |
sal_False The SfxShell was not found, ppShell and ppSlot are invalid.
Definition at line 696 of file dispatch.cxx.
References FindServer_(), Flush(), GetShell(), GetShellAndSlot_Impl(), SfxSlotServer::GetShellLevel(), SfxSlotServer::GetSlot(), SFX_STACK, and xImp.
Referenced by SfxDispatchController_Impl::dispatch(), Execute(), ExecuteList(), GetShellAndSlot_Impl(), and QueryState().
sal_uInt16 SfxDispatcher::GetShellLevel | ( | const SfxShell & | rShell | ) |
Determines the position of a given SfxShell in the stack of the dispatcher.
If possible this is flushed before.
[Return value]
sal_uInt16 == USRT_MAX The SfxShell is not on this SfxDispatcher.
< USHRT_MAX Position of the SfxShell on the Dispatcher from the top count stating with 0.
Definition at line 510 of file dispatch.cxx.
References Flush(), GetShellLevel(), n, SFX_STACK, and xImp.
Referenced by GetShellLevel(), SfxBindings::InvalidateShell(), and SfxViewShell::PushSubShells_Impl().
const SfxSlot * SfxDispatcher::GetSlot | ( | const OUString & | rCommand | ) |
Definition at line 769 of file dispatch.cxx.
References Flush(), GetShell(), SfxInterface::GetSlot(), i, and xImp.
void SfxDispatcher::HideUI | ( | bool | bHide = true | ) |
Definition at line 1920 of file dispatch.cxx.
References SfxViewFrame::GetBindings(), SfxBindings::GetDispatcher(), SfxViewFrame::GetFrame(), SfxFrame::GetFrameInterface(), SfxFrame::IsMenuBarOn_Impl(), Update_Impl(), and xImp.
Referenced by SfxBaseController::ConnectSfxFrame_Impl().
void SfxDispatcher::InvalidateBindings_Impl | ( | bool | bModify | ) |
Definition at line 2053 of file dispatch.cxx.
References GetBindings(), SfxBindings::GetDispatcher_Impl(), SfxViewFrame::GetFirst(), SfxViewFrame::GetNext(), SfxBindings::InvalidateAll(), and IsAppDispatcher().
Referenced by FlushImpl(), and RemoveShell_Impl().
bool SfxDispatcher::IsActive | ( | const SfxShell & | rShell | ) |
This method checks whether a particular <SfxShell> instance is on the SfxDispatcher.
Definition at line 180 of file dispatch.cxx.
References CheckVirtualStack().
Referenced by SfxViewShell::AddSubShell(), and SfxViewShell::RemoveSubShell().
bool SfxDispatcher::IsAppDispatcher | ( | ) | const |
With this method it can be determined if the SfxDispacher is the applications dispatcher.
Definition at line 206 of file dispatch.cxx.
References xImp.
Referenced by DoActivate_Impl(), DoDeactivate_Impl(), and InvalidateBindings_Impl().
bool SfxDispatcher::IsFlushed | ( | ) | const |
This method checks if the stack of the SfxDispatchers is flushed, or if push- or pop- commands are pending.
Definition at line 145 of file dispatch.cxx.
References xImp.
Referenced by SfxBindings::NextJob_Impl().
bool SfxDispatcher::IsLocked | ( | ) | const |
With this method it can be determined whether the SfxDispatcher is locked or unlocked.
A locked SfxDispatcher does not perform <SfxRequest>s and no longer provides any status information. It behaves as if all the slots are disabled.
The dispatcher is also marked as blocked, if all Dispatcher are locked (<SfxApplication::LockDispatcher()>) or the associated top frame is in the modal-mode and if the specified slot are handled as frame-specific (ie, not served by the application).
Definition at line 196 of file dispatch.cxx.
References xImp.
Referenced by SfxDispatchController_Impl::dispatch(), Execute(), Execute_(), ExecuteList(), FillState_(), FindServer_(), and PostMsgHandler().
bool SfxDispatcher::IsReadOnlyShell_Impl | ( | sal_uInt16 | nShell | ) | const |
SfxSlotFilterState SfxDispatcher::IsSlotEnabledByFilter_Impl | ( | sal_uInt16 | nSID | ) | const |
Searches for 'nSID' in the Filter set by <SetSlotFilter()> and returns sal_True, if the SIDis allowed, or sal_False, if it is disabled by the Filter.
Definition at line 1497 of file dispatch.cxx.
References DISABLED, ENABLED, ENABLED_READONLY, SfxCompareSIDs_Impl(), and xImp.
Referenced by FindServer_().
bool SfxDispatcher::IsUpdated_Impl | ( | ) | const |
Definition at line 2073 of file dispatch.cxx.
References xImp.
Referenced by SfxViewFrame::Notify().
void SfxDispatcher::Lock | ( | bool | bLock | ) |
With this method the SfxDispatcher can be locked and released.
A locked SfxDispatcher does not perform <SfxRequest>s and does no longer provide status information. It behaves as if all the slots were disabled.
Definition at line 1895 of file dispatch.cxx.
References GetBindings(), i, SfxBindings::InvalidateAll(), and xImp.
Referenced by SfxViewFrame::Close(), and SfxBaseController::ConnectSfxFrame_Impl().
void SfxDispatcher::Pop | ( | SfxShell & | rShell, |
SfxDispatcherPopFlags | nMode = SfxDispatcherPopFlags::NONE |
||
) |
With this method, one or more <SfxShell> are popped from the SfxDispatcher.
The SfxShell is marked for popping and a timer is set up. Only when the timer has reached the end, the pop is actually performed ( <SfxDispatcher::Flush()> ) and the <SfxBindings> is invalidated. While the timer is running the opposing push and pop commands on one SfxShell cancel each other out.
rShell | the stack to take the SfxShell instance. |
nMode | SfxDispatcherPopFlags::POP_UNTIL Also all 'rShell' of SfxShells are taken from the stack. |
SfxDispatcherPopFlags::POP_DELETE All SfxShells actually taken from the stack will be deleted.
SfxDispatcherPopFlags::PUSH (InPlace use only) The Shell is pushed.
Definition at line 380 of file dispatch.cxx.
References DBG_ASSERT, GetBindings(), SfxInterface::GetClassName(), SfxShell::GetInterface(), SfxApplication::IsDowning(), POP_DELETE, POP_UNTIL, PUSH, SAL_INFO, SAL_STREAM, SfxGetpApp(), and xImp.
Referenced by Push(), SfxViewShell::PushSubShells_Impl(), and SfxViewShell::RemoveSubShell().
|
private |
Helper method to receive the asynchronously executed <SfxRequest>s.
why bRecord?
Definition at line 971 of file dispatch.cxx.
References Call_Impl(), DBG_ASSERT, FindServer_(), Flush(), GetShell(), SfxSlotServer::GetShellLevel(), SfxSlotServer::GetSlot(), IsLocked(), PostMsgHandler(), SFX_STACK, and xImp.
Referenced by Construct_Impl(), and PostMsgHandler().
void SfxDispatcher::Push | ( | SfxShell & | rShell | ) |
With this method, a <SfxShell> pushed on to the SfxDispatcher.
The SfxShell is first marked for push and a timer is set up. First when the timer has counted down to zero the push ( <SfxDispatcher::Flush()> ) is actually performed and the <SfxBindings> is invalidated. While the timer is counting down the opposing push and pop commands on the same SfxShell are leveled out.
Definition at line 168 of file dispatch.cxx.
Referenced by SfxViewShell::AddSubShell(), SfxBaseController::ConnectSfxFrame_Impl(), and SfxViewShell::PushSubShells_Impl().
SfxItemState SfxDispatcher::QueryState | ( | sal_uInt16 | nSID, |
const SfxPoolItem *& | rpState | ||
) |
Definition at line 1970 of file dispatch.cxx.
References GetShellAndSlot_Impl(), and SfxShell::GetSlotState().
Referenced by SfxDispatchController_Impl::addStatusListener(), SfxViewFrame::ChildWindowState(), SfxDispatchController_Impl::dispatch(), SfxApplication::MiscState_Impl(), SfxBindings::QueryState(), and Update_Impl().
SfxItemState SfxDispatcher::QueryState | ( | sal_uInt16 | nSID, |
css::uno::Any & | rAny | ||
) |
Definition at line 1986 of file dispatch.cxx.
References CONVERT_TWIPS, SfxItemPool::GetMetric(), SfxShell::GetPool(), GetShellAndSlot_Impl(), SfxShell::GetSlotState(), SfxItemPool::GetWhich(), SfxPoolItem::IsVoidItem(), and SfxPoolItem::QueryValue().
|
inline |
Definition at line 157 of file dispatch.hxx.
void SfxDispatcher::RemoveShell_Impl | ( | SfxShell & | rShell | ) |
Definition at line 2030 of file dispatch.cxx.
References SfxShell::DoDeactivate_Impl(), Flush(), InvalidateBindings_Impl(), n, nCount, NONE, SfxShell::SetDisableFlags(), SfxGetpApp(), and xImp.
Referenced by SfxViewShell::RemoveSubShell().
void SfxDispatcher::SetDisableFlags | ( | SfxDisableFlags | nFlags | ) |
Definition at line 2078 of file dispatch.cxx.
References xImp.
Referenced by SfxBaseModel::createViewController(), and SfxViewFrame::ReleaseObjectShell_Impl().
void SfxDispatcher::SetMenu_Impl | ( | ) |
Definition at line 1004 of file dispatch.cxx.
References SfxViewFrame::GetBindings(), SfxBindings::GetDispatcher(), SfxViewFrame::GetFrame(), SfxFrame::GetFrameInterface(), SfxFrame::IsMenuBarOn_Impl(), and xImp.
Referenced by Update_Impl().
void SfxDispatcher::SetQuietMode_Impl | ( | bool | bOn | ) |
With 'bOn' the Dispatcher is quasi dead and transfers everything to the Parent-Dispatcher.
Definition at line 1962 of file dispatch.cxx.
References GetBindings(), SfxBindings::InvalidateAll(), and xImp.
Referenced by SfxViewFrame::Construct_Impl().
void SfxDispatcher::SetReadOnly_Impl | ( | bool | bOn | ) |
Definition at line 1949 of file dispatch.cxx.
References xImp.
Referenced by SfxViewFrame::Notify().
void SfxDispatcher::SetSlotFilter | ( | SfxSlotFilterState | nEnable = SfxSlotFilterState::DISABLED , |
o3tl::span< sal_uInt16 const > | pSIDs = o3tl::span<sal_uInt16 const>() |
||
) |
With this method a filter set, the target slots can be enabled or disabled.
The passed array must be retained until the destructor or the next <SetSlotFilter()>, it is not deleted from the dispatcher, so it can thus be static.
In read-only documents the quasi ReadOnlyDoc Flag of slots can be overturned by the use of 'bEnable == 2', so this will be displayed again. On the other slots it has no effect.
HACK(here should be used an enum) ???
nEnable | 1==true: only enable specified slots, disable all other 0==false: disable specified slots, first enable all other |
nCount | Number of SIDs in the following Array |
pSIDs | sorted Array of 'nCount' SIDs |
[Example]
Targeted disabling of Slots 1, 2 and 3:
static sal_uInt16 const pSIDs[] = { 1, 2, 3 }; pDisp->SetSlotFilter( sal_False, sizeof(pSIDs)/sizeof(sal_uInt16), pSIDs );
only permit Slots 5, 6 and 7:
static sal_uInt16 const pSIDs[] = { 5, 6, 7 }; pDisp->SetSlotFilter( sal_True, sizeof(pSIDs)/sizeof(sal_uInt16), pSIDs );
Turn-off Filter:
pDisp->SetSlotFilter();
Definition at line 1465 of file dispatch.cxx.
References DBG_ASSERT, GetBindings(), SfxBindings::InvalidateAll(), n, o3tl::span< typename T >::size(), and xImp.
void SfxDispatcher::Update_Impl | ( | bool | bForce = false | ) |
Definition at line 1034 of file dispatch.cxx.
References SfxViewShell::Current(), Flush(), SfxBindings::GetActiveFrame(), SfxViewFrame::GetBindings(), SfxWorkWindow::GetBindings(), GetBindings(), GetDispatcher(), SfxBindings::GetDispatcher(), SfxShell::GetDispatcher(), SfxBindings::GetDispatcher_Impl(), SfxInPlaceClient::IsObjectUIActive(), QueryState(), SfxWorkWindow::ResetChildWindows_Impl(), SfxWorkWindow::ResetObjectBars_Impl(), SfxWorkWindow::ResetStatusBar_Impl(), SetMenu_Impl(), SFX_STACK, Update_Impl(), Update_Impl_(), SfxWorkWindow::UpdateObjectBars_Impl(), xFrame, and xImp.
Referenced by SfxFrame::AppearWithUpdate(), SfxViewFrame::ChildWindowExecute(), SfxBaseController::ConnectSfxFrame_Impl(), SfxViewFrame::Exec_Impl(), HideUI(), SfxViewFrame::MakeActive_Impl(), SfxViewFrame::MiscExec_Impl(), SfxBindings::NextJob_Impl(), SfxViewFrame::Notify(), SfxFrame::SetPresentationMode(), SfxApplication::SetViewFrame_Impl(), SfxViewFrame::ShowChildWindow(), SfxViewShell::UIActivating(), SfxViewShell::UIDeactivated(), SfxBindings::Update(), and Update_Impl().
|
private |
Definition at line 1130 of file dispatch.cxx.
References bVisible, Client, CONTAINER, SfxWorkWindow::GetBindings(), SfxInterface::GetChildWindowCount(), SfxInterface::GetChildWindowFeature(), SfxInterface::GetChildWindowId(), SfxBindings::GetDispatcher_Impl(), GetFrame(), SfxShell::GetInterface(), SfxItemSet::GetItem(), SfxMedium::GetItemSet(), SfxObjectShell::GetMedium(), SfxInterface::GetObjectBarCount(), SfxInterface::GetObjectBarFeature(), SfxInterface::GetObjectBarFlags(), SfxInterface::GetObjectBarId(), SfxInterface::GetObjectBarPos(), GetShell(), SfxSlotPool::GetSlot(), SfxSlotPool::GetSlotPool(), SfxInterface::GetStatusBarId(), SfxBoolItem::GetValue(), SfxShell::HasUIFeature(), Invisible, SfxWorkWindow::IsFloating(), SfxSlot::IsMode(), SfxInterface::IsObjectBarVisible(), IsReadOnlyShell_Impl(), SfxWorkWindow::IsVisible_Impl(), nId, NONE, None, nPos, READONLYDOC, ReadonlyDoc, SAL_WARN_IF, Server, SfxWorkWindow::SetChildWindowVisible_Impl(), SfxWorkWindow::SetObjectBar_Impl(), SFX_OBJECTBAR_MAX, Standard, Viewer, and xImp.
Referenced by Update_Impl().
|
friend |
Definition at line 76 of file dispatch.hxx.
|
friend |
Definition at line 78 of file dispatch.hxx.
|
friend |
Definition at line 81 of file dispatch.hxx.
|
friend |
Definition at line 80 of file dispatch.hxx.
|
friend |
Definition at line 79 of file dispatch.hxx.
|
friend |
Definition at line 77 of file dispatch.hxx.
|
private |
Definition at line 71 of file dispatch.hxx.
Referenced by Call_Impl(), CheckVirtualStack(), Construct_Impl(), DoActivate_Impl(), DoDeactivate_Impl(), Execute_(), ExecutePopup(), FillState_(), FindServer_(), Flush(), FlushImpl(), GetBindings(), GetDisableFlags(), GetFrame(), GetObjectBarId(), GetReadOnly_Impl(), GetShell(), GetShellAndSlot_Impl(), GetShellLevel(), GetSlot(), HideUI(), IsAppDispatcher(), IsFlushed(), IsLocked(), IsReadOnlyShell_Impl(), IsSlotEnabledByFilter_Impl(), IsUpdated_Impl(), Lock(), Pop(), PostMsgHandler(), RemoveShell_Impl(), SetDisableFlags(), SetMenu_Impl(), SetQuietMode_Impl(), SetReadOnly_Impl(), SetSlotFilter(), SfxDispatcher(), Update_Impl(), Update_Impl_(), and ~SfxDispatcher().