22#include <com/sun/star/accessibility/AccessibleEventId.hpp>
23#include <com/sun/star/accessibility/AccessibleStateType.hpp>
24#include <com/sun/star/frame/Desktop.hpp>
25#include <com/sun/star/frame/XFramesSupplier.hpp>
26#include <com/sun/star/frame/XModel.hpp>
27#include <com/sun/star/container/XChild.hpp>
35#include <LibreOfficeKit/LibreOfficeKitEnums.h>
36#include <officecfg/Office/Common.hxx>
63#include <editeng/editeng.hxx>
79#include <unomodel.hxx>
83#include <document.hxx>
84#include <starmath.hrc>
93#define MINZOOM sal_uInt16(25)
94#define MAXZOOM sal_uInt16(800)
99#define CMD_BOX_PADDING 3
100#define CMD_BOX_PADDING_TOP 11
102#define ShellClass_SmViewShell
103#include <smslots.hxx>
106using namespace css::accessibility;
107using namespace css::uno;
110 :
InterimItemWindow(&rShell.GetViewFrame().GetWindow(),
"modules/smath/ui/mathwindow.ui",
"MathWindow")
111 , nLinePixH(GetSettings().GetStyleSettings().GetScrollBarSize())
112 , nColumnPixW(nLinePixH)
115 , mxScrolledWindow(m_xBuilder->weld_scrolled_window(
"scrolledwindow", true))
117 , mxGraphicWin(new
weld::CustomWeld(*m_xBuilder,
"mathview", *
mxGraphic))
152 bool bVVisible =
false;
153 bool bHVisible =
false;
199 if ( !bVVisible || !bHVisible )
219 mxScrolledWindow->set_vpolicy(bVVisible ? VclPolicyType::ALWAYS : VclPolicyType::NEVER);
220 mxScrolledWindow->set_hpolicy(bHVisible ? VclPolicyType::ALWAYS : VclPolicyType::NEVER);
238 Point aNewPixOffset(aPixOffset);
241 if (mxScrolledWindow->get_hpolicy() == VclPolicyType::ALWAYS)
242 aNewPixOffset.
setX(-mxScrolledWindow->hadjustment_get_value());
245 if (mxScrolledWindow->get_vpolicy() == VclPolicyType::ALWAYS)
246 aNewPixOffset.
setY(-mxScrolledWindow->vadjustment_get_value());
249 if (aPixOffset == aNewPixOffset)
253 aPixOffset = aNewPixOffset;
255 SetGraphicMapMode(
aMap);
298 : mrGraphicWindow(rGraphicWindow)
299 , bIsCursorVisible(false)
300 , bIsLineVisible(false)
301 , aCaretBlinkTimer(
"SmGraphicWidget aCaretBlinkTimer")
376 const SmNode *pNode =
nullptr;
434 aOldValue <<= AccessibleStateType::FOCUSED;
436 mxAccessible->LaunchEvent( AccessibleEventId::STATE_CHANGED,
437 aOldValue, aNewValue );
455 if (IsCursorVisible())
456 SetIsCursorVisible(
false);
458 SetIsCursorVisible(
true);
460 RepaintViewShellDoc();
514 OString::boolean(bVis));
713 bool bConsumed =
true;
718 case KeyFuncType::COPY:
721 case KeyFuncType::CUT:
724 case KeyFuncType::PASTE:
727 case KeyFuncType::UNDO:
730 case KeyFuncType::REDO:
779 bool bCallBase =
true;
780 if (!
GetView().GetViewFrame().GetFrame().IsInPlace())
784 case CommandEventId::ContextMenu:
791 case CommandEventId::Wheel:
794 if ( pWData && CommandWheelMode::ZOOM == pWData->
GetMode() )
806 case CommandEventId::GestureZoom:
811 if (
pData->meEventType == GestureEventZoomType::Begin)
815 else if (
pData->meEventType == GestureEventZoomType::Update)
826 nZoom += nZoomChangePercent;
841 case CommandEventId::ExtTextInput:
846 const OUString& rText =
pData->GetText();
849 for (sal_Int32
i = 0;
i < rText.getLength();)
850 CharInput(rText.iterateCodePoints(&
i), rCursor, rDevice);
887 SetZoom ( sal::static_int_cast< sal_uInt16 >(nVal) );
937 :
SfxDockingWindow(pBindings_, pChildWindow, pParent,
"EditWindow",
"modules/smath/ui/editwindow.ui")
939 , aController(*m_xEdit, SID_TEXT, *pBindings_)
941 , aInitialFocusTimer(
"SmCmdBoxWindow aInitialFocusTimer")
946 SetSizePixel(LogicToPixel(
Size(292 , 94),
MapMode(MapUnit::MapAppFont)));
962 int x(0),
y(0), width(0), height(0);
965 aRet.
Move(m_xBox->GetPosPixel().X(), m_xBox->GetPosPixel().Y());
979 if (rCEvt.
GetCommand() == CommandEventId::ContextMenu)
985 SfxDockingWindow::Command(rCEvt);
1013 case SfxChildAlignment::LEFT:
1014 case SfxChildAlignment::RIGHT:
1027 case SfxChildAlignment::TOP:
1028 case SfxChildAlignment::BOTTOM:
1029 case SfxChildAlignment::NOALIGNMENT:
1040 if (StateChangedType::InitShow == nStateChange)
1045 if (IsFloatingMode())
1070 m_xEdit->GrabFocus();
1079 uno::UNO_QUERY_THROW);
1080 uno::Reference< frame::XModel > xParent(
xModel->getParent(), uno::UNO_QUERY_THROW );
1081 uno::Reference< frame::XController > xParentCtrler( xParent->getCurrentController() );
1082 uno::Reference< frame::XFramesSupplier > xParentFrame( xParentCtrler->getFrame(), uno::UNO_QUERY_THROW );
1083 xParentFrame->setActiveFrame(
xFrame );
1087 xDesktop->setActiveFrame(
xFrame );
1090 catch (uno::Exception &)
1092 SAL_WARN(
"starmath",
"failed to properly set initial focus to edit window" );
1101 Point aPos( GetParent()->OutputToScreenPixel( aTopLeft ) );
1106 SetPosPixel( aPos );
1113 if (GetFloatingWindow())
1114 GetFloatingWindow()->SetMinOutputSizePixel(
Size (200, 50));
1134 pDialog->setDeferredProperties();
1137 pDialog->Initialize(pInfo);
1145 SfxVisibilityFlags::Standard | SfxVisibilityFlags::FullScreen | SfxVisibilityFlags::Server,
1146 ToolbarId::Math_Toolbox);
1149 GetStaticInterface()->RegisterChildWindow(SmCmdBoxWrapper::GetChildWindowId());
1150 GetStaticInterface()->RegisterChildWindow(SfxInfoBarContainerChild::GetChildWindowId());
1152 GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
1169 aMap.SetScaleX(aZoomX);
1170 aMap.SetScaleY(aZoomY);
1182 if (
GetDoc()->IsPreview())
1193 const Fraction &rFrac = std::min(rX, rY);
1213 aSize.
setWidth( ((aSize.
Width() / nTabPos) + 1) * nTabPos );
1215 const OUString aText = rLine.getToken(0,
'\t',
nPos);
1235 aLine = aLine.replaceAll(
"\r",
"");
1239 if (aSize.
Width() > MaxWidth)
1244 sal_Int32
m = aLine.getLength();
1247 for (sal_Int32
n = 0;
n < nLen;
n++)
1250 if ((cLineChar ==
' ') || (cLineChar ==
'\t'))
1252 aText = aLine.copy(0,
n);
1260 aText = aLine.copy(0,
m);
1261 aLine = aLine.replaceAt(0,
m,
u"");
1270 while (!aLine.isEmpty());
1285 Point aPoint(rPosition);
1294 aPoint.
setX( ((aPoint.
X() / nTabPos) + 1) * nTabPos );
1296 OUString aText = rLine.getToken(0,
'\t',
nPos);
1300 while (
nPos >= 0 );
1311 Point aPoint(rPosition);
1318 aLine = aLine.replaceAll(
"\r",
"");
1320 if (aSize.
Width() > MaxWidth)
1325 sal_Int32
m = aLine.getLength();
1328 for (sal_Int32
n = 0;
n < nLen;
n++)
1331 if ((cLineChar ==
' ') || (cLineChar ==
'\t'))
1333 aText = aLine.copy(0,
n);
1340 aText = aLine.copy(0,
m);
1341 aLine = aLine.replaceAt(0,
m,
u"");
1353 if (!aLine.isEmpty())
1365 while (
nPos >= 0 );
1382 Size aSize600 (0, 600);
1383 Size aSize650 (0, 650);
1412 sal::static_int_cast< sal_uInt16 >(aOutRect.
GetWidth() - 200));
1420 aPoint.
setY( aOutRect.
Top() );
1422 sal::static_int_cast< sal_uInt16 >(aOutRect.
GetWidth() - 200));
1427 if (bIsPrintFormulaText)
1445 aOutRect.
Bottom() + 300);
1447 sal::static_int_cast< sal_uInt16 >(aOutRect.
GetWidth() - 200));
1489 Fraction aFraction( nZoomFactor, 100 );
1526 if ( pOld && pOld->IsPrinting() )
1529 if ((nDiffFlags & SfxPrinterChangeFlags::PRINTER) == SfxPrinterChangeFlags::PRINTER)
1532 if ((nDiffFlags & SfxPrinterChangeFlags::OPTIONS) == SfxPrinterChangeFlags::OPTIONS)
1556 if (pWrapper !=
nullptr)
1574 if (pErrorDesc ||
nullptr != (pErrorDesc =
GetDoc()->GetParser()->
GetError()) )
1606 uno::Reference <embed::XStorage> xStorage = rMedium.
GetStorage();
1607 if (xStorage.is() && xStorage->getElementNames().hasElements())
1609 if (xStorage->hasByName(
"content.xml"))
1621 OUString aText = pDoc->
GetText();
1623 pEditWin->InsertText( aText );
1626 SAL_WARN(
"starmath",
"EditWindow missing" );
1639 bool bSuccess =
false;
1645 const OUString& rFltName = rMedium.
GetFilter()->GetFilterName();
1657 OUString aText = pDoc->
GetText();
1659 pEditWin->InsertText(aText);
1661 SAL_WARN(
"starmath",
"EditWindow missing" );
1677 case SID_FORMULACURSOR:
1686 SfxItemState::SET == pArgs->
GetItemState( SID_FORMULACURSOR,
false, &pItem))
1706 case SID_ZOOM_OPTIMAL:
1719 case SID_COPYOBJECT:
1722 Reference< datatransfer::XTransferable > xTrans(
GetDoc()->GetModel(), uno::UNO_QUERY );
1735 case SID_PASTEOBJECT:
1737 uno::Reference < io::XInputStream > xStrm;
1742 if(
aData.GetTransferable().is() &&
1743 (
aData.HasFormat(
nId = SotClipboardFormatId::EMBEDDED_OBJ ) ||
1744 (
aData.HasFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ) &&
1745 aData.HasFormat(
nId = SotClipboardFormatId::EMBED_SOURCE ))))
1746 xStrm =
aData.GetInputStream(
nId, OUString());
1753 uno::Reference < embed::XStorage > xStorage =
1755 SfxMedium aMedium( xStorage, OUString() );
1759 catch (uno::Exception &)
1761 SAL_WARN(
"starmath",
"SmViewShell::Execute (SID_PASTEOBJECT): failed to get storage from input stream" );
1779 SID_COPYOBJECT, SfxCallMode::RECORD,
1789 bool bCallExec =
nullptr == pWin;
1799 aDataHelper.
HasFormat( SotClipboardFormatId::STRING ))
1808 SID_PASTEOBJECT, SfxCallMode::RECORD,
1824 case SID_INSERTCOMMANDTEXT:
1841 case SID_INSERTSPECIAL:
1852 case SID_IMPORT_FORMULA:
1861 case SID_IMPORT_MATHML_CLIPBOARD:
1866 uno::Reference < io::XInputStream > xStrm;
1877 std::shared_ptr<const SfxFilter> pMathFilter =
1879 aClipboardMedium.
SetFilter(pMathFilter);
1887 nId = SotClipboardFormatId::STRING;
1895 if (!aString.startsWith(
"<?xml"))
1896 aString =
"<?xml version=\"1.0\"?>\n" + aString;
1900 std::shared_ptr<const SfxFilter> pMathFilter =
1902 aClipboardMedium.
SetFilter(pMathFilter);
1905 uno::Reference<io::XInputStream> xStrm2( new ::utl::OInputStreamWrapper(aStrm) );
1945 case SID_TEXTSTATUS:
1947 if (rReq.
GetArgs() !=
nullptr)
1957 case SID_GETEDITTEXT:
1958 if (pWin && !pWin->
GetText().isEmpty())
1985 case SID_ATTR_ZOOMSLIDER:
1990 if ( pArgs && SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_ZOOMSLIDER,
true, &pItem ) )
1998 case SID_ELEMENTSDOCKINGWINDOW:
2011 case SID_UNICODE_NOTATION_TOGGLE:
2019 pEditView = pEditEngine->
GetView();
2030 sal_Int32 nUtf16Pos=0;
2031 while( (nUtf16Pos < sInput.getLength()) && (nUtf16Pos < aSel.
nEndPos) )
2033 sInput.iterateCodePoints(&nUtf16Pos);
2034 if( nUtf16Pos > aSel.
nEndPos )
2039 while( nUtf16Pos && aToggle.
AllowMoreInput( sInput[nUtf16Pos-1]) )
2042 if( !sReplacement.isEmpty() )
2056 case SID_SYMBOLS_CATALOGUE:
2063 pDev = &
SM_MOD()->GetDefaultVirtualDev();
2064 SAL_WARN_IF( !pDev,
"starmath",
"device for font list missing" );
2100 ( aDataHelper.
HasFormat( SotClipboardFormatId::STRING ) ||
2101 aDataHelper.
HasFormat( SotClipboardFormatId::EMBEDDED_OBJ ) ||
2102 (aDataHelper.
HasFormat( SotClipboardFormatId::OBJECTDESCRIPTOR )
2103 && aDataHelper.
HasFormat( SotClipboardFormatId::EMBED_SOURCE )));
2114 case SID_ZOOM_OPTIMAL:
2119 case SID_ATTR_ZOOMSLIDER :
2134 if (! pEditWin || pEditWin->
IsEmpty())
2138 case SID_TEXTSTATUS:
2144 case SID_FORMULACURSOR:
2150 case SID_ELEMENTSDOCKINGWINDOW:
2163css::uno::Reference<css::ui::XSidebar>
2164getSidebarFromModel(
const css::uno::Reference<css::frame::XModel>& xModel)
2166 css::uno::Reference<css::container::XChild> xChild(xModel, css::uno::UNO_QUERY);
2169 css::uno::Reference<css::frame::XModel> xParent(xChild->getParent(), css::uno::UNO_QUERY);
2172 css::uno::Reference<css::frame::XController2>
xController(xParent->getCurrentController(),
2173 css::uno::UNO_QUERY);
2176 css::uno::Reference<css::ui::XSidebarProvider> xSidebarProvider =
xController->getSidebar();
2177 if (!xSidebarProvider.is())
2179 return xSidebarProvider->getSidebar();
2187 GetContextName, this,
vcl::EnumContext::Context::
Math))
2195 void SAL_CALL
attachFrame(
const css::uno::Reference<css::frame::XFrame>& xFrame)
override
2205 if (
auto xSidebar = getSidebarFromModel(
getModel()))
2209 pSidebar->registerSidebarForFrame(
this);
2215 mpSelectionChangeHandler->selectionChanged({});
2218 virtual void SAL_CALL
dispose()
override
2222 pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE,
2223 OString::boolean(
false));
2229 static OUString GetContextName() {
return "Math"; }
2238 , maGraphicController(mxGraphicWindow->GetGraphicWidget(), SID_GRAPHIC_SM, rFrame_.
GetBindings())
2239 , mbPasteState(false)
2240 , mbInsertIntoEditWindow(false)
2255 pEditWin->DeleteEditView();
2285 if ( bIsMDIActivate )
2292 assert(_pFileDlg &&
"SmViewShell::DialogClosedHdl(): no file dialog");
2293 assert(mpDocInserter &&
"ScDocShell::DialogClosedHdl(): no document inserter");
2297 std::unique_ptr<SfxMedium> pMedium = mpDocInserter->CreateMedium();
2301 if ( pMedium->IsStorage() )
2304 InsertFrom( *pMedium );
2312 GetViewFrame().GetBindings().Invalidate(SID_GRAPHIC_SM);
2316 mpRequest->SetReturnValue(
SfxBoolItem( mpRequest->GetSlot(),
true ) );
2322 switch( rHint.
GetId() )
2324 case SfxHintId::ModeChanged:
2325 case SfxHintId::DocChanged:
2336 || officecfg::Office::Common::Misc::ExperimentalMode::get();
2352 case SvxZoomType::PERCENT:
2353 mxGraphicWindow->SetZoom(sal::static_int_cast<sal_uInt16>(rZoom.GetValue ()));
2356 case SvxZoomType::OPTIMAL:
2360 case SvxZoomType::PAGEWIDTH:
2361 case SvxZoomType::WHOLEPAGE:
2368 Size GraphicSize(pPrinter->LogicToPixel(
GetDoc()->GetSize(),
aMap));
2369 if (GraphicSize.
Width() <= 0 || GraphicSize.
Height() <= 0)
2385 case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
2393 Point aFormulaDrawPos = widget.GetFormulaDrawPos();
2394 aCaret.
Move(aFormulaDrawPos.
X(), aFormulaDrawPos.
Y());
2402 case LOK_CALLBACK_TEXT_SELECTION:
2412 Point aFormulaDrawPos = widget.GetFormulaDrawPos();
2413 aSelection.
Move(aFormulaDrawPos.
X(), aFormulaDrawPos.
Y());
2418 sRectangle = aSelection.
toString();
2423 case LOK_CALLBACK_TEXT_SELECTION_START:
2424 case LOK_CALLBACK_TEXT_SELECTION_END:
2425 case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR:
2426 case LOK_CALLBACK_TEXT_VIEW_SELECTION:
2435 if (
const auto& payload =
getLOKPayload(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, nViewId))
2440 if (
const auto& payload =
getLOKPayload(LOK_CALLBACK_TEXT_SELECTION, nViewId))
virtual const SmErrorDesc * NextError()=0
virtual const SmErrorDesc * PrevError()=0
static const AllSettings & GetSettings()
const OUString & GetValue() const
const CommandGestureZoomData * GetGestureZoomData() const
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
const Point & GetMousePosPixel() const
const CommandExtTextInputData * GetExtTextInputData() const
bool IsMouseEvent() const
tools::Long GetDelta() const
CommandWheelMode GetMode() const
OUString GetText(LineEnd eEnd=LINEEND_LF) const
EditView * GetView(size_t nIndex=0) const
void UndoActionStart(sal_uInt16 nId)
OUString GetSurroundingText() const
void SetSelection(const ESelection &rNewSel)
void InsertText(const OUString &rNew, bool bSelect=false, bool bLOKShowSelect=true)
virtual bool Start(const OUString &rHelpId, weld::Widget *pWidget=nullptr)
virtual void Resize() override
virtual void dispose() override
void InitControlBase(weld::Widget *pWidget)
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
float approximate_digit_width() const
void EnableMapMode(bool bEnable=true)
void SetFont(const vcl::Font &rNewFont)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void DrawRect(const tools::Rectangle &rRect)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
int GetFontFaceCollectionCount() const
const MapMode & GetMapMode() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void Move(tools::Long nHorzMove, tools::Long nVertMove)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void CopyLokViewCallbackFromFrameCreator()
css::uno::Reference< css::frame::XModel > SAL_CALL getModel() override
SfxViewShell * GetViewShell_Impl() const
virtual void SAL_CALL attachFrame(const css::uno::Reference< css::frame::XFrame > &xFrame) override
virtual void SAL_CALL dispose() override
SfxDispatcher * GetDispatcher() const
void Invalidate(sal_uInt16 nId)
void InvalidateAll(bool bWithMsg)
void SetAlignment(SfxChildAlignment eAlign)
void SetWindow(const VclPtr< vcl::Window > &p)
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState)
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 * >())
SfxViewFrame * GetFrame() const
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
std::unique_ptr< weld::Box > m_xContainer
virtual void Resize() override
SfxBindings & GetBindings() const
virtual void StateChanged(StateChangedType nStateChange) override
virtual Size CalcDockingSize(SfxChildAlignment)
virtual void ToggleFloatingMode() override
virtual void dispose() override
static std::shared_ptr< const SfxFilter > GetFilterByName(const OUString &rName)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
static OString makeVisCursorInvalidation(int nViewId, const OString &rRectangle, bool bMispelledWord=false, const OString &rHyperlink="")
const std::shared_ptr< const SfxFilter > & GetFilter() const
void setStreamToLoadFrom(const css::uno::Reference< css::io::XInputStream > &xInputStream, bool bIsReadOnly)
SfxItemSet & GetItemSet() const
void SetFilter(const std::shared_ptr< const SfxFilter > &pFilter)
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual tools::Rectangle GetVisArea(sal_uInt16 nAspect) const
const SfxItemSet & GetOptions() const
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void Done(bool bRemove=false)
void SetUndoManager(SfxUndoManager *pNewUndoMgr)
void SetContextName(const OUString &rsContextName)
SfxViewFrame * GetFrame() const
virtual SfxUndoManager * GetUndoManager()
SfxViewShell * GetViewShell() const
void SetName(const OUString &rName)
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
SfxFrame & GetFrame() const
void ShowChildWindow(sal_uInt16, bool bVisible=true)
weld::Window * GetFrameWeld() const
virtual void Activate(bool IsMDIActivate) override
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
void SetBorderPixel(const SvBorder &rBorder)
ViewShellId GetViewShellId() const override
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY)
SfxViewFrame & GetViewFrame() const
virtual void Deactivate(bool IsMDIActivate) override
void SetController(SfxBaseController *pController)
virtual std::optional< OString > getLOKPayload(int nType, int nViewId) const
virtual SfxObjectShell * GetObjectShell() override
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
virtual bool KeyInput(const KeyEvent &rKeyEvent)
void SetWindow(vcl::Window *pViewPort)
vcl::Window * GetWindow() const
virtual void libreOfficeKitViewCallbackWithViewId(int nType, const OString &pPayload, int nViewId) const override
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
virtual void StateChanged(StateChangedType nStateChange) override
virtual void dispose() override
virtual ~SmCmdBoxWindow() override
SmEditController aController
std::unique_ptr< SmEditWindow, o3tl::default_delete< SmEditWindow > > m_xEdit
Point WidgetToWindowPos(const weld::Widget &rWidget, const Point &rPos)
virtual void Command(const CommandEvent &rCEvt) override
void ShowContextMenu(const Point &rPos)
virtual Size CalcDockingSize(SfxChildAlignment eAlign) override
SmCmdBoxWindow(SfxBindings *pBindings, SfxChildWindow *pChildWindow, Window *pParent)
virtual void ToggleFloatingMode() override
virtual void GetFocus() override
virtual SfxChildAlignment CheckAlignment(SfxChildAlignment eActual, SfxChildAlignment eWish) override
SmCmdBoxWrapper(vcl::Window *pParentWindow, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
SmEditWindow & GetEditWindow()
void Delete()
Delete the current selection or do nothing.
void InsertElement(SmFormulaElement element)
Insert an element into the formula.
void InsertFraction()
Insert a fraction, use selection as numerator.
void InsertBrackets(SmBracketType eBracketType)
Create brackets around current selection, or new SmPlaceNode.
void Copy()
Copy the current selection.
void DeletePrev(OutputDevice *pDev)
Delete selection, previous element or merge lines.
void Draw(OutputDevice &pDev, Point Offset, bool isCaretVisible)
Draw the caret.
bool HasSelection() const
True, if the cursor has a selection.
bool IsAtTailOfBracket(SmBracketType eBracketType) const
void MoveTo(OutputDevice *pDev, const Point &pos, bool bMoveAnchor)
Move to the caret position closest to a given point.
void Cut()
Cut the current selection.
void Paste()
Paste the clipboard.
bool HasComplexSelection()
Returns true if more than one node is selected.
tools::Rectangle GetCaretRectangle(OutputDevice &rOutDev) const
void InsertSubSup(SmSubSup eSubSup)
Create sub-/super script.
void InsertCommandText(const OUString &aCommandText)
Insert command text translated into line entries at position.
bool InsertRow()
Insert a new row or newline.
void InsertText(const OUString &aString)
Insert text at the current position.
void Move(OutputDevice *pDev, SmMovementDirection direction, bool bMoveAnchor=true)
Move the position of this cursor.
tools::Rectangle GetSelectionRectangle(OutputDevice &rOutDev) const
void InsertSpecial(std::u16string_view aString)
Insert a special node created from aString.
void SetText(const OUString &rBuffer)
EditEngine & GetEditEngine()
const SmTableNode * GetFormulaTree() const
SfxPrinter * GetPrinter()
bool HasCursor() const
True, if cursor have previously been requested and thus has some sort of position.
void SetPrinter(SfxPrinter *)
SmCursor & GetCursor()
Get a cursor for modifying this document.
static SfxItemPool & GetPool()
const OUString & GetText() const
void Execute(SfxRequest &rReq)
void DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSelection=false)
virtual void SetModified(bool bModified=true) override
AbstractSmParser * GetParser()
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
SmEditController(SmEditWindow &, sal_uInt16, SfxBindings &)
void SetText(const OUString &rText)
void InsertText(const OUString &rText)
weld::Window * GetFrameWeld() const
EditEngine * GetEditEngine()
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard() const
bool IsAllSelected() const
ESelection GetSelection() const
void SetSelection(const ESelection &rSel)
SmGraphicController(SmGraphicWidget &, sal_uInt16, SfxBindings &)
SmGraphicWidget & rGraphic
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
void SetZoom(sal_uInt16 Factor)
virtual ~SmGraphicWindow() override
sal_uInt16 GetZoom() const
virtual void Resize() override
MapMode GetGraphicMapMode() const
void SetTotalSize(const Size &rNewSize)
std::unique_ptr< weld::CustomWeld > mxGraphicWin
std::unique_ptr< weld::ScrolledWindow > mxScrolledWindow
Size GetTotalSize() const
void SetGraphicMapMode(const MapMode &rNewMapMode)
SmGraphicWindow(SmViewShell &rShell)
void ShowContextMenu(const CommandEvent &rCEvt)
std::unique_ptr< SmGraphicWidget > mxGraphic
virtual void dispose() override
void ItemSetToConfig(const SfxItemSet &rSet)
bool IsShowFormulaCursor() const
void SetShowFormulaCursor(bool bVal)
SmMathConfig * GetConfig()
SmSymbolManager & GetSymbolManager()
const SmNode * FindRectClosestTo(const Point &rPoint) const
Finds the closest rectangle in the screen.
sal_uInt16 GetRow() const
Gets the line in the text where the node is located.
const SmNode * FindTokenAt(sal_uInt16 nRow, sal_uInt16 nCol) const
Finds the node from the position in the text.
const ESelection & GetSelection() const
Gets node position in input text.
sal_uInt16 GetColumn() const
Gets the column of the line in the text where the node is located.
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
tools::Long GetItalicLeftSpace() const
const Point & GetTopLeft() const
Size GetItalicSize() const
tools::Long OrientedDist(const Point &rPoint) const
virtual void QueryObjAreaPixel(tools::Rectangle &rRect) const override
void SetInsertIntoEditWindow(bool bEditWindowHadFocusLast)
Set bInsertIntoEditWindow so we know where to insert.
bool mbInsertIntoEditWindow
Used to determine whether insertions using SID_INSERTSPECIAL and SID_INSERTCOMMANDTEXT should be inse...
void ZoomByItemSet(const SfxItemSet *pSet)
void Execute(SfxRequest &rReq)
virtual sal_uInt16 SetPrinter(SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags=SFX_PRINTER_ALL) override
void InsertFrom(SfxMedium &rMedium)
virtual SfxPrinter * GetPrinter(bool bCreate=false) override
static bool IsInlineEditEnabled()
SmEditWindow * GetEditWindow()
VclPtr< SmGraphicWindow > mxGraphicWindow
virtual void Deactivate(bool IsMDIActivate) override
void SendCaretToLOK() const
void Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPrintUIOptions, tools::Rectangle aOutRect)
SmDocShell * GetDoc() const
SmViewShell(SfxViewFrame &rFrame, SfxViewShell *pOldSh)
void SetStatusText(const OUString &rText)
void ShowError(const SmErrorDesc *pErrorDesc)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void SetZoomFactor(const Fraction &rX, const Fraction &rY) override
std::unique_ptr< sfx2::DocumentInserter > mpDocInserter
SmGraphicWidget & GetGraphicWidget()
void GetState(SfxItemSet &)
virtual ~SmViewShell() override
virtual bool HasPrintOptionsPage() const override
virtual void InnerResizePixel(const Point &rOfs, const Size &rSize, bool inplaceEditModeChange) override
static void DrawTextLine(OutputDevice &rDevice, const Point &rPosition, const OUString &rLine)
std::unique_ptr< SfxRequest > mpRequest
void Insert(SfxMedium &rMedium)
static void DrawText(OutputDevice &rDevice, const Point &rPosition, std::u16string_view rText, sal_uInt16 MaxWidth)
static Size GetTextSize(OutputDevice const &rDevice, std::u16string_view rText, tools::Long MaxWidth)
virtual std::optional< OString > getLOKPayload(int nType, int nViewId) const override
static Size GetTextLineSize(OutputDevice const &rDevice, const OUString &rLine)
virtual std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions) override
virtual void OuterResizePixel(const Point &rOfs, const Size &rSize) override
virtual void Activate(bool IsMDIActivate) override
ErrCode Import(SfxMedium &rMedium)
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
static SvxAbstractDialogFactory * Create()
SvxZoomType GetType() const
void AddSnappingPoint(sal_Int32 nNew)
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
sal_uInt64 GetTimeout() const
OUString ReplacementString()
bool AllowMoreInput(sal_Unicode uChar)
OUString StringToReplace()
static TransferableDataHelper CreateFromClipboard(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rClipboard)
bool GetString(SotClipboardFormatId nFormat, OUString &rStr) const
css::uno::Reference< css::io::XInputStream > GetInputStream(SotClipboardFormatId nFormat, const OUString &rDestDoc) const
bool HasFormat(SotClipboardFormatId nFormat) const
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable() const
reference_type * get() const
static css::uno::Reference< css::embed::XStorage > GetStorageFromInputStream(const css::uno::Reference< css::io::XInputStream > &xStream, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
void SetFontSize(const Size &)
void SetColor(const Color &)
void SetWeight(FontWeight)
void SetAlignment(TextAlign)
sal_uInt16 GetCode() const
KeyFuncType GetFunction() const
bool getBoolValue(const OUString &i_rPropertyName, bool i_bDefault) const
sal_Int64 getIntValue(const OUString &i_rPropertyName, sal_Int64 i_nDefault) const
vcl::Window * GetParent() const
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
SmBracketType
Bracket types that can be inserted.
@ Round
Round brackets, left command "(".
@ Square
Square brackets, left command "[".
@ Curly
Curly brackets, left command "lbrace".
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
virtual void SetText(const OUString &rStr) override
virtual SfxBindings & GetBindings() override
virtual void SetHelpId(const OUString &) override
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell)
constexpr OUStringLiteral MATHML_XML
void SmGetLeftSelectionPart(const ESelection &rSel, sal_Int32 &nPara, sal_uInt16 &nPos)
#define EDITUNDO_REPLACEALL
constexpr OUStringLiteral HID_SMA_WIN_DOCUMENT
constexpr OUStringLiteral HID_SMA_MAIN_HELP
constexpr OUStringLiteral HID_SMA_COMMAND_WIN
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_F1
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_BACKSPACE
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
constexpr OUStringLiteral aData
SfxDispatcher * GetDispatcher()
OString stripStart(const OString &rIn, char c)
Reference< XComponentContext > getProcessComponentContext()
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
constexpr T & temporary(T &&x)
SwAbstractDialogFactory & GetFactory()
UNOTOOLS_DLLPUBLIC bool GetTitle(OUString const &url, OUString *title)
HashMap_OWString_Interface aMap
#define SFX_OBJECTBAR_TOOLS
VCL_DLLPUBLIC void InvertFocusRect(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
#define STYLE_CURSOR_NOBLINKTIME
OUString SmResId(TranslateId aId)
Reference< XController > xController
Reference< XFrame > xFrame
Reference< XModel > xModel
constexpr OUStringLiteral PRTUIOPT_TITLE_ROW
constexpr OUStringLiteral PRTUIOPT_BORDER
constexpr OUStringLiteral PRTUIOPT_PRINT_SCALE
constexpr OUStringLiteral PRTUIOPT_PRINT_FORMAT
constexpr OUStringLiteral PRTUIOPT_FORMULA_TEXT
IMPL_LINK_NOARG(SmGraphicWindow, ScrollHdl, weld::ScrolledWindow &, void)
SFX_IMPL_NAMED_VIEWFACTORY(SmViewShell, "Default")
IMPL_LINK(SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper *, _pFileDlg, void)
#define CMD_BOX_PADDING_TOP
SFX_IMPL_DOCKINGWINDOW_WITHID(SmCmdBoxWrapper, SID_CMDBOXWINDOW)
#define SFX_PRINTERROR_BUSY
#define SFX_VIEW_REGISTRATION(DocClass)