20#include <config_features.h>
22#include <boost/property_tree/json_parser.hpp>
34#include <com/sun/star/awt/XPopupMenu.hpp>
35#include <com/sun/star/frame/XLayoutManager.hpp>
36#include <com/sun/star/frame/ModuleManager.hpp>
37#include <com/sun/star/io/IOException.hpp>
38#include <com/sun/star/beans/XPropertySet.hpp>
39#include <com/sun/star/embed/EmbedStates.hpp>
40#include <com/sun/star/embed/EmbedMisc.hpp>
41#include <com/sun/star/embed/XEmbeddedObject.hpp>
42#include <com/sun/star/container/XContainerQuery.hpp>
43#include <com/sun/star/frame/XStorable.hpp>
44#include <com/sun/star/frame/XModel.hpp>
45#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
46#include <com/sun/star/lang/XMultiServiceFactory.hpp>
47#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
48#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
49#include <com/sun/star/view/XRenderable.hpp>
50#include <com/sun/star/uno/Reference.hxx>
51#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
52#include <com/sun/star/accessibility/XAccessibleContext.hpp>
53#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
54#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
55#include <com/sun/star/accessibility/AccessibleEventId.hpp>
56#include <com/sun/star/accessibility/AccessibleStateType.hpp>
57#include <com/sun/star/accessibility/XAccessibleText.hpp>
59#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
63#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
64#include <com/sun/star/accessibility/AccessibleTextType.hpp>
65#include <com/sun/star/awt/FontSlant.hpp>
81#include <LibreOfficeKit/LibreOfficeKitEnums.h>
83#include <officecfg/Setup.hxx>
93#include <sfx2/strings.hrc>
100#include <sfx2/sfxsids.hrc>
107#include <libxml/xmlwriter.h>
109#include <unordered_map>
110#include <unordered_set>
117using namespace ::
cppu;
119#define ShellClass_SfxViewShell
120#include <sfxslots.hxx>
124 datatransfer::clipboard::XClipboardListener >
130 virtual void SAL_CALL
disposing(
const lang::EventObject& rEventObject )
override;
133 virtual void SAL_CALL
changedContents(
const datatransfer::clipboard::ClipboardEvent& rEventObject )
override;
155 uno::Reference< datatransfer::clipboard::XClipboardNotifier >
m_xClpbrdNtfr;
162 : m_pViewShell( nullptr ), m_xClpbrdNtfr(
std::move( xClpbrdNtfr )), m_xCtrl(pView->
GetController())
166 m_xCtrl->addEventListener( uno::Reference < lang::XEventListener > (
static_cast < lang::XEventListener*
>(
this ) ) );
171 m_xClpbrdNtfr->addClipboardListener( uno::Reference< datatransfer::clipboard::XClipboardListener >(
172 static_cast< datatransfer::clipboard::XClipboardListener*
>(
this )));
196 AsyncExecuteInfo* pAsyncExecuteInfo =
static_cast<AsyncExecuteInfo*
>(
p);
197 if ( pAsyncExecuteInfo )
199 if ( pAsyncExecuteInfo->m_xListener.is() )
201 if ( pAsyncExecuteInfo->m_eCmd == ASYNCEXECUTE_CMD_DISPOSING )
202 pAsyncExecuteInfo->m_xListener->DisconnectViewShell();
203 else if ( pAsyncExecuteInfo->m_eCmd == ASYNCEXECUTE_CMD_CHANGEDCONTENTS )
204 pAsyncExecuteInfo->m_xListener->ChangedContents();
207 delete pAsyncExecuteInfo;
213 uno::Reference< lang::XComponent > xCtrl(
m_xCtrl );
214 uno::Reference< datatransfer::clipboard::XClipboardNotifier > xNotify(
m_xClpbrdNtfr );
216 uno::Reference< datatransfer::clipboard::XClipboardListener > xThis(
static_cast< datatransfer::clipboard::XClipboardListener*
>(
this ));
218 xCtrl->removeEventListener( uno::Reference < lang::XEventListener > (
static_cast < lang::XEventListener*
>(
this )));
220 xNotify->removeClipboardListener( xThis );
241 public ::cppu::WeakImplHelper< accessibility::XAccessibleEventListener >
246 std::unordered_set< uno::Reference< uno::XInterface > >
m_aRefList;
262 const uno::Reference< accessibility::XAccessible >& xAccessible
268 const uno::Reference< accessibility::XAccessible >& xAccessible,
269 const uno::Reference< accessibility::XAccessibleContext >& xContext
275 const uno::Reference< accessibility::XAccessible >& xAccessible,
276 const uno::Reference< accessibility::XAccessibleContext >& xContext,
277 const sal_Int64 nStateSet
283 const uno::Reference< accessibility::XAccessible >& xAccessible
289 const uno::Reference< accessibility::XAccessibleContext >& xContext
295 const uno::Reference< accessibility::XAccessibleContext >& xContext,
296 const sal_Int64 nStateSet
301 static uno::Reference< accessibility::XAccessible >
getAccessible(
const lang::EventObject& aEvent );
304 virtual void SAL_CALL
disposing(
const lang::EventObject& Source )
override;
307 virtual void SAL_CALL
notifyEvent(
const accessibility::AccessibleEventObject& aEvent )
override;
318 : m_pViewShell(pViewShell)
319 , m_bFocusedParagraphNotified(false)
320 , m_nCaretPosition(0)
321 , m_nSelectionStart(0)
323 , m_bIsEditingCell(false)
334 if (nSelectionStart < 0 || nSelectionEnd < 0)
337 boost::property_tree::ptree aPayloadTree;
339 aPayloadTree.put(
"start", nSelectionStart);
340 aPayloadTree.put(
"end", nSelectionEnd);
341 std::stringstream aStream;
342 boost::property_tree::write_json(aStream, aPayloadTree);
343 std::string aPayload = aStream.str();
344 OUString sRet = OUString::fromUtf8(aPayload);
356 boost::property_tree::ptree aPayloadTree;
359 std::stringstream aStream;
360 boost::property_tree::write_json(aStream, aPayloadTree);
361 std::string aPayload = aStream.str();
366 const char* pPayload = aPayload.c_str();
373 boost::property_tree::ptree aPayloadTree;
375 std::stringstream aStream;
376 boost::property_tree::write_json(aStream, aPayloadTree);
377 std::string aPayload = aStream.str();
381 const char* pPayload = aPayload.c_str();
388 boost::property_tree::ptree aPayloadTree;
391 std::stringstream aStream;
392 boost::property_tree::write_json(aStream, aPayloadTree);
393 std::string aPayload = aStream.str();
397 const char* pPayload = aPayload.c_str();
413bool hasState(
const accessibility::AccessibleEventObject& aEvent, ::sal_Int64 nState)
416 uno::Reference< accessibility::XAccessibleContext > xContext(
aEvent.Source, uno::UNO_QUERY);
419 ::sal_Int64 nStateSet = xContext->getAccessibleStateSet();
420 res = (nStateSet &
nState) != 0;
425bool isFocused(
const accessibility::AccessibleEventObject& aEvent)
427 return hasState(aEvent, accessibility::AccessibleStateType::FOCUSED);
437 case accessibility::AccessibleEventId::STATE_CHANGED:
440 sal_Int64
nState = accessibility::AccessibleStateType::INVALID;
442 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: STATE_CHANGED: XAccessible: " << xAccStateChanged.get() <<
", nState: " <<
nState);
444 if( accessibility::AccessibleStateType::FOCUSED ==
nState )
446 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: FOCUSED");
450 if (!hasState(
aEvent, accessibility::AccessibleStateType::ACTIVE))
453 "LOKDocumentFocusListener::notifyEvent: FOCUSED: Cell not ACTIVE for editing yet");
457 uno::Reference<css::accessibility::XAccessibleText> xAccText(xAccStateChanged, uno::UNO_QUERY);
460 OUString sText = xAccText->getText();
461 sal_Int32
nLength = sText.getLength();
462 sal_Int32 nCaretPosition = xAccText->getCaretPosition();
463 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: xAccText: " << xAccText.get()
464 <<
", text: >" << sText <<
"<, caret pos: " << nCaretPosition);
468 css::uno::Reference<css::accessibility::XAccessibleTextAttributes>
469 xAccTextAttr(xAccText, uno::UNO_QUERY);
470 css::uno::Sequence< OUString > aRequestedAttributes;
475 css::accessibility::TextSegment aTextSegment =
476 xAccText->getTextAtIndex(
nPos, css::accessibility::AccessibleTextType::ATTRIBUTE_RUN);
477 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: "
478 "text segment: '" << aTextSegment.SegmentText
479 <<
"', start: " << aTextSegment.SegmentStart
480 <<
", end: " << aTextSegment.SegmentEnd);
482 css::uno::Sequence< css::beans::PropertyValue > aRunAttributeList;
483 if (xAccTextAttr.is())
485 aRunAttributeList = xAccTextAttr->getRunAttributes(
nPos, aRequestedAttributes);
489 aRunAttributeList = xAccText->getCharacterAttributes(
nPos, aRequestedAttributes);
492 sal_Int32 nSize = aRunAttributeList.getLength();
494 "LOKDocumentFocusListener::notifyEvent: attribute list size: " << nSize);
498 OUString sAttributes =
"{ ";
499 for (
const auto&
attribute: aRunAttributeList)
508 sValue = OUString::number(fValue);
510 else if (
attribute.Name ==
"CharPosture")
514 sValue = OUString::number(
static_cast<unsigned int>(
nValue));
516 else if (
attribute.Name ==
"CharUnderline")
520 sValue = OUString::number(
nValue);
522 else if (
attribute.Name ==
"CharFontName")
530 sValue = OUString::number(
nValue);
533 if (!sValue.isEmpty())
535 if (sAttributes !=
"{ ")
537 sAttributes +=
attribute.Name +
": " + sValue;
543 "LOKDocumentFocusListener::notifyEvent: attributes: " << sAttributes);
545 nPos = aTextSegment.SegmentEnd + 1;
560 case accessibility::AccessibleEventId::CARET_CHANGED:
565 "LOKDocumentFocusListener::notifyEvent: CARET_CHANGED: skip non focused paragraph");
569 sal_Int32 nNewPos = -1;
570 aEvent.NewValue >>= nNewPos;
571 sal_Int32 nOldPos = -1;
572 aEvent.OldValue >>= nOldPos;
576 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: CARET_CHANGED: new pos: " << nNewPos <<
", nOldPos: " << nOldPos);
577 uno::Reference<css::accessibility::XAccessibleText>
581 OUString sText = xAccText->getText();
582 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: CARET_CHANGED: xAccText: " << xAccText.get() <<
", text: >" << sText <<
"<");
593 case accessibility::AccessibleEventId::TEXT_CHANGED:
598 "LOKDocumentFocusListener::notifyEvent: TEXT_CHANGED: skip non focused paragraph");
602 accessibility::TextSegment aDeletedText;
603 accessibility::TextSegment aInsertedText;
605 if (
aEvent.OldValue >>= aDeletedText)
607 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: TEXT_CHANGED: deleted text: >" << aDeletedText.SegmentText <<
"<");
609 if (
aEvent.NewValue >>= aInsertedText)
611 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: TEXT_CHANGED: inserted text: >" << aInsertedText.SegmentText <<
"<");
613 uno::Reference<css::accessibility::XAccessibleText> xAccText(
getAccessible(
aEvent), uno::UNO_QUERY);
616 OUString sText = xAccText->getText();
617 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: TEXT_CHANGED: "
618 "xAccText: " << xAccText.get() <<
", text: >" << sText <<
"<");
625 case accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED:
630 "LOKDocumentFocusListener::notifyEvent: TEXT_SELECTION_CHANGED: skip non focused paragraph");
634 uno::Reference<css::accessibility::XAccessibleText> xAccText(
getAccessible(
aEvent), uno::UNO_QUERY);
637 OUString sText = xAccText->getText();
638 sal_Int32 nSelectionStart = xAccText->getSelectionStart();
639 sal_Int32 nSelectionEnd = xAccText->getSelectionEnd();
642 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: TEXT_SELECTION_CHANGED: "
643 "\n xAccText: " << xAccText.get() <<
", text: >" << sText <<
"<"
644 "\n start: " << nSelectionStart <<
", end: " << nSelectionEnd
669 case accessibility::AccessibleEventId::SELECTION_CHANGED:
671 uno::Reference< accessibility::XAccessible > xNewValue;
672 aEvent.NewValue >>= xNewValue;
675 uno::Reference< accessibility::XAccessibleContext > xContext =
676 xNewValue->getAccessibleContext();
680 OUString
sName = xContext->getAccessibleName();
681 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: SELECTION_CHANGED: this: " <<
this
682 <<
", selected cell address: >" <<
sName <<
"<"
692 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::notifyEvent: SELECTION_CHANGED: "
693 "cell address: >" << sCellAddress <<
"<");
704 case accessibility::AccessibleEventId::CHILD:
706 uno::Reference< accessibility::XAccessible > xChild;
707 if( (
aEvent.OldValue >>= xChild) && xChild.is() )
710 if( (
aEvent.NewValue >>= xChild) && xChild.is() )
716 case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN:
717 SAL_INFO(
"lok.a11y",
"Invalidate all children called");
724 catch(
const lang::IndexOutOfBoundsException& )
726 SAL_WARN(
"lok.a11y",
"Focused object has invalid index in parent");
732 uno::Reference< accessibility::XAccessible > xAccessible(
aEvent.Source, uno::UNO_QUERY);
734 if( xAccessible.is() )
737 uno::Reference< accessibility::XAccessibleContext > xContext(
aEvent.Source, uno::UNO_QUERY);
741 uno::Reference< accessibility::XAccessible > xParent( xContext->getAccessibleParent() );
744 uno::Reference< accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
745 if( xParentContext.is() )
747 return xParentContext->getAccessibleChild( xContext->getAccessibleIndexInParent() );
752 return uno::Reference< accessibility::XAccessible >();
756 const uno::Reference< accessibility::XAccessible >& xAccessible
759 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::attachRecursive(1): xAccessible: " << xAccessible.get());
761 uno::Reference< accessibility::XAccessibleContext > xContext =
762 xAccessible->getAccessibleContext();
769 const uno::Reference< accessibility::XAccessible >& xAccessible,
770 const uno::Reference< accessibility::XAccessibleContext >& xContext
773 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::attachRecursive(2): xAccessible: " << xAccessible.get()
774 <<
", role: " << xContext->getAccessibleRole()
775 <<
", name: " << xContext->getAccessibleName()
776 <<
", parent: " << xContext->getAccessibleParent().get()
777 <<
", child count: " << xContext->getAccessibleChildCount());
779 sal_Int64 nStateSet = xContext->getAccessibleStateSet();
783 ::rtl::OUString
sName = xContext->getAccessibleName();
791 const uno::Reference< accessibility::XAccessible >& xAccessible,
792 const uno::Reference< accessibility::XAccessibleContext >& xContext,
793 const sal_Int64 nStateSet
796 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::attachRecursive(3) #1: this: " <<
this
797 <<
", xAccessible: " << xAccessible.get()
798 <<
", role: " << xContext->getAccessibleRole()
799 <<
", name: " << xContext->getAccessibleName()
800 <<
", parent: " << xContext->getAccessibleParent().get()
801 <<
", child count: " << xContext->getAccessibleChildCount());
803 uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster(xContext, uno::UNO_QUERY);
805 if (!xBroadcaster.is())
807 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::attachRecursive(3) #2: xBroadcaster.is()");
809 const uno::Reference< uno::XInterface >& xInterface = xBroadcaster;
812 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::attachRecursive(3) #3: m_aRefList.insert(xInterface).second");
813 xBroadcaster->addAccessibleEventListener(
static_cast< accessibility::XAccessibleEventListener *
>(
this));
816 if( !(nStateSet & accessibility::AccessibleStateType::MANAGES_DESCENDANTS) )
818 sal_Int64 nmax = xContext->getAccessibleChildCount();
822 for( sal_Int64
n = 0;
n < nmax;
n++ )
824 uno::Reference< accessibility::XAccessible > xChild( xContext->getAccessibleChild(
n ) );
834 const uno::Reference< accessibility::XAccessible >& xAccessible
837 uno::Reference< accessibility::XAccessibleContext > xContext =
838 xAccessible->getAccessibleContext();
845 const uno::Reference< accessibility::XAccessibleContext >& xContext
848 sal_Int64 nStateSet = xContext->getAccessibleStateSet();
850 SAL_INFO(
"lok.a11y",
"LOKDocumentFocusListener::detachRecursive(2): this: " <<
this
851 <<
", name: " << xContext->getAccessibleName()
852 <<
", parent: " << xContext->getAccessibleParent().get()
853 <<
", child count: " << xContext->getAccessibleChildCount());
857 ::rtl::OUString
sName = xContext->getAccessibleName();
871 const uno::Reference< accessibility::XAccessibleContext >& xContext,
872 const sal_Int64 nStateSet
875 uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster(xContext, uno::UNO_QUERY);
877 if( xBroadcaster.is() && 0 <
m_aRefList.erase(xBroadcaster) )
879 xBroadcaster->removeAccessibleEventListener(
static_cast< accessibility::XAccessibleEventListener *
>(
this));
881 if( !( nStateSet & accessibility::AccessibleStateType::MANAGES_DESCENDANTS ) )
883 sal_Int64 nmax = xContext->getAccessibleChildCount();
887 for( sal_Int64
n = 0;
n < nmax;
n++ )
889 uno::Reference< accessibility::XAccessible > xChild( xContext->getAccessibleChild(
n ) );
903, m_pLibreOfficeKitViewCallback(nullptr)
904, m_bTiledSearching(false)
929 const css::uno::Reference< css::container::XContainerQuery >& rContainerQuery,
930 const OUString& rType,
931 const OUString& rModuleIdentifier,
932 const sal_Int32 nFlags )
935 css::uno::Sequence< css::beans::NamedValue > aQuery {
936 {
"Type", css::uno::Any( rType ) },
937 {
"DocumentService", css::uno::Any( rModuleIdentifier ) }
940 css::uno::Reference< css::container::XEnumeration > xEnumeration =
941 rContainerQuery->createSubSetEnumerationByProperties( aQuery );
943 OUString aFoundFilterName;
944 while ( xEnumeration->hasMoreElements() )
955 if ( nFilterFlags & nFlags )
957 aFoundFilterName = aFilterName;
962 return aFoundFilterName;
979 ETypeFamily eTypeFamily)
983 css::uno::Reference< css::uno::XComponentContext > xContext (::comphelper::getProcessComponentContext());
984 css::uno::Reference< css::frame::XModuleManager2 > xModuleManager(css::frame::ModuleManager::create(xContext));
986 OUString sModule = xModuleManager->identify(
xFrame);
993 if ( sModule ==
"com.sun.star.text.TextDocument" )
994 sType =
"writer_MS_Word_2007";
996 if ( sModule ==
"com.sun.star.sheet.SpreadsheetDocument" )
997 sType =
"MS Excel 2007 XML";
999 if ( sModule ==
"com.sun.star.presentation.PresentationDocument" )
1000 sType =
"MS PowerPoint 2007 XML";
1006 if ( sModule ==
"com.sun.star.text.TextDocument" )
1009 if ( sModule ==
"com.sun.star.sheet.SpreadsheetDocument" )
1012 if ( sModule ==
"com.sun.star.drawing.DrawingDocument" )
1015 if ( sModule ==
"com.sun.star.presentation.PresentationDocument" )
1023 catch (
const css::uno::RuntimeException&)
1027 catch (
const css::uno::Exception&)
1036 pImpl->GetIPClients_Impl().push_back(pIPClient);
1041 std::vector< SfxInPlaceClient* >& pClients =
pImpl->GetIPClients_Impl();
1043 auto it = std::find(pClients.begin(), pClients.end(), pIPClient);
1044 if (it != pClients.end())
1045 pClients.erase( it );
1054 case SID_STYLE_FAMILY :
1063 case SID_ACTIVATE_STYLE_APPLY:
1065 uno::Reference< frame::XFrame >
xFrame =
1068 Reference< beans::XPropertySet > xPropSet(
xFrame, UNO_QUERY );
1069 Reference< frame::XLayoutManager > xLayoutManager;
1070 if ( xPropSet.is() )
1074 Any aValue = xPropSet->getPropertyValue(
"LayoutManager");
1075 aValue >>= xLayoutManager;
1076 if ( xLayoutManager.is() )
1078 uno::Reference< ui::XUIElement > xElement = xLayoutManager->getElement(
"private:resource/toolbar/textobjectbar" );
1081 xElement = xLayoutManager->getElement(
"private:resource/toolbar/frameobjectbar" );
1085 xElement = xLayoutManager->getElement(
"private:resource/toolbar/oleobjectbar" );
1089 uno::Reference< awt::XWindow > xWin( xElement->getRealInterface(), uno::UNO_QUERY_THROW );
1094 ToolBox::ImplToolItems::size_type nItemCount = pTextToolbox->
GetItemCount();
1095 for( ToolBox::ImplToolItems::size_type nItem = 0; nItem < nItemCount; ++nItem )
1098 const OUString& rCommand = pTextToolbox->
GetItemCommand( nItemId );
1099 if (rCommand ==
".uno:StyleApply")
1119 case SID_MAIL_SENDDOCASMS:
1120 case SID_MAIL_SENDDOCASOOO:
1121 case SID_MAIL_SENDDOCASPDF:
1122 case SID_MAIL_SENDDOC:
1123 case SID_MAIL_SENDDOCASFORMAT:
1135 if ( pMailRecipient )
1137 OUString aRecipient( pMailRecipient->
GetValue() );
1138 OUString aMailToStr(
"mailto:");
1140 if ( aRecipient.startsWith( aMailToStr ) )
1141 aRecipient = aRecipient.copy( aMailToStr.getLength() );
1146 aDocType = pMailDocType->
GetValue();
1151 if (
nId == SID_MAIL_SENDDOC )
1153 else if (
nId == SID_MAIL_SENDDOCASPDF )
1155 else if (
nId == SID_MAIL_SENDDOCASMS )
1158 if (!aDocType.isEmpty())
1161 else if (
nId == SID_MAIL_SENDDOCASOOO )
1164 if (!aDocType.isEmpty())
1172 VclMessageType::Info, VclButtonsType::Ok,
1182 case SID_BLUETOOTH_SENDDOC:
1195 VclMessageType::Info, VclButtonsType::Ok,
1208 css::uno::Reference< lang::XMultiServiceFactory > xSMGR(::comphelper::getProcessServiceFactory(), css::uno::UNO_SET_THROW);
1209 css::uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext(), css::uno::UNO_SET_THROW);
1211 css::uno::Reference< css::frame::XModel >
xModel;
1213 css::uno::Reference< css::frame::XModuleManager2 > xModuleManager( css::frame::ModuleManager::create(xContext) );
1218 aModule = xModuleManager->identify(
xFrame );
1220 catch (
const css::uno::RuntimeException&)
1224 catch (
const css::uno::Exception&)
1230 css::uno::Reference< css::frame::XController >
xController =
xFrame->getController();
1236 css::uno::Reference< css::frame::XStorable > xStorable(
xModel, css::uno::UNO_QUERY );
1237 if (
xModel.is() && xStorable.is() )
1239 OUString aFilterName;
1240 OUString aTypeName(
"generic_HTML" );
1243 OUString aLocation = xStorable->getLocation();
1246 bool bPrivateProtocol = ( aFileObj.
GetProtocol() == INetProtocol::PrivSoffice );
1247 bool bHasLocation = !aLocation.isEmpty() && !bPrivateProtocol;
1249 css::uno::Reference< css::container::XContainerQuery > xContainerQuery(
1250 xSMGR->createInstance(
"com.sun.star.document.FilterFactory" ),
1251 css::uno::UNO_QUERY_THROW );
1255 sal_Int32 nFilterFlags = 0x00000002;
1257 if ( aFilterName.isEmpty() )
1261 xContainerQuery,
"graphic_HTML", aModule, nFilterFlags );
1266 if ( aFilterName.isEmpty() || aTypeName.isEmpty())
1273 if ( !bHasLocation )
1276 aFileName =
"webpreview";
1285 OSL_ASSERT( !aFilterName.isEmpty() );
1286 OSL_ASSERT( !aFileName.isEmpty() );
1291 OUString * parent =
nullptr;
1294 SAL_WARN(
"sfx.view",
"cannot create Flatpak html temp dir");
1297 INetURLObject aFilePathObj( ::utl::CreateTempURL(parent,
true) );
1303 css::uno::Sequence< css::beans::PropertyValue > aArgs{
1310 xStorable->storeToURL( aFileURL, aArgs );
1312 catch (
const io::IOException&)
1342 case SID_BLUETOOTH_SENDDOC:
1343 case SID_MAIL_SENDDOC:
1344 case SID_MAIL_SENDDOCASFORMAT:
1345 case SID_MAIL_SENDDOCASMS:
1346 case SID_MAIL_SENDDOCASOOO:
1347 case SID_MAIL_SENDDOCASPDF:
1349#if HAVE_FEATURE_MACOSX_SANDBOX
1364 case SID_PRINTDOCDIRECT:
1365 case SID_SETUPPRINTER:
1366 case SID_PRINTER_NAME:
1377 if ( SID_PRINTDOCDIRECT == nSID )
1379 OUString aPrinterName;
1380 if ( pPrinter !=
nullptr )
1381 aPrinterName = pPrinter->
GetName();
1391 std::chrono::steady_clock::time_point
now = std::chrono::steady_clock::now();
1392 std::chrono::minutes five_mins(5);
1393 if (
now >
pImpl->m_nDefaultPrinterNameFetchTime + five_mins)
1396 pImpl->m_nDefaultPrinterNameFetchTime =
now;
1398 aPrinterName =
pImpl->m_sDefaultPrinterName;
1400 if ( !aPrinterName.isEmpty() )
1407 " (" + aPrinterName +
")";
1414 case SID_STYLE_FAMILY :
1428 aMap.SetScaleX( rZoomX );
1429 aMap.SetScaleY( rZoomY );
1455 uno::Reference < frame::XFramesSupplier > xParentFrame = xOwnFrame->getCreator();
1456 if ( xParentFrame.is() )
1457 xParentFrame->setActiveFrame( xOwnFrame );
1474 const uno::Reference < embed::XEmbeddedObject >& xObj,
1478 std::vector< SfxInPlaceClient* >& rClients =
pImpl->GetIPClients_Impl();
1479 if ( rClients.empty() )
1482 if( !pObjParentWin )
1486 if ( pIPClient->GetObject() == xObj && pIPClient->GetEditWin() == pObjParentWin )
1503 std::vector< SfxInPlaceClient* >& rClients =
pImpl->GetIPClients_Impl();
1504 if ( rClients.empty() )
1509 if ( pIPClient->IsUIActive() )
1518 std::vector< SfxInPlaceClient* >& rClients =
pImpl->GetIPClients_Impl();
1519 if ( rClients.empty() )
1526 if ( pIPClient->IsObjectUIActive() || ( bIsTiledRendering && pIPClient->IsObjectInPlaceActive() ) )
1674 if (
pImpl->m_pController.is())
1676 pImpl->m_pController->BorderWidthsChanged_Impl();
1685 if (
pImpl->m_pController.is())
1687 pImpl->m_pController->BorderWidthsChanged_Impl();
1747, mbPrinterSettingsModified(false)
1751, mbLOKAccessibilityEnabled(false)
1760 rViewArr.push_back(
this);
1784 auto it = std::find( rViewArr.begin(), rViewArr.end(), pThis );
1785 rViewArr.erase( it );
1787 if (
pImpl->xClipboardListener.is() )
1789 pImpl->xClipboardListener->DisconnectViewShell();
1790 pImpl->xClipboardListener =
nullptr;
1793 if (
pImpl->m_pController.is())
1795 pImpl->m_pController->ReleaseShell_Impl();
1796 pImpl->m_pController.clear();
1830 VclMessageType::Info, VclButtonsType::Ok,
1857 if ( !i_rController.is() )
1865 if ( pViewShell->GetController() == i_rController )
1932 pImpl->aArr.push_back(&rShell);
1936 pDisp->
Push(rShell);
1953 pImpl->aArr.clear();
1957 SfxShellArr_Impl::iterator
i = std::find(
pImpl->aArr.begin(),
pImpl->aArr.end(), pShell);
1958 if(
i !=
pImpl->aArr.end())
1983 for (
auto const& elem :
pImpl->aArr)
1986 else if(!
pImpl->aArr.empty())
2019 const std::function<
bool (
const SfxViewShell* ) >& isViewShell
2035 &pShell->GetViewFrame()) !=
SfxGetpApp()->GetViewFrames_Impl().
end());
2036 if ( ( !bOnlyVisible || pShell->GetViewFrame().IsVisible() ) && (!isViewShell || isViewShell(pShell)))
2049 const std::function<
bool (
const SfxViewShell* )>& isViewShell
2055 if ( rShells[
nPos] == &rPrev )
2065 if ( ( !bOnlyVisible || pShell->
GetViewFrame().
IsVisible() ) && (!isViewShell || isViewShell(pShell)) )
2104 bool setModuleConfig =
false;
2105 if (!
pImpl->m_xAccExec)
2108 pImpl->m_xAccExec->init(::comphelper::getProcessComponentContext(),
2110 setModuleConfig =
true;
2116 css::uno::Reference< css::uno::XComponentContext > xContext (::comphelper::getProcessComponentContext());
2117 css::uno::Reference< css::frame::XModuleManager2 > xModuleManager(css::frame::ModuleManager::create(xContext));
2124 OUString key = sModule + viewLang;
2128 if (acceleratorConfs.find(key) == acceleratorConfs.end())
2132 OUString actualLang = officecfg::Setup::L10N::ooLocale::get();
2135 officecfg::Setup::L10N::ooLocale::set(viewLang, batch);
2142 officecfg::Setup::L10N::ooLocale::set(actualLang, batch2);
2146 if (setModuleConfig)
2147 pImpl->m_xAccExec->lok_setModuleConfig(acceleratorConfs[key]);
2155 pImpl->m_pLibreOfficeKitViewCallback = pCallback;
2159 if (!
pImpl->m_pLibreOfficeKitViewCallback)
2174 return pImpl->m_pLibreOfficeKitViewCallback;
2179 if (
pImpl->m_pLibreOfficeKitViewCallback)
2180 pImpl->m_pLibreOfficeKitViewCallback->dumpState(rState);
2192 case LOK_CALLBACK_FORM_FIELD_BUTTON:
2193 case LOK_CALLBACK_TEXT_SELECTION:
2194 case LOK_CALLBACK_COMMENT:
2206 case LOK_CALLBACK_TEXT_SELECTION:
2207 case LOK_CALLBACK_TEXT_VIEW_SELECTION:
2208 case LOK_CALLBACK_TEXT_SELECTION_START:
2209 case LOK_CALLBACK_TEXT_SELECTION_END:
2210 case LOK_CALLBACK_GRAPHIC_SELECTION:
2211 case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
2223 if (
pImpl->m_pLibreOfficeKitViewCallback)
2224 pImpl->m_pLibreOfficeKitViewCallback->libreOfficeKitViewInvalidateTilesCallback(pRect, nPart, nMode);
2228 "SfxViewShell::libreOfficeKitViewInvalidateTilesCallback no callback set!");
2235 if (
pImpl->m_pLibreOfficeKitViewCallback)
2236 pImpl->m_pLibreOfficeKitViewCallback->libreOfficeKitViewCallbackWithViewId(
nType, pPayload, nViewId);
2240 "SfxViewShell::libreOfficeKitViewCallbackWithViewId no callback set! Dropped payload of type "
2241 << lokCallbackTypeToString(
nType) <<
": [" << pPayload <<
']');
2248 if (
pImpl->m_pLibreOfficeKitViewCallback)
2249 pImpl->m_pLibreOfficeKitViewCallback->libreOfficeKitViewCallback(
nType, pPayload);
2253 "SfxViewShell::libreOfficeKitViewCallback no callback set! Dropped payload of type "
2254 << lokCallbackTypeToString(
nType) <<
": [" << pPayload <<
']');
2261 if (
pImpl->m_pLibreOfficeKitViewCallback)
2262 pImpl->m_pLibreOfficeKitViewCallback->libreOfficeKitViewUpdatedCallback(
nType);
2266 "SfxViewShell::libreOfficeKitViewUpdatedCallback no callback set! Dropped payload of type "
2267 << lokCallbackTypeToString(
nType));
2274 if (
pImpl->m_pLibreOfficeKitViewCallback)
2275 pImpl->m_pLibreOfficeKitViewCallback->libreOfficeKitViewUpdatedCallbackPerViewId(
nType, nViewId, nSourceViewId);
2279 "SfxViewShell::libreOfficeKitViewUpdatedCallbackPerViewId no callback set! Dropped payload of type "
2280 << lokCallbackTypeToString(
nType));
2285 if (
pImpl->m_pLibreOfficeKitViewCallback)
2286 pImpl->m_pLibreOfficeKitViewCallback->libreOfficeKitViewAddPendingInvalidateTiles();
2290 "SfxViewShell::libreOfficeKitViewAddPendingInvalidateTiles no callback set!");
2305 SAL_WARN(
"sfx.view",
"SfxViewShell::getLOKPayload unhandled type " << lokCallbackTypeToString(
nType));
2322 SAL_WARN(
"sfx.view",
"SfxViewShell::GetColorConfigColor not overridden!");
2328 SAL_WARN(
"sfx.view",
"SfxViewShell::GetColorConfigName not overridden!");
2336 css::uno::Sequence<OUString> inst(officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
2372 uno::Reference< accessibility::XAccessible > xAccessible =
2375 if (!xAccessible.is())
2384 catch (
const uno::Exception&)
2386 SAL_WARN(
"lok.a11y",
"Exception caught processing LOKDocumentFocusListener::attachRecursive");
2395 catch (
const uno::Exception&)
2397 SAL_WARN(
"lok.a11y",
"Exception caught processing LOKDocumentFocusListener::detachRecursive");
2413 pImpl->m_bTiledSearching = bTiledSearching;
2428 return pImpl->m_nViewShellId;
2438 assert(
pImpl->m_nDocId >=
ViewShellDocId(0) &&
"m_nDocId should have been initialized, but it is invalid.");
2439 return pImpl->m_nDocId;
2454 auto pOtherShell =
dynamic_cast<SfxViewShell*
>(pOther);
2463 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SfxViewShell"));
2464 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
2465 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"id"), BAD_CAST(OString::number(
static_cast<sal_Int32
>(
GetViewShellId())).getStr()));
2466 (void)xmlTextWriterEndElement(pWriter);
2516 std::vector< SfxInPlaceClient* >& rClients =
pImpl->GetIPClients_Impl();
2517 if ( rClients.empty() )
2522 if( pIPClient != pIP )
2523 pIPClient->ResetObject();
2530 std::vector< SfxInPlaceClient* >& rClients =
pImpl->GetIPClients_Impl();
2531 if ( rClients.empty() )
2534 for (
size_t n = 0;
n < rClients.size(); )
2536 delete rClients.at(
n );
2547 std::vector< SfxInPlaceClient* >& rClients =
pImpl->GetIPClients_Impl();
2548 if ( rClients.empty() )
2553 if ( pIPClient->IsObjectInPlaceActive() )
2555 pIPClient->VisAreaChanged();
2566 bool bAlwaysActive =
2567 ( ( pIPClient->
GetObjectMiscStatus() & embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY ) != 0 );
2568 bool bActiveWhenVisible =
2569 ( pIPClient->
GetObjectMiscStatus() & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE ) != 0;
2578 if (bAlwaysActive || (bActiveWhenVisible && rVisArea.
Overlaps(pIPClient->
GetObjArea())))
2582 pIPClient->
GetObject()->changeState( embed::EmbedStates::INPLACE_ACTIVE );
2584 catch (
const uno::Exception&)
2598 Reference< XModel > xDocument;
2601 OSL_ENSURE( pDocShell,
"SfxViewFrame::GetCurrentDocument: no DocShell!?" );
2611 if ( xDocument.is() )
2618 return pImpl->aMargin;
2625 Size aMargin = rSize;
2626 if ( aMargin.
Width() == -1 )
2628 if ( aMargin.
Height() == -1 )
2631 if ( aMargin !=
pImpl->aMargin )
2633 pImpl->aMargin = aMargin;
2653 pImpl->m_pController = pController;
2656 if (
pImpl->xClipboardListener.is() )
2657 pImpl->xClipboardListener->DisconnectViewShell();
2664 return pImpl->m_pController;
2669 return pImpl->m_pController.get();
2674 std::unique_lock g(
pImpl->aMutex);
2675 pImpl->aInterceptorContainer.addInterface( g, xInterceptor );
2680 std::unique_lock g(
pImpl->aMutex);
2681 pImpl->aInterceptorContainer.removeInterface( g, xInterceptor );
2685 const OUString& rMenuIdentifier,
2687 ui::ContextMenuExecuteEvent aEvent)
2690 bool bModified =
false;
2694 rIn, &rMenuIdentifier);
2700 std::unique_lock g(
pImpl->aMutex);
2701 std::vector<uno::Reference< ui::XContextMenuInterceptor>> aInterceptors =
2702 pImpl->aInterceptorContainer.getElements(g);
2704 for (
const auto & rListener : aInterceptors )
2708 ui::ContextMenuInterceptorAction eAction;
2711 eAction = rListener->notifyContextMenuExecute( aEvent );
2715 case ui::ContextMenuInterceptorAction_CANCELLED :
2718 case ui::ContextMenuInterceptorAction_EXECUTE_MODIFIED :
2722 case ui::ContextMenuInterceptorAction_CONTINUE_MODIFIED :
2726 case ui::ContextMenuInterceptorAction_IGNORED :
2730 OSL_FAIL(
"Wrong return value of ContextMenuInterceptor!");
2737 pImpl->aInterceptorContainer.removeInterface(g, rListener);
2755 const OUString& rMenuIdentifier, css::ui::ContextMenuExecuteEvent aEvent)
2757 bool bModified =
false;
2761 rPopupMenu, &rMenuIdentifier);
2764 aEvent.Selection = css::uno::Reference< css::view::XSelectionSupplier >(
GetController(), css::uno::UNO_QUERY );
2767 std::unique_lock g(
pImpl->aMutex);
2768 std::vector<uno::Reference< ui::XContextMenuInterceptor>> aInterceptors =
2769 pImpl->aInterceptorContainer.getElements(g);
2771 for (
const auto & rListener : aInterceptors )
2775 css::ui::ContextMenuInterceptorAction eAction;
2778 eAction = rListener->notifyContextMenuExecute(
aEvent );
2782 case css::ui::ContextMenuInterceptorAction_CANCELLED:
2785 case css::ui::ContextMenuInterceptorAction_EXECUTE_MODIFIED:
2789 case css::ui::ContextMenuInterceptorAction_CONTINUE_MODIFIED:
2793 case css::ui::ContextMenuInterceptorAction_IGNORED:
2797 SAL_WARN(
"sfx.view",
"Wrong return value of ContextMenuInterceptor!" );
2804 pImpl->aInterceptorContainer.removeInterface(g, rListener);
2813 rPopupMenu->clear();
2822 if (
pImpl->m_pController.is())
2823 return pImpl->m_pController->HandleEvent_Impl( rEvent );
2829 return (
pImpl->m_pController.is())
2830 &&
pImpl->m_pController->HasKeyListeners_Impl();
2835 return (
pImpl->m_pController.is())
2836 &&
pImpl->m_pController->HasMouseClickListeners_Impl();
2852 xRender.set(
xModel, UNO_QUERY );
2864 uno::Reference< datatransfer::clipboard::XClipboardNotifier > xClipboardNotifier;
2866 return xClipboardNotifier;
2873 uno::Reference< datatransfer::clipboard::XClipboard > xClipboard(
GetViewFrame().
GetWindow().GetClipboard());
2874 if( xClipboard.is() )
2876 uno::Reference< datatransfer::clipboard::XClipboardNotifier > xClpbrdNtfr( xClipboard, uno::UNO_QUERY );
2877 if( xClpbrdNtfr.is() )
2880 xClpbrdNtfr->addClipboardListener( rClp );
2882 xClpbrdNtfr->removeClipboardListener( rClp );
2886 catch (
const uno::Exception&)
2901 OUString BlockedListString(blockedCommandList, strlen(blockedCommandList), RTL_TEXTENCODING_UTF8);
2902 OUString command = BlockedListString.getToken(0,
' ');
2903 for (
size_t i = 1; !command.isEmpty();
i++)
2906 command = BlockedListString.getToken(
i,
' ');
PropertiesInfo aProperties
SfxApplication * SfxGetpApp()
static const AllSettings & GetSettings()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
sal_uInt16 GetValue() const
const OUString & GetValue() const
OUString getName(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool insertName(std::u16string_view rTheName, bool bAppendFinalSlash=false, sal_Int32 nIndex=LAST_SEGMENT, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
INetProtocol GetProtocol() const
bool setExtension(std::u16string_view rTheExtension, sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
const vcl::KeyCode & GetKeyCode() const
OUString m_sFocusedParagraph
sal_Int32 m_nSelectionStart
static uno::Reference< accessibility::XAccessible > getAccessible(const lang::EventObject &aEvent)
void notifyCaretChanged()
void detachRecursive(const uno::Reference< accessibility::XAccessible > &xAccessible)
sal_Int32 m_nSelectionEnd
sal_Int32 m_nCaretPosition
bool m_bFocusedParagraphNotified
static constexpr sal_Int64 MAX_ATTACHABLE_CHILDREN
OUString getFocusedParagraph() const
std::unordered_set< uno::Reference< uno::XInterface > > m_aRefList
OUString m_sSelectedCellAddress
void attachRecursive(const uno::Reference< accessibility::XAccessible > &xAccessible)
virtual void SAL_CALL disposing(const lang::EventObject &Source) override
const SfxViewShell * m_pViewShell
void notifyTextSelectionChanged()
virtual void SAL_CALL notifyEvent(const accessibility::AccessibleEventObject &aEvent) override
int getCaretPosition() const
LOKDocumentFocusListener(const SfxViewShell *pViewShell)
void notifyFocusedParagraphChanged()
OUString getLanguage() const
const OUString & getBcp47(bool bResolveSystem=true) const
LanguageTag & makeFallback()
static OUString GetDefaultPrinterName()
const OUString & GetName() const
static SfxApplication * Get()
SAL_DLLPRIVATE std::vector< SfxViewShell * > & GetViewShells_Impl() const
SAL_DLLPRIVATE std::vector< SfxViewFrame * > & GetViewFrames_Impl() const
SAL_DLLPRIVATE std::unordered_map< OUString, css::uno::Reference< css::ui::XAcceleratorConfiguration > > & GetAcceleratorConfs_Impl() const
weld::Window * GetTopWindow() const
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
void Invalidate(sal_uInt16 nId)
void HidePopups(bool bHide=true)
void InvalidateAll(bool bWithMsg)
SendMailResult SaveAndSend(const css::uno::Reference< css::frame::XFrame > &xFrame)
uno::Reference< lang::XComponent > m_xCtrl
virtual void SAL_CALL disposing(const lang::EventObject &rEventObject) override
SfxViewShell * m_pViewShell
DECL_STATIC_LINK(SfxClipboardChangeListener, AsyncExecuteHdl_Impl, void *, void)
SfxClipboardChangeListener(SfxViewShell *pView, uno::Reference< datatransfer::clipboard::XClipboardNotifier > xClpbrdNtfr)
virtual void SAL_CALL changedContents(const datatransfer::clipboard::ClipboardEvent &rEventObject) override
@ ASYNCEXECUTE_CMD_CHANGEDCONTENTS
@ ASYNCEXECUTE_CMD_DISPOSING
uno::Reference< datatransfer::clipboard::XClipboardNotifier > m_xClpbrdNtfr
void DisconnectViewShell()
SAL_DLLPRIVATE void Update_Impl(bool bForce=false)
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.
void Pop(SfxShell &rShell, SfxDispatcherPopFlags nMode=SfxDispatcherPopFlags::NONE)
With this method, one or more <SfxShell> are popped from the SfxDispatcher.
sal_uInt16 GetShellLevel(const SfxShell &rShell)
Determines the position of a given SfxShell in the stack of the dispatcher.
SAL_DLLPRIVATE void RemoveShell_Impl(SfxShell &rShell)
bool IsActive(const SfxShell &rShell)
This method checks whether a particular <SfxShell> instance is on the SfxDispatcher.
void Push(SfxShell &rShell)
With this method, a <SfxShell> pushed on to the SfxDispatcher.
void Flush()
This method performs outstanding push- and pop- commands.
SfxEventHintId GetEventId() const
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
bool IsClosing_Impl() const
sal_Int64 GetObjectMiscStatus() const
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
vcl::Window * GetEditWin() const
const tools::Rectangle & GetObjArea() const
bool IsObjectInPlaceActive() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
static void notifyInvalidation(SfxViewShell const *pThisView, tools::Rectangle const *)
Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed.
static void notifyAllViews(int nType, const OString &rPayload)
Notifies all views with the given type and payload.
static LOKDeviceFormFactor getDeviceFormFactor()
Get the device form factor that should be used for a new view.
static void notifyWindow(const SfxViewShell *pThisView, vcl::LOKWindowId nWindowId, std::u16string_view rAction, const std::vector< vcl::LOKPayloadItem > &rPayload=std::vector< vcl::LOKPayloadItem >())
Emits a LOK_CALLBACK_WINDOW.
static void notifyOtherView(const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, std::string_view rKey, const OString &rPayload)
Same as notifyOtherViews(), but works on a selected "other" view, not on all of them.
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
Invoke the LOK callback of all other views showing the same document as pThisView,...
static const LanguageTag & getDefaultLanguage()
Get the default language that should be used for views.
static std::pair< bool, OUString > getDefaultTimezone()
Get timezone of the given view. See @setDefaultTimezone.
void AddToAddress(const OUString &rAddress)
SendMailResult SaveAndSend(const css::uno::Reference< css::frame::XFrame > &xFrame, const OUString &rType)
SfxItemSet & GetItemSet() const
sal_Int16 QueryHiddenInformation(HiddenWarningFact eFact, weld::Window *pParent)
bool isExportLocked() const
static void SetCurrentComponent(const css::uno::Reference< css::uno::XInterface > &_rxComponent)
SfxMedium * GetMedium() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
bool isPrintLocked() const
sal_uInt16 GetSlot() const
const T * GetArg(sal_uInt16 nSlotId) const
Templatized access to the individual parameters of the SfxRequest.
weld::Window * GetFrameWeld() const
Return the window that should be used as the parent for any dialogs this request creates.
void Done(bool bRemove=false)
The class SfxShell is the base class for all classes, which provide the functionality of the form <Sl...
SfxItemPool & GetPool() const
Each Subclass of SfxShell must reference a pool.
SfxViewFrame * GetFrame() const
This method returns a pointer to the <SfxViewFrame> to which this SfxShell instance is associated or ...
SfxViewShell * GetViewShell() const
Returns the SfxViewShell in which they are located in the subshells.
void SetPool(SfxItemPool *pNewPool)
With this method, the subclasses register their special <SfxItemPool> in the SfxShell.
SfxDispatcher * GetDispatcher() const
This method returns a pointer to the <SfxDispatcher>, when the SfxShell is currently <UI-active> or a...
const css::uno::Any & GetValue() const
SAL_DLLPRIVATE const SvBorder & GetBorderPixelImpl() const
SAL_DLLPRIVATE void InvalidateBorderImpl(const SfxViewShell *pSh)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
SAL_DLLPRIVATE void SetBorderPixelImpl(const SfxViewShell *pSh, const SvBorder &rBorder)
SfxDispatcher * GetDispatcher()
SfxFrame & GetFrame() const
virtual SfxObjectShell * GetObjectShell() override
SAL_DLLPRIVATE const Size & GetMargin_Impl() const
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
SAL_DLLPRIVATE void AddContextMenuInterceptor_Impl(const css::uno::Reference< css::ui::XContextMenuInterceptor > &xInterceptor)
weld::Window * GetFrameWeld() const
rtl::Reference< LOKDocumentFocusListener > mpLOKDocumentFocusListener
virtual bool PrepareClose(bool bUI=true)
Initialize is called after the frame has been loaded and the controller has been set.
VclPtr< vcl::Window > pWindow
virtual vcl::Window * GetEditWindowForActiveOLEObj() const override
See OutlinerViewShell::GetEditWindowForActiveOLEObj().
virtual void libreOfficeKitViewAddPendingInvalidateTiles() override
virtual void QueryObjAreaPixel(tools::Rectangle &rRect) const
SAL_DLLPRIVATE bool ExecKey_Impl(const KeyEvent &aKey)
virtual SfxPrinter * GetPrinter(bool bCreate=false)
SAL_DLLPRIVATE bool HasMouseClickListeners_Impl() const
virtual void Activate(bool IsMDIActivate) override
Virtual method that is called when enabling the SfxShell instance, in order to give the Subclasses th...
SfxInPlaceClient * GetUIActiveClient() const
virtual void WriteUserData(OUString &, bool bBrowse=false)
css::uno::Reference< css::frame::XController > GetController() const
virtual OUString GetSelectionText(bool bCompleteWords=false, bool bOnlyASample=false)
virtual void ShowCursor(bool bOn=true)
std::unique_ptr< struct SfxViewShell_Impl > pImpl
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
Invokes the registered callback, if there are any.
void SetBorderPixel(const SvBorder &rBorder)
ViewShellDocId GetDocId() const override
Get the DocId used by Mobile LOKit to load multiple documents.
virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString &rAction, const std::vector< vcl::LOKPayloadItem > &rPayload=std::vector< vcl::LOKPayloadItem >()) const override
void DisconnectAllClients()
ViewShellId GetViewShellId() const override
See OutlinerViewShell::GetViewShellId().
virtual void UIActivating(SfxInPlaceClient *pClient)
virtual void flushPendingLOKInvalidateTiles()
virtual void InnerResizePixel(const Point &rOfs, const Size &rSize, bool inplaceEditModeChange)
virtual void notifyInvalidation(tools::Rectangle const *) const override
ILibreOfficeKitNotifier. Emits a LOK_CALLBACK_INVALIDATE_TILES.
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY)
SAL_DLLPRIVATE void ExecMisc_Impl(SfxRequest &)
SfxViewFrame & GetViewFrame() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Get(const css::uno::Reference< css::frame::XController > &i_rController)
void SetLOKLanguageTag(const OUString &rBcp47LanguageTag)
Set the LibreOfficeKit language of this view.
void NotifyOtherView(OutlinerViewShell *pOtherShell, int nType, const OString &rKey, const OString &rPayload) override
See OutlinerViewShell::NotifyOtherView().
SfxInPlaceClient * FindIPClient(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, vcl::Window *pObjParentWin) const
SfxShell * GetSubShell(sal_uInt16)
SAL_DLLPRIVATE void IPClientGone_Impl(SfxInPlaceClient const *pIPClient)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
virtual OUString GetColorConfigName() const
Get the color scheme name of this view.
virtual int getEditMode() const
See lok::Document::getMode().
virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, int nSourceViewId) const override
virtual void Deactivate(bool IsMDIActivate) override
Virtual method that is called when disabling the SfxShell instance, to give the Subclasses the opport...
void setTiledSearching(bool bTiledSearching)
Set if we are doing tiled searching.
void OutplaceActivated(bool bActive)
virtual void afterCallbackRegistered()
Where a new view can perform some update/initialization soon after the callback has been registered.
bool mbLOKAccessibilityEnabled
virtual void OuterResizePixel(const Point &rOfs, const Size &rSize)
css::uno::Reference< css::datatransfer::clipboard::XClipboardNotifier > GetClipboardNotifier() const
void SetLOKAccessibilityState(bool bEnabled)
Enable/Disable LibreOfficeKit AT support for this view.
virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle *pRect, int nPart, int nMode) const override
bool TryContextMenuInterception(const rtl::Reference< VCLXPopupMenu > &rIn, const OUString &rMenuIdentifier, rtl::Reference< VCLXPopupMenu > &rOut, css::ui::ContextMenuExecuteEvent aEvent)
void dumpLibreOfficeKitViewState(rtl::OStringBuffer &rState)
dump view state for diagnostics
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
SfxViewShell(SfxViewFrame &rFrame, SfxViewShellFlags nFlags)
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
LanguageTag maLOKLanguageTag
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void ReadUserData(const OUString &, bool bBrowse=false)
virtual ~SfxViewShell() override
virtual void libreOfficeKitViewUpdatedCallback(int nType) const override
virtual ErrCode DoVerb(sal_Int32 nVerb)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
SfxLokCallbackInterface * getLibreOfficeKitViewCallback() const
const LanguageTag & GetLOKLanguageTag() const
Get the LibreOfficeKit language of this view.
int getA11yCaretPosition() const
SAL_DLLPRIVATE SfxBaseController * GetBaseController_Impl() const
std::unordered_set< OUString > mvLOKBlockedCommandList
virtual css::uno::Reference< css::frame::XModel > GetCurrentDocument() const
retrieves the document which shall be considered the "current document" when the frame is active
void SetLOKLocale(const OUString &rBcp47LanguageTag)
Set the LibreOfficeKit locale of this view.
SAL_DLLPRIVATE bool GlobalKeyInput_Impl(const KeyEvent &rKeyEvent)
SAL_DLLPRIVATE void GetState_Impl(SfxItemSet &)
virtual bool HasSelection(bool bText=true) const
LOKDeviceFormFactor maLOKDeviceFormFactor
SAL_DLLPRIVATE void PushSubShells_Impl(bool bPush=true)
const SvBorder & GetBorderPixel() const
void setLibreOfficeKitViewCallback(SfxLokCallbackInterface *pCallback)
Set up a more efficient internal callback instead of LibreOfficeKitCallback.
void SetController(SfxBaseController *pController)
virtual std::optional< OString > getLOKPayload(int nType, int nViewId) const
void SetCurrentDocument() const
forwards the current document, as returned by ->GetCurrentDocument, to SfxObjectShell::SetWorkingDocu...
virtual SfxObjectShell * GetObjectShell() override
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
void JumpToMark(const OUString &rMark)
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
virtual SdrView * GetDrawView() const
static ViewShellDocId mnCurrentDocId
Used to set the DocId at construction time. See SetCurrentDocId.
void NotifyOtherViews(int nType, const OString &rKey, const OString &rPayload) override
See OutlinerViewShell::NotifyOtherViews().
virtual void NotifyCursor(SfxViewShell *) const
Ask this view to send its cursor position to pViewShell.
SfxInPlaceClient * GetIPClient() const
SAL_DLLPRIVATE bool HasKeyListeners_Impl() const
SAL_DLLPRIVATE bool HandleNotifyEvent_Impl(NotifyEvent const &rEvent)
virtual css::uno::Reference< css::view::XRenderable > GetRenderable()
get an XRenderable instance that can render this document
virtual bool KeyInput(const KeyEvent &rKeyEvent)
static void SetCurrentDocId(ViewShellDocId nId)
Set the current DocId, which is used by Mobile LOKit to load multiple documents and yet identify the ...
SAL_DLLPRIVATE void NewIPClient_Impl(SfxInPlaceClient *pIPClient)
SAL_DLLPRIVATE void ResetAllClients_Impl(SfxInPlaceClient const *pIP)
bool isBlockedCommand(OUString command)
void SetWindow(vcl::Window *pViewPort)
void SetMargin(const Size &)
SAL_DLLPRIVATE void CheckIPClient_Impl(SfxInPlaceClient const *, const tools::Rectangle &)
SAL_DLLPRIVATE void RemoveContextMenuInterceptor_Impl(const css::uno::Reference< css::ui::XContextMenuInterceptor > &xInterceptor)
OUString getA11yFocusedParagraph() const
vcl::Window * GetWindow() const
void setBlockedCommandList(const char *blockedCommandList)
SAL_DLLPRIVATE SfxInPlaceClient * GetUIActiveIPClient_Impl() const
virtual ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const
Get a color config color from this view.
const Size & GetMargin() const
void AddSubShell(SfxShell &rShell)
virtual void libreOfficeKitViewCallbackWithViewId(int nType, const OString &pPayload, int nViewId) const override
virtual void MarginChanged()
void RemoveSubShell(SfxShell *pShell=nullptr)
virtual int getPart() const
See lok::Document::getPart().
virtual void UIDeactivated(SfxInPlaceClient *pClient)
void AddRemoveClipboardListener(const css::uno::Reference< css::datatransfer::clipboard::XClipboardListener > &, bool)
LOKDocumentFocusListener & GetLOKDocumentFocusListener()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
reference_type * get() const
static std::shared_ptr< ConfigurationChanges > create()
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
static void CreateMenuFromActionTriggerContainer(const css::uno::Reference< css::awt::XPopupMenu > &rNewMenu, const css::uno::Reference< css::container::XIndexContainer > &rActionTriggerContainer)
static css::uno::Reference< css::container::XIndexContainer > CreateActionTriggerContainerFromMenu(const css::uno::Reference< css::awt::XPopupMenu > &rMenu, const OUString *pMenuIdentifier)
static std::unique_ptr< AcceleratorExecute > createAcceleratorHelper()
static css::uno::Reference< css::ui::XAcceleratorConfiguration > lok_createNewAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext > &rxContext, OUString sModule)
void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier *pNotifier, bool bParent=false)
void ReleaseLOKNotifier()
const vcl::ILibreOfficeKitNotifier * GetLOKNotifier() const
vcl::Window * GetFrameWindow() const
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
virtual std::shared_ptr< SfxDialogController > GetController() override
struct _xmlTextWriter * xmlTextWriterPtr
OUString SVT_DLLPUBLIC getInstalledLocaleForSystemUILanguage(css::uno::Sequence< OUString > const &installed, bool bRequestInstallIfMissing, const OUString &rPreferredLocale=OUString())
#define LINK(Instance, Class, Member)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
bool createTemporaryHtmlDirectory(OUString **url)
enumrange< T >::Iterator begin(enumrange< T >)
void openUriExternally(const OUString &sURI, bool bHandleSystemShellExecuteException, weld::Widget *pDialogParent)
Open a URI via com.sun.star.system.SystemShellExecute.
Sequence< beans::PropertyValue > GetCommandProperties(const OUString &rsCommandName, const OUString &rsModuleName)
OUString GetModuleIdentifier(const Reference< frame::XFrame > &rxFrame)
OUString GetLabelForCommand(const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
HashMap_OWString_Interface aMap
OUString SfxResId(TranslateId aId)
#define SFX_IMPL_SUPERCLASS_INTERFACE(Class, SuperClass)
#define ERRCODE_SO_NOVERBS
AsyncExecuteInfo(AsyncExecuteCmd eCmd, SfxClipboardChangeListener *pListener)
rtl::Reference< SfxClipboardChangeListener > m_xListener
bool m_bTiledSearching
Set if we are in the middle of a tiled search.
std::vector< SfxInPlaceClient * > & GetIPClients_Impl()
SfxViewShell_Impl(SfxViewShellFlags const nFlags, ViewShellDocId nDocId)
static sal_uInt32 m_nLastViewShellId
std::vector< SfxInPlaceClient * > maIPClients
Reference< XController > xController
Reference< XFrame > xFrame
Reference< XModel > xModel
static OUString impl_retrieveFilterNameFromTypeAndModule(const css::uno::Reference< css::container::XContainerQuery > &rContainerQuery, const OUString &rType, const OUString &rModuleIdentifier, const sal_Int32 nFlags)
search for a filter name dependent on type and module
IMPL_STATIC_LINK(SfxClipboardChangeListener, AsyncExecuteHdl_Impl, void *, p, void)
static OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFrame > &xFrame, ETypeFamily eTypeFamily)
static bool ignoreLibreOfficeKitViewCallback(int nType, const SfxViewShell_Impl *pImpl)
#define DEFAULT_MARGIN_HEIGHT
#define DEFAULT_MARGIN_WIDTH