20#include <config_features.h>
21#include <config_wasm_strip.h>
23#include <com/sun/star/drawing/ModuleDispatcher.hpp>
24#include <com/sun/star/frame/Desktop.hpp>
25#include <com/sun/star/frame/DispatchResultEvent.hpp>
26#include <com/sun/star/frame/DispatchResultState.hpp>
27#include <com/sun/star/frame/DispatchHelper.hpp>
28#include <com/sun/star/frame/UnknownModuleException.hpp>
29#include <com/sun/star/frame/XLayoutManager.hpp>
30#include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
31#include <com/sun/star/sdbc/DriverManager.hpp>
32#include <com/sun/star/text/ModuleDispatcher.hpp>
33#include <com/sun/star/task/OfficeRestartManager.hpp>
34#include <com/sun/star/task/XInteractionHandler.hpp>
35#include <com/sun/star/ui/dialogs/AddressBookSourcePilot.hpp>
36#include <com/sun/star/ui/UIElementType.hpp>
37#include <com/sun/star/ui/XUIElement.hpp>
38#include <com/sun/star/uno/Reference.hxx>
39#include <com/sun/star/util/XCloseable.hpp>
40#include <com/sun/star/util/CloseVetoException.hpp>
41#include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
67#include <osl/file.hxx>
72#include <rtl/bootstrap.hxx>
74#include <com/sun/star/frame/ModuleManager.hpp>
75#include <com/sun/star/beans/XPropertySet.hpp>
87#include <sfx2/strings.hrc>
92#include <sfx2/sfxsids.hrc>
104#include <officecfg/Office/Common.hxx>
145 bool lcl_isBaseAvailable()
153 catch (
const Exception &)
159 void lcl_tryLoadBibliography()
163 if(!lcl_isBaseAvailable())
165 if (officecfg::Office::Common::PackageKit::EnableBaseInstallation::get())
169 using namespace org::freedesktop::PackageKit;
172 Sequence< OUString > vPackages {
"libreoffice-base" };
173 xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString());
178 catch (
const Exception &)
193 pViewFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
197 catch (
const Exception &)
205static bool checkURL(
const char *pName,
const char *pExt, OUString &rURL )
208 DirectoryItem aDirItem;
211 rURL =
"$BRAND_BASE_DIR/Resources/" + OUString::createFromAscii(
pName ) +
212 OUString::createFromAscii(
pExt );
214 rURL =
"$BRAND_BASE_DIR/" + OUString::createFromAscii(
pName ) +
215 OUString::createFromAscii(
pExt );
217 rtl::Bootstrap::expandMacros( rURL );
220 return DirectoryItem::get( rURL, aDirItem ) == DirectoryItem::E_None;
229 Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() );
230 auto args(::comphelper::InitPropertySequence({
231 {
"ViewOnly",
Any(
true)},
232 {
"ReadOnly",
Any(
true)}
239 xDesktop->loadComponentFromURL(
aURL,
"_blank", 0,
args );
241 }
catch (
const css::uno::Exception &) {
247 Reference<XFrame> GetRequestFrame(
const SfxRequest& rReq)
251 Reference <XFrame>
xFrame;
252 if (pArgs && (pItem = pArgs->
GetItemIfSet(SID_FILLFRAME,
false)))
263 : GenericDialogController(pParent,
"sfx/ui/licensedialog.ui",
"LicenseDialog")
267 virtual short run()
override
280 : MessageDialogController(pParent,
"sfx/ui/safemodequerydialog.ui",
"SafeModeQueryDialog")
284 virtual short run()
override
291 css::task::OfficeRestartManager::get(xContext)->requestRestart(
292 css::uno::Reference< css::task::XInteractionHandler >());
303 if (pIntArgs && (pItem = pIntArgs->
GetItemIfSet(SID_DIALOG_PARENT,
false)))
306 Reference<awt::XWindow> xWindow;
311 Reference<XFrame>
xFrame(GetRequestFrame(*
this));
314 SAL_WARN(
"sfx.appl",
"no parent for dialogs");
336 if (
pImpl->bInQuit )
339 if ( rReq.
GetSlot() == SID_LOGOUT )
344 if ( !pObjSh->IsModified() )
351 if (pObjSh->PrepareClose())
352 pObjSh->SetModified(
false );
357 SfxStringItem aNameItem( SID_FILE_NAME,
"vnd.sun.star.cmd:logout" );
359 pImpl->pAppDispat->ExecuteList(SID_OPENDOC,
378 pImpl->bInQuit =
true;
379 Reference < XDesktop2 > xDesktop = Desktop::create ( ::comphelper::getProcessComponentContext() );
384 bool bTerminated = xDesktop->terminate();
387 pImpl->bInQuit =
false;
395 case SID_TOOLBOXOPTIONS:
396 case SID_CONFIGSTATUSBAR:
398 case SID_CONFIGACCEL:
399 case SID_CONFIGEVENT:
412 SID_CONFIG, pStringItem->
GetValue() ) );
414 else if (rReq.
GetSlot() == SID_CONFIGEVENT)
417 SID_CONFIG,
"private:resource/event/" ) );
419 else if (rReq.
GetSlot() == SID_TOOLBOXOPTIONS)
422 SID_CONFIG,
"private:resource/toolbar/" ) );
425#if HAVE_FEATURE_SCRIPTING
427 if (
auto const item = rReq.
GetArg<SfxMacroInfoItem>(SID_MACROINFO)) {
432 Reference <XFrame>
xFrame(GetRequestFrame(rReq));
436 const short nRet = pDlg->Execute();
446 Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() );
447 Reference< XIndexAccess > xTasks = xDesktop->getFrames();
454 if ( xTasks->getCount() <=
n )
457 Any aAny = xTasks->getByIndex(
n);
458 Reference < XCloseable > xTask;
465 catch( CloseVetoException& )
471 bool bOk = (
n == 0);
485 if ( pObjSh->IsModified() && !pObjSh->isSaveLocked())
487 pObjSh->ExecuteSlot( aReq );
499 case SID_SEND_FEEDBACK:
502 OUString sURL(officecfg::Office::Common::Menus::SendFeedbackURL::get() +
505 "&LOmodule=" +
module.subView(
module.lastIndexOf(
'.') + 1 ) );
515 OUString sURL(officecfg::Office::Common::Menus::QA_URL::get() +
520 case SID_DOCUMENTATION:
523 OUString sURL(officecfg::Office::Common::Menus::DocumentationURL::get() +
528#if !ENABLE_WASM_STRIP_PINGUSER
529 case SID_GETINVOLVED:
532 OUString sURL(officecfg::Office::Common::Menus::GetInvolvedURL::get() +
542 OUString sURL(officecfg::Office::Common::Menus::DonationURL::get() +
543 "?BCP47=" + aBcp47 +
"&LOlang=" + aLang );
550 OUString sURL(officecfg::Office::Common::Menus::ReleaseNotesURL::get() +
556 case SID_HYPHENATIONMISSING:
559 OUString sURL(officecfg::Office::Common::Menus::HyphenationMissingURL::get() +
565 case SID_SHOW_LICENSE:
572 case SID_SHOW_CREDITS:
578 case FN_CHANGE_THEME:
583 SAL_WARN(
"sfx.appl",
"FN_CHANGE_THEME: no theme name");
587 const OUString& rSchemeName = pNewThemeArg->
GetValue();
635 officecfg::Office::Common::Help::Tip::set(bOn, xChanges);
646 case SID_EXTENDEDHELP:
651 case SID_HELPBALLOONS:
664 officecfg::Office::Common::Help::ExtendedTip::set(bOn, xChanges);
675#if !ENABLE_WASM_STRIP_PINGUSER
676 case SID_TIPOFTHEDAY:
680 pDlg->StartExecuteAsync(
nullptr);
686 case SID_WIDGET_TEST_DIALOG:
690 pDlg->StartExecuteAsync([pDlg](sal_Int32 ){
702 pDlg->StartExecuteAsync(
nullptr);
707 case SID_TEMPLATE_MANAGER:
715 case SID_TEMPLATE_ADDRESSBOOKSOURCE:
717 svt::AddressBookSourceDialog aDialog(rReq.
GetFrameWeld(), ::comphelper::getProcessComponentContext());
723#if HAVE_FEATURE_SCRIPTING
728 case SID_BASICBREAK :
733 case SID_ZOOM_50_PERCENT:
734 case SID_ZOOM_75_PERCENT:
735 case SID_ZOOM_100_PERCENT:
736 case SID_ZOOM_150_PERCENT:
737 case SID_ZOOM_200_PERCENT:
738 case SID_ZOOM_OPTIMAL:
739 case SID_ZOOM_ENTIRE_PAGE:
740 case SID_ZOOM_PAGE_WIDTH:
752 case SID_ZOOM_50_PERCENT:
755 case SID_ZOOM_75_PERCENT:
758 case SID_ZOOM_100_PERCENT:
761 case SID_ZOOM_150_PERCENT:
764 case SID_ZOOM_200_PERCENT:
767 case SID_ZOOM_OPTIMAL:
770 case SID_ZOOM_ENTIRE_PAGE:
773 case SID_ZOOM_PAGE_WIDTH:
782 case SID_TOOLBAR_MODE:
792 OUString aNewName(pModeName->
GetValue());
793 uno::Reference< uno::XComponentContext > xContext =
794 ::comphelper::getProcessComponentContext();
797 Reference<XFrame> xCurrentFrame;
799 OUString aCurrentMode;
806 const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( xContext );
809 OUString aPath =
"org.openoffice.Office.UI.ToolbarMode/Applications/" +
824 if ( aCurrentMode == aNewName )
850 const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( xContext );
852 if ( eApp != eCurrentApp )
858 Reference<css::beans::XPropertySet> xPropSet(
xFrame, UNO_QUERY );
859 Reference<css::frame::XLayoutManager> xLayoutManager;
864 Any aValue = xPropSet->getPropertyValue(
"LayoutManager" );
865 aValue >>= xLayoutManager;
867 catch (
const css::uno::RuntimeException& )
871 catch ( css::uno::Exception& )
876 if ( xLayoutManager.is() )
878 css::uno::Sequence<OUString> aMandatoryToolbars;
879 css::uno::Sequence<OUString> aUserToolbars;
880 std::vector<OUString> aBackupList;
881 OUString aSidebarMode;
883 OUString aPath =
"org.openoffice.Office.UI.ToolbarMode/Applications/" +
898 const Sequence<OUString> aModeNodeNames( aModesNode.
getNodeNames() );
900 for (
const auto& rModeNodeName : aModeNodeNames )
908 if ( aCommandArg == aNewName )
910 aMandatoryToolbars = aModeNode.
getNodeValue(
"Toolbars" ).get< uno::Sequence<OUString> >();
911 aUserToolbars = aModeNode.
getNodeValue(
"UserToolbars" ).get< uno::Sequence<OUString> >();
918 const Sequence<Reference<XUIElement>> aUIElements = xLayoutManager->getElements();
919 for (
const Reference< XUIElement >& xUIElement : aUIElements )
921 Reference< XPropertySet > xPropertySet( xUIElement, UNO_QUERY );
922 if ( xPropertySet.is() && xUIElement.is() )
927 sal_Int16
nType( -1 );
928 xPropertySet->getPropertyValue(
"Type" ) >>=
nType;
929 xPropertySet->getPropertyValue(
"ResourceURL" ) >>= aResName;
931 if ((
nType == css::ui::UIElementType::TOOLBAR ) &&
932 !aResName.isEmpty() )
934 if ( xLayoutManager->isElementVisible( aResName ) )
936 aBackupList.push_back( aResName );
938 xLayoutManager->hideElement( aResName );
952 for (
const OUString& rName : std::as_const(aMandatoryToolbars) )
954 xLayoutManager->createElement( rName );
955 xLayoutManager->showElement( rName );
958 for (
const OUString& rName : std::as_const(aUserToolbars) )
960 xLayoutManager->createElement( rName );
961 xLayoutManager->showElement( rName );
968 aSidebarMode =
"Opened";
974 if ( aSidebarMode ==
"Arrow" )
978 else if ( aSidebarMode ==
"Tabs" )
984 else if ( aSidebarMode ==
"Opened" )
996 for (
const auto& rModeNodeName : aModeNodeNames )
1004 if ( aCommandArg == aCurrentMode )
1020 case SID_TOOLBAR_MODE_UI:
1029 case SID_AVAILABLE_TOOLBARS:
1035 Reference < XDesktop2 > xDesktop = Desktop::create ( ::comphelper::getProcessComponentContext() );
1036 Reference< XFrame >
xFrame = xDesktop->getActiveFrame();
1038 Reference< css::beans::XPropertySet > xPropSet(
xFrame, UNO_QUERY );
1039 Reference< css::frame::XLayoutManager > xLayoutManager;
1040 if ( xPropSet.is() )
1044 Any aValue = xPropSet->getPropertyValue(
"LayoutManager");
1045 aValue >>= xLayoutManager;
1047 catch (
const css::uno::RuntimeException& )
1051 catch ( css::uno::Exception& )
1056 if ( xLayoutManager.is() )
1058 OUString aToolbarName =
"private:resource/toolbar/" +
1062 bool bShow( !xLayoutManager->isElementVisible( aToolbarName ));
1066 xLayoutManager->createElement( aToolbarName );
1067 xLayoutManager->showElement( aToolbarName );
1070 xLayoutManager->hideElement( aToolbarName );
1083 case SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW:
1093 case SID_INSPECT_SELECTED_OBJECT:
1098 rViewFrame.
ShowChildWindow(SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW,
true);
1119 case SID_TOOLBAR_LOCK:
1123 Reference<XFrame> xCurrentFrame;
1124 uno::Reference<uno::XComponentContext> xContext
1125 = ::comphelper::getProcessComponentContext();
1126 xCurrentFrame = pViewFrame->GetFrame().GetFrameInterface();
1127 const Reference<frame::XModuleManager> xModuleManager
1128 = frame::ModuleManager::create(xContext);
1130 xContext,
"org.openoffice.Office.UI.GlobalSettings/Toolbars/States",
true);
1156 for (
auto const & pRange : pRanges )
1158 for(sal_uInt16 nWhich = pRange.first; nWhich <= pRange.second; ++nWhich)
1162 case SID_TEMPLATE_ADDRESSBOOKSOURCE:
1168 if (
pImpl->nDocModalMode )
1176 case SID_TOOLBOXOPTIONS:
1177 case SID_CONFIGSTATUSBAR:
1178 case SID_CONFIGMENU:
1179 case SID_CONFIGACCEL:
1180 case SID_CONFIGEVENT:
1182 if( officecfg::Office::Common::Misc::DisableUICustomization::get() )
1187#if HAVE_FEATURE_SCRIPTING
1199 case SID_HELPBALLOONS:
1205 case SID_EXTENDEDHELP:
1212 Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() );
1213 Reference< XIndexAccess > xTasks = xDesktop->getFrames();
1214 if ( !xTasks.is() || !xTasks->getCount() )
1221 bool bModified =
false;
1226 if ( pObjSh->IsModified() && !pObjSh->isSaveLocked() )
1238 case SID_TEMPLATE_MANAGER:
1240 if ( !officecfg::Office::Common::Misc::ExperimentalMode::get() )
1248 case SID_ZOOM_50_PERCENT:
1249 case SID_ZOOM_75_PERCENT:
1250 case SID_ZOOM_100_PERCENT:
1251 case SID_ZOOM_150_PERCENT:
1252 case SID_ZOOM_200_PERCENT:
1253 case SID_ZOOM_OPTIMAL:
1254 case SID_ZOOM_ENTIRE_PAGE:
1255 case SID_ZOOM_PAGE_WIDTH:
1262 if ( aState == SfxItemState::DISABLED )
1269 Reference < XDesktop2 > xDesktop = Desktop::create ( ::comphelper::getProcessComponentContext() );
1270 Reference< XFrame >
xFrame = xDesktop->getActiveFrame();
1272 Reference< css::beans::XPropertySet > xPropSet(
xFrame, UNO_QUERY );
1273 Reference< css::frame::XLayoutManager > xLayoutManager;
1274 if ( xPropSet.is() )
1278 Any aValue = xPropSet->getPropertyValue(
"LayoutManager");
1279 aValue >>= xLayoutManager;
1281 catch (
const css::uno::RuntimeException& )
1285 catch ( css::uno::Exception& )
1290 if ( xLayoutManager.is() )
1293 = xLayoutManager->getElement(
"private:resource/menubar/menubar").is()
1294 && xLayoutManager->isElementVisible(
1295 "private:resource/menubar/menubar");
1309 case SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW:
1311 bool bSuccess =
false;
1315 auto& rViewFrame = pViewShell->GetViewFrame();
1316 if (rViewFrame.KnowsChildWindow(nWhich))
1327 case SID_INSPECT_SELECTED_OBJECT:
1329 bool bSuccess =
false;
1333 auto& rViewFrame = pViewShell->GetViewFrame();
1334 if (rViewFrame.KnowsChildWindow(SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW))
1343 case SID_TOOLBAR_LOCK:
1355#if HAVE_FEATURE_SCRIPTING
1357#ifndef DISABLE_DYNLOADING
1359typedef rtl_uString* (*basicide_choose_macro)(
void*,
void*,
void*,
sal_Bool);
1367static OUString
ChooseMacro(
weld::Window* pParent,
const Reference<XModel>& rxLimitToDocument,
const Reference<XFrame>& xDocFrame,
bool bChooseOnly)
1369#ifndef DISABLE_DYNLOADING
1372#define pSymbol basicide_choose_macro
1376 rtl_uString* pScriptURL = pSymbol(pParent, rxLimitToDocument.get(), xDocFrame.get(), bChooseOnly);
1377 OUString aScriptURL( pScriptURL );
1378 rtl_uString_release( pScriptURL );
1381#ifdef DISABLE_DYNLOADING
1390#if HAVE_FEATURE_SCRIPTING
1391 weld::Window* lcl_getDialogParent(
const Reference<XFrame>& rxFrame)
1393 Reference<awt::XWindow> xContainerWindow;
1395 xContainerWindow = rxFrame->getContainerWindow();
1410 Reference< XFrame > lcl_findStartModuleFrame(
const Reference<XComponentContext> & rxContext )
1414 Reference < XDesktop2 > xDesktop = Desktop::create( rxContext );
1415 Reference < XIndexAccess > xContainer( xDesktop->getFrames(), UNO_QUERY_THROW );
1417 Reference< XModuleManager2 > xCheck = ModuleManager::create(rxContext);
1419 sal_Int32
nCount = xContainer->getCount();
1420 for ( sal_Int32 i=0;
i<
nCount; ++
i )
1424 Reference < XFrame >
xFrame( xContainer->getByIndex(i), UNO_QUERY_THROW );
1425 OUString sModule = xCheck->identify( xFrame );
1426 if ( sModule ==
"com.sun.star.frame.StartModule" )
1429 catch(
const UnknownModuleException& )
1433 catch(
const Exception&)
1440 catch(
const Exception& )
1453 case SID_OPTIONS_TREEDIALOG:
1459 Reference <XFrame>
xFrame(GetRequestFrame(rReq));
1463 short nRet = pDlg->Execute();
1480 case SID_MORE_DICTIONARIES:
1483 "AdditionsTag", OUString(
"Dictionary")) };
1487#if HAVE_FEATURE_SCRIPTING
1488 case SID_BASICIDE_APPEAR:
1490 SfxViewFrame* pView = lcl_getBasicIDEViewFrame(
nullptr );
1504 Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
1505 Reference< XSynchronousFrameLoader > xLoader(
1506 xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.comp.office.FrameLoader", xContext),
1510 aLoadArgs.
put(
"URL", OUString(
"private:factory/sbasic" ) );
1512 Reference< XFrame > xTargetFrame( lcl_findStartModuleFrame( xContext ) );
1513 if ( !xTargetFrame.is() )
1515 ENSURE_OR_THROW( xTargetFrame.is(),
"could not obtain a frameto load the Basic IDE into!" );
1524 pView = lcl_getBasicIDEViewFrame( pBasicIDE );
1533 if ( pArgs && pView )
1537 if ( pViewShell && pObjShell )
1549 case SID_BASICCHOOSER:
1553 bool bChooseOnly =
false;
1554 Reference< XModel > xLimitToModel;
1555 if(pArgs && (pItem = pArgs->
GetItemIfSet(SID_RECORDMACRO,
false)) )
1561 bChooseOnly =
false;
1563 OSL_ENSURE( pCurrentShell,
"macro recording outside an SFX document?" );
1564 if ( pCurrentShell )
1565 xLimitToModel = pCurrentShell->
GetModel();
1569 Reference <XFrame>
xFrame(GetRequestFrame(rReq));
1575 case SID_MACROORGANIZER:
1577 SAL_INFO(
"sfx.appl",
"handling SID_MACROORGANIZER");
1579 sal_Int16 nTabId = 0;
1580 Reference <XFrame>
xFrame;
1584 nTabId = pItem->GetValue();
1589 if (pItem->GetValue())
1590 xFrame = GetRequestFrame(rReq);
1601 SAL_INFO(
"sfx.appl",
"SfxApplication::OfaExec_Impl: case ScriptOrg");
1603 Reference <XFrame>
xFrame(GetRequestFrame(rReq));
1607 xFrame = pViewFrame->GetFrame().GetFrameInterface();
1613 OSL_ENSURE( pDlg,
"SfxApplication::OfaExec_Impl( SID_RUNMACRO ): no dialog!" );
1616 pDlg->SetRunLabel();
1618 pDlg->StartExecuteAsync([pDlg,
xFrame](sal_Int32 nDialogResult) {
1619 if ( !nDialogResult )
1621 pDlg->disposeOnce();
1625 Sequence< Any >
args;
1626 Sequence< sal_Int16 > outIndex;
1627 Sequence< Any > outArgs;
1630 Reference< XInterface > xScriptContext;
1637 if ( !xScriptContext.is() )
1641 pDlg->disposeOnce();
1649 case SID_SCRIPTORGANIZER:
1652 SAL_INFO(
"sfx.appl",
"SfxApplication::OfaExec_Impl: case ScriptOrg");
1656 if(pArgs && (pItem = pArgs->
GetItemIfSet(SID_SCRIPTORGANIZER,
false) ))
1661 OUString aLang( aLanguage );
1662 SAL_INFO(
"sfx.appl",
"SfxApplication::OfaExec_Impl: about to create dialog for: " << aLang);
1670 SAL_WARN(
"sfx.appl",
"no dialog!!!");
1677 case SID_OFFICE_CHECK_PLZ:
1686#if HAVE_FEATURE_SCRIPTING
1694 case SID_AUTO_CORRECT_DLG:
1700 if ( pSet && pSet->
GetItemState( SID_AUTO_CORRECT_DLG,
false, &pItem ) == SfxItemState::SET )
1715 VclMessageType::Warning, VclButtonsType::Ok,
1716 SfxResId(STR_MODULENOTINSTALLED)));
1721 Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
1722 Reference< frame::XDispatchProvider > xProv = drawing::ModuleDispatcher::create( xContext );
1725 Reference< frame::XDispatchHelper > xHelper( frame::DispatchHelper::create(xContext) );
1726 Sequence < beans::PropertyValue >
aSeq;
1729 Any aResult = xHelper->executeDispatch( xProv, aCmd, OUString(), 0,
aSeq );
1730 frame::DispatchResultEvent
aEvent;
1731 bool bSuccess = (aResult >>=
aEvent) &&
1732 (
aEvent.State == frame::DispatchResultState::SUCCESS);
1738 case FN_BUSINESS_CARD :
1739 case FN_XFORMS_INIT :
1741 Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
1742 Reference< frame::XDispatchProvider > xProv = text::ModuleDispatcher::create( xContext );
1745 Reference< frame::XDispatchHelper > xHelper( frame::DispatchHelper::create(xContext) );
1746 Sequence < beans::PropertyValue >
aSeq;
1749 Any aResult = xHelper->executeDispatch( xProv, aCmd, OUString(), 0,
aSeq );
1750 frame::DispatchResultEvent
aEvent;
1751 bool bSuccess = (aResult >>=
aEvent) &&
1752 (
aEvent.State == frame::DispatchResultState::SUCCESS);
1757 case SID_ADDRESS_DATA_SOURCE:
1761 Reference< uno::XComponentContext > xORB = ::comphelper::getProcessComponentContext();
1762 Reference< ui::dialogs::XExecutableDialog > xDialog = ui::dialogs::AddressBookSourcePilot::createWithParent(xORB,
nullptr);
1765 catch(
const css::uno::Exception&)
1772 case SID_COMP_BIBLIOGRAPHY:
1773 lcl_tryLoadBibliography();
1791 bool bMacrosDisabled
1792 = officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get();
1793 if (bMacrosDisabled)
static OUString lcl_getAppName(vcl::EnumContext::Application eApp)
static void showDocument(const char *pBaseName)
Displays CREDITS or LICENSE in any of the available version.
static bool checkURL(const char *pName, const char *pExt, OUString &rURL)
Find the correct location of the document (CREDITS.fodt, etc.), and return it in rURL if found.
void TransformItems(sal_uInt16 nSlotId, const SfxItemSet &rSet, uno::Sequence< beans::PropertyValue > &rArgs, const SfxSlot *pSlot)
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
static bool IsSafeModeEnabled()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static sal_uInt16 GetDispatchLevel()
void SetValue(sal_uInt16 nTheValue)
const OUString & GetValue() const
virtual bool Start(const OUString &rHelpId, weld::Widget *pWidget=nullptr)
static bool StartExtHelp()
static void EnableQuickHelp()
static bool IsQuickHelpEnabled()
static void DisableBalloonHelp()
static void EnableBalloonHelp()
static void DisableQuickHelp()
static bool IsBalloonHelpEnabled()
OUString getLanguage() const
const OUString & getBcp47(bool bResolveSystem=true) const
static void SetError(ErrCode)
virtual VclPtr< AbstractScriptSelectorDialog > CreateScriptSelectorDialog(weld::Window *pParent, const css::uno::Reference< css::frame::XFrame > &rxFrame)=0
virtual VclPtr< VclAbstractDialog > CreateWidgetTestDialog(weld::Window *_pParent)=0
virtual VclPtr< VclAbstractDialog > CreateToolbarmodeDialog(weld::Window *_pParent)=0
virtual VclPtr< SfxAbstractTabDialog > CreateAutoCorrTabDialog(weld::Window *pParent, const SfxItemSet *pAttrSet)=0
virtual VclPtr< VclAbstractDialog > CreateAboutDialog(weld::Window *_pParent)=0
virtual VclPtr< VclAbstractDialog > CreateTipOfTheDayDialog(weld::Window *_pParent)=0
virtual VclPtr< VclAbstractDialog > CreateFrameDialog(weld::Window *pParent, const css::uno::Reference< css::frame::XFrame > &rFrame, sal_uInt32 nResId, const OUString &rParameter)=0
virtual VclPtr< SfxAbstractTabDialog > CreateCustomizeTabDialog(weld::Window *pParent, const SfxItemSet *pAttrSet, const css::uno::Reference< css::frame::XFrame > &xViewFrame)=0
static SfxAbstractDialogFactory * Create()
virtual VclPtr< VclAbstractDialog > CreateSvxScriptOrgDialog(weld::Window *pParent, const OUString &rLanguage)=0
std::unique_ptr< SfxAppData_Impl > pImpl
SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &)
virtual void Invalidate(sal_uInt16 nId=0) override
With this method can the slots of the subclasses be invalidated through the slot Id or alternatively ...
static SAL_DLLPRIVATE void OfaState_Impl(SfxItemSet &)
SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &)
static void MacroOrganizer(weld::Window *pParent, const css::uno::Reference< css::frame::XFrame > &xDocFrame, sal_Int16 nTabId)
static void SetOptions(const SfxItemSet &)
SAL_DLLPRIVATE void OfaExec_Impl(SfxRequest &)
void InvalidateAll(bool bWithMsg)
vcl::Window * GetWindow() const
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.
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
static css::uno::Reference< css::frame::XFrame > CreateBlankFrame()
static OUString GetCurrentModuleIdentifier()
const SfxSlot * GetSlot(sal_uInt16 nSlotId) const
const WhichRangesContainer & GetRanges() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
const OUString & GetDocumentServiceName() const
static SfxObjectShell * CreateObject(const OUString &rServiceName, SfxObjectCreateMode=SfxObjectCreateMode::STANDARD)
void SetConfigOptionsChecked(bool bChecked)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
virtual SfxObjectFactory & GetFactory() const =0
ErrCode CallXScript(const OUString &rScriptURL, const css::uno::Sequence< css::uno::Any > &aParams, css::uno::Any &aRet, css::uno::Sequence< sal_Int16 > &aOutParamIndex, css::uno::Sequence< css::uno::Any > &aOutParam, bool bRaiseError=true, const css::uno::Any *aCaller=nullptr)
css::uno::Reference< css::frame::XModel3 > GetModel() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
virtual void SetModified(bool bModified=true)
sal_uInt16 GetSlot() const
SAL_DLLPRIVATE const SfxItemSet * GetInternalArgs_Impl() const
const SfxPoolItem * GetReturnValue() const
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
Templatized access to the individual parameters of the SfxRequest.
void AppendItem(const SfxPoolItem &)
void SetReturnValue(const SfxPoolItem &)
weld::Window * GetFrameWeld() const
Return the window that should be used as the parent for any dialogs this request creates.
void SetArgs(const SfxAllItemSet &rArgs)
void Done(bool bRemove=false)
const OUString & getLanguage() const
SfxItemPool & GetPool() const
Each Subclass of SfxShell must reference a pool.
virtual SfxInterface * GetInterface() const
With this virtual method, which is automatically overridden by each subclass with its own slots throu...
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
This method allows you to forward a <SfxRequest> to the specified base <SfxShell>.
SfxViewShell * GetViewShell() const
Returns the SfxViewShell in which they are located in the subshells.
SfxDispatcher * GetDispatcher() const
This method returns a pointer to the <SfxDispatcher>, when the SfxShell is currently <UI-active> or a...
void SetName(const OUString &rName)
Sets the name of the Shell object.
const OUString & GetUnoName() const
virtual short run() override
const css::uno::Any & GetValue() const
const css::uno::Reference< css::frame::XFrame > & GetFrame() const
void ToggleChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
virtual SfxObjectShell * GetObjectShell() override
void ShowChildWindow(sal_uInt16, bool bVisible=true)
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
SfxViewFrame & GetViewFrame() const
virtual OUString GetColorConfigName() const
Get the color scheme name of this view.
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
void SetType(SvxZoomType eNewType)
static std::shared_ptr< ConfigurationChanges > create()
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
static bool putFlag()
Write a flag file to the user profile indicating that the next launch should be in safe mode.
static void ToggleMenubar()
static OUString getProductVersion()
static OUString getUILocale()
static OUString getAboutBoxProductVersion()
css::uno::Sequence< OUString > getNodeNames() const noexcept
css::uno::Any getNodeValue(const OUString &_rPath) const noexcept
bool setNodeValue(const OUString &_rPath, const css::uno::Any &_rValue) const noexcept
OConfigurationNode openNode(const OUString &_rPath) const noexcept
bool commit() const noexcept
static Application GetApplicationEnum(const OUString &rsApplicationName)
bool IsReallyVisible() const
#define DBG_ASSERT(sCon, aError)
#define ENSURE_OR_THROW(c, m)
#define TOOLS_INFO_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
SAL_DLLPUBLIC_EXPORT rtl_uString * basicide_choose_macro(void *pParent, void *pOnlyInDocument_AsXModel, void *pDocFrame_AsXFrame, sal_Bool bChooseOnly)
OUString ChooseMacro(weld::Window *pParent, const uno::Reference< frame::XModel > &rxLimitToDocument, const uno::Reference< frame::XFrame > &xDocFrame, bool bChooseOnly)
bool getBOOL(const Any &_rAny)
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Reference< XComponentContext > getProcessComponentContext()
OUString getString(const Any &_rAny)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
void openUriExternally(const OUString &sURI, bool bHandleSystemShellExecuteException, weld::Widget *pDialogParent)
Open a URI via com.sun.star.system.SystemShellExecute.
#define ERRCODE_BASIC_WRONG_ARGS
OUString SfxResId(TranslateId aId)
bool empty() const noexcept
Reference< XController > xController
Reference< XFrame > xFrame