20#include <config_wasm_strip.h>
45#include <editeng/editeng.hxx>
79#include <osl/diagnose.h>
90void collectUIInformation(
const OUString& aevent ,
const OUString& aID )
93 aDescription.
aID = aID;
96 aDescription.
aParent =
"MainWindow";
97 aDescription.
aKeyWord =
"SwEditWinUIObject";
105#define METABUTTON_WIDTH 16
106#define METABUTTON_HEIGHT 18
107#define POSTIT_MINIMUMSIZE_WITHOUT_META 50
113 if (bMenuButtonVisible)
130 rRenderContext.
Pop();
132 rRenderContext.
Pop();
134 pProcessor->process(
mpAnchor->getOverlayObjectPrimitive2DSequence());
142 if (bMenuButtonVisible)
149 return aRectangleLogic.
Contains(rPointLogic);
179 int x,
y, width, height;
192 int x,
y, width, height;
205 int x,
y, width, height;
219 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
221 *pDev, aNewViewInfos ));
224 pProcessor->process(
mpAnchor->getOverlayObjectPrimitive2DSequence());
229 if (
mxVScrollbar->get_vpolicy() != VclPolicyType::NEVER)
233 int x,
y, width, height;
275 mpAnchor->SetAnchorState(AnchorState::All);
354 nCntrl |= EEControlBits::MARKFIELDS | EEControlBits::PASTESPECIAL | EEControlBits::AUTOCORRECT | EEControlBits::USECHARATTRIBS;
358 const SwViewOption* pVOpt = pWrtShell->GetViewOptions();
360 nCntrl |= EEControlBits::MARKFIELDS;
364 nCntrl |= EEControlBits::ONLINESPELLING;
378 OUString aText =
mxMenuButton->get_item_label(
"deleteby");
381 aText = aRewriter.
Apply(aText);
414 else if (sMeta.getLength() > 23)
416 sMeta = OUString::Concat(sMeta.subView(0, 20)) +
"...";
426 sMeta = rLocalData.
getDate(aDate);
470 xVirDev->SetOutputSizePixel(aSize);
472 Gradient aGradient(css::awt::GradientStyle_LINEAR,
475 xVirDev->DrawGradient(aRect, aGradient);
478 xVirDev->SetFillColor();
480 xVirDev->DrawRect(aRect);
484 const tools::Long nBorderDistanceLeftAndRight = ((aSymbolRect.
GetWidth() * 250) + 500) / 1000;
485 aSymbolRect.
AdjustLeft(nBorderDistanceLeftAndRight );
486 aSymbolRect.
AdjustRight( -nBorderDistanceLeftAndRight );
489 aSymbolRect.
AdjustTop(nBorderDistanceTop );
495 DrawSymbolFlags::NONE);
537 bool bChange =
false;
569 OSL_FAIL(
"<SwAnnotationWin::SetPosAndSize()> - unexpected position of sidebar" );
578 Size aSize(aLineEnd.getX() - aLineStart.getX(), aLineEnd.getY() - aLineStart.getY());
580 aLineEnd = aLineStart;
597 mpAnchor = AnchorOverlayObject::CreateAnchorOverlayObject(
mrView,
606 mpAnchor->SetAnchorState(AnchorState::Tri);
641 mpAnchor->SetAnchorState(AnchorState::End);
649 mpAnchor->SetAnchorState(AnchorState::All);
653 if ( pWin !=
this && pWin->
Anchor() )
680 if ( bTableCursorNeeded )
686 pTmpCursor = pTableCursor;
693 pTmpCursor = pCursor;
695 std::unique_ptr<SwShellCursor> pTmpCursorForAnnotationTextRange( pTmpCursor );
704 pTmpCursorForAnnotationTextRange->FillRects();
709 SwRects* pRects(pTmpCursorForAnnotationTextRange.get());
710 for(
const SwRect & rNextRect : *pRects)
714 aPntRect.
Left(), aPntRect.
Top(),
765 if (aTextHeight > aHeight)
767 const int nThickness =
mxVScrollbar->get_scroll_thickness();
771 aWidth -= nThickness;
782 if (
mxVScrollbar->get_vpolicy() == VclPolicyType::NEVER)
799 int nStepIncrement =
mpOutliner->GetTextHeight() / 10;
811 nPageSize =
std::min(nPageSize, nUpper);
813 mxVScrollbar->vadjustment_configure(nCurrentDocPos, 0, nUpper,
814 nStepIncrement, nPageIncrement, nPageSize);
839 if (aOldHeight != aNewHeight)
848 if (aNewLowerValue < aBorder)
911 IDocumentUndoRedo& rUndoRedo(
913 const bool bDocUndoEnabled = rUndoRedo.DoesUndo();
914 const bool bOutlinerUndoEnabled =
mpOutliner->IsUndoEnabled();
915 const bool bOutlinerModified =
mpOutliner->IsModified();
916 const bool bDisableAndRestoreUndoMode = !bDocUndoEnabled && bOutlinerUndoEnabled;
918 if (bDisableAndRestoreUndoMode)
932 aEditAttr.
Put(rNewItem);
935 if (!
mpOutliner->IsUndoEnabled() && !bOutlinerModified)
952 const SwViewOption* pVOpt = pWrtShell->GetViewOptions();
955 nCntrl |= EEControlBits::ONLINESPELLING;
964 if (bDisableAndRestoreUndoMode)
992 collectUIInformation(
"SHOW",
get_id());
1002 mpAnchor->SetAnchorState(AnchorState::Tri);
1010 collectUIInformation(
"HIDE",
get_id());
1028 mpOutlinerView->GetEditView().SetInsertMode(pWrtShell->IsInsMode());
1087 rBnd.
Update(SID_ATTR_INSERT);
1102 if (!
mpOutliner->GetEditEngine().GetText().isEmpty())
1153 aItems[1] =
nullptr;
1182 if (rMEvt.IsEnterWindow())
1187 SetViewState(ViewState::VIEW);
1191 else if (rMEvt.IsLeaveWindow())
1193 mbMouseOver =
false;
1196 SetViewState(ViewState::NORMAL);
1230 tools::Long nDiff = GetOutlinerView()->GetEditView().GetVisArea().Top() - rScrolledWindow.vadjustment_get_value();
1231 GetOutlinerView()->Scroll( 0, nDiff );
1236 mrView.GetDocShell()->SetModified();
1241 mnDeleteEventId =
nullptr;
1256 const Fraction& f(pWrtShell->GetOut()->GetMapMode().GetScaleY());
1267 sal_Int32 nRequiredHeight = 0;
1269 for (
int i = 0;
i < fields; ++
i)
1272 return nRequiredHeight;
1289 const Fraction& f(pWrtShell->GetOut()->GetMapMode().GetScaleY());
1300 const SwViewOption* pVOpt = pWrtShell->GetViewOptions();
1303 nCntrl |= EEControlBits::ONLINESPELLING;
1317 case ViewState::EDIT:
1321 mpAnchor->SetAnchorState(AnchorState::All);
1324 if ( pWin !=
this && pWin->
Anchor() )
1338 case ViewState::VIEW:
1352 case ViewState::NORMAL:
1360 mpAnchor->SetAnchorState(AnchorState::End);
1366 if ( ( pTopWinSelf !=
this ) &&
1367 ( pTopWinSelf != pTopWinActive ) &&
1373 if ( pTopWinSelf->
TextRange() !=
nullptr )
1402 pTopNote = pSidebarWin;
1417 collectUIInformation(
"LEAVE",
get_id());
1421 const Color& aChangeColor )
1444#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1446 if ( bAnchorChanged )
1455#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1459 if ( bAnchorChanged )
1470#if !ENABLE_WASM_STRIP_ACCESSIBILITY
#define POSTIT_MINIMUMSIZE_WITHOUT_META
#define METABUTTON_HEIGHT
const StyleSettings & GetStyleSettings() const
static bool GetLayoutRTL()
static const AllSettings & GetSettings()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
sal_uInt8 GetBlue() const
sal_uInt8 GetGreen() const
bool IsValidAndGregorian() const
void DrawSymbol(const tools::Rectangle &rRect, SymbolType eType, const Color &rColor, DrawSymbolFlags nStyle=DrawSymbolFlags::NONE)
ESelection GetSelection() const
void SetSelection(const ESelection &rNewSel)
std::unique_ptr< weld::Builder > m_xBuilder
void UnclipVisibleSysObj()
std::unique_ptr< weld::Container > m_xContainer
OUString getDate(const Date &rDate) const
OUString getTime(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
void SetOrigin(const Point &rOrigin)
const Fraction & GetScaleY() const
void SetSelection(const ESelection &)
void SetReadOnly(bool bReadOnly)
void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll)
void SetBackgroundColor(const Color &rColor)
ESelection GetSelection() const
void SetAttribs(const SfxItemSet &)
void StartSpeller(weld::Widget *pDialogParent)
EditView & GetEditView() const
void ShowCursor(bool bGotoCursor=true, bool bActivate=false)
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
void SetTextColor(const Color &rColor)
const MapMode & GetMapMode() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
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)
void IntersectClipRegion(const tools::Rectangle &rRect)
void Update(sal_uInt16 nId)
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SfxItemPool & GetPool() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
SfxViewFrame & GetViewFrame() const
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
constexpr tools::Long getWidth() const
constexpr tools::Long Width() const
const vcl::Font & GetLabelFont() const
const LocaleDataWrapper & GetLocaleData() const
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
SwDoc * GetDoc()
returns Doc. But be careful!
IDocumentUndoRedo & GetIDocumentUndoRedo()
void SetCalcFieldValueHdl(Outliner *pOutliner)
In the Outliner, set a link to the method for field display in edit objects.
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
const SwStartNode * FindTableBoxStartNode() const
const SwPosition * GetMark() const
void SetParentId(const sal_uInt32 nParentId)
sal_Int32 GetMinimumSizeWithMeta() const
SwPostItField * GetLatestPostItField()
static Color GetColorDark(std::size_t aAuthorIndex)
void RegisterAnswer(const OutlinerParaObject *pAnswer)
static Color GetColorAnchor(std::size_t aAuthorIndex)
void ConnectSidebarWinToFrame(const SwFrame &rFrame, const SwFormatField &rFormatField, sw::annotation::SwAnnotationWin &rSidebarWin)
static Color GetColorLight(std::size_t aAuthorIndex)
void SetActiveSidebarWin(sw::annotation::SwAnnotationWin *p)
bool IsShowAnchor() const
sw::annotation::SwAnnotationWin * GetNextPostIt(sal_uInt16 aDirection, sw::annotation::SwAnnotationWin *aPostIt)
void DisconnectSidebarWinFromFrame(const SwFrame &rFrame, sw::annotation::SwAnnotationWin &rSidebarWin)
sw::annotation::SwAnnotationWin * GetActiveSidebarWin()
SW_DLLPUBLIC bool HasActiveSidebarWin() const
void AssureStdModeAtShell()
tools::Long GetNextBorder()
void UpdateResolvedStatus(const sw::annotation::SwAnnotationWin *topNote)
Of course Writer needs its own rectangles.
void Bottom(const tools::Long nBottom)
void Left(const tools::Long nLeft)
void AddRule(SwUndoArg eWhat, const OUString &rWith)
OUString Apply(const OUString &rStr) const
Represents the current text cursor of one opened edit window.
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
sal_Int32 GetStart() const
SwTextNode * GetpTextNode() const
SwTextNode is a paragraph in the document model.
bool IsOnlineSpell() const
bool IsFieldShadings() const
vcl::RenderContext * GetOut() const
SwWrtShell & GetWrtShell() const
SwWrtShell * GetWrtShellPtr() const
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
reference_type * get() const
void SetPosSizePixelRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const SwRect &aAnchorRect, const tools::Long PageBorder)
SwPostItHelper::SwLayoutStatus mLayoutStatus
int GetPrefScrollbarWidth() const
void UnsetActiveSidebarWin()
void SwitchToPostIt(sal_uInt16 aDirection)
void PaintTile(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
sw::sidebarwindows::SidebarPosition meSidebarPosition
std::unique_ptr< sw::overlay::OverlayRanges > mpTextRangeOverlay
const SwFrame * mpAnchorFrame
std::unique_ptr< weld::Label > mxMetadataResolved
bool IsScrollbarVisible() const
bool IsReadOnlyOrProtected() const
std::unique_ptr< Outliner > mpOutliner
::sw::sidebarwindows::AnchorOverlayObject * Anchor()
SwAnnotationWin * GetTopReplyNote()
Find the first annotation for the thread which this annotation is in.
virtual void GetFocus() override
void SetColor(Color aColorDark, Color aColorLight, Color aColorAnchor)
sal_Int32 GetNumFields() const
void SetSizePixel(const Size &rNewSize) override
void DrawForPage(OutputDevice *pDev, const Point &rPos)
tools::Rectangle mPosSize
std::unique_ptr< sw::sidebarwindows::AnchorOverlayObject > mpAnchor
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
std::unique_ptr< OutlinerView > mpOutlinerView
OUString GetAuthor() const
void SetVirtualPosSize(const Point &aPoint, const Size &aSize)
std::unique_ptr< weld::CustomWeld > mxSidebarTextControlWin
sal_Int32 GetMetaHeight() const
tools::Long GetPostItTextHeight()
void TranslateTopPosition(const tools::Long aAmount)
void LockView(bool bLock)
bool IsHitWindow(const Point &rPointLogic)
Is there a matching sub-widget inside this sidebar widget for rPointLogic?
sal_Int32 GetMinimumSizeWithoutMeta() const
void SetCursorLogicPosition(const Point &rPosition, bool bPoint, bool bClearMark)
Allows adjusting the point or mark of the selection to a document coordinate.
void SetLanguage(const SvxLanguageItem &rNewItem)
sal_Int32 GetMinimumSizeWithMeta() const
std::unique_ptr< weld::MenuButton > mxMenuButton
bool SetActiveSidebarWin()
rtl::Reference< sw::sidebarwindows::SidebarWinAccessible > mxSidebarWinAccessible
void SetViewState(::sw::sidebarwindows::ViewState bViewState)
std::vector< basegfx::B2DRange > maAnnotationTextRanges
void SetChangeTracking(const SwPostItHelper::SwLayoutStatus aStatus, const Color &aColor)
std::unique_ptr< sw::sidebarwindows::ShadowOverlayObject > mpShadow
void ShowAnchorOnly(const Point &aPoint)
void SetSize(const Size &rNewSize)
void SetResolved(bool resolved)
ImplSVEvent * mnDeleteEventId
std::unique_ptr< weld::ScrolledWindow > mxVScrollbar
void ExecuteCommand(sal_uInt16 nSlot)
SvxLanguageItem GetLanguage() const
::sw::overlay::OverlayRanges * TextRange()
OutlinerView * GetOutlinerView()
tools::Time GetTime() const
std::unique_ptr< weld::Label > mxMetadataDate
std::unique_ptr< sw::sidebarwindows::SidebarTextControl > mxSidebarTextControl
std::unique_ptr< weld::Label > mxMetadataAuthor
void SetSidebarPosition(sw::sidebarwindows::SidebarPosition eSidebarPosition)
bool HasScrollbar() const
void SetReadonly(bool bSet)
SwSidebarItem & mrSidebarItem
void ChangeSidebarItem(SwSidebarItem const &rSidebarItem)
virtual void LoseFocus() override
void ResizeIfNecessary(tools::Long aOldHeight, tools::Long aNewHeight)
void SetMenuButtonColors()
static std::unique_ptr< OverlayRanges > CreateOverlayRange(SwView const &rDocView, const Color &rColor, std::vector< basegfx::B2DRange > &&rRanges, const bool bShowSolidBorder)
tools::Long GetFontHeight() const
void SetFontHeight(tools::Long nHeight)
void SetStyle(WinBits nStyle)
vcl::Window * GetParent() const
bool HasChildPathFocus(bool bSystemWindow=false) const
Point LogicToPixel(const Point &rLogicPt) const
const OUString & get_id() const
virtual void SetSizePixel(const Size &rNewSize)
Size get_preferred_size() const
virtual Point GetPosPixel() const
bool IsMapModeEnabled() const
void GrabFocusToDocument()
const MapMode & GetMapMode() const
const Color & GetTextColor() const
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual void SetPosPixel(const Point &rNewPos)
void EnableMapMode(bool bEnable=true)
#define FN_DELETE_NOTE_AUTHOR
#define FN_HIDE_NOTE_AUTHOR
#define FN_HIDE_ALL_NOTES
#define FN_DELETE_ALL_NOTES
#define FN_DELETE_COMMENT
#define FN_DELETE_COMMENT_THREAD
#define FN_RESOLVE_NOTE_THREAD
#define FN_FORMAT_ALL_NOTES
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
ESelection aNewSelection(GetSelection())
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
std::deque< AttacherIndex_Impl > aIndex
constexpr sal_uInt16 KEY_PAGEUP
#define LINK(Instance, Class, Member)
void setTiledPainting(bool bTiledPainting)
bool isTiledAnnotations()
std::unique_ptr< BaseProcessor2D > createProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
IMPL_LINK(SwAnnotationWin, SelectHdl, const OUString &, rIdent, void)
IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, weld::Toggleable &, void)
static Color ColorFromAlphaColor(const sal_uInt8 aTransparency, const Color &aFront, const Color &aBack)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
std::map< OUString, OUString > aParameters
SwNodeOffset mnStartNodeIdx
const SwFrame * mpAnchorFrame
bool mPositionFromCommentAnchor
If true, the overlay arrow points to the comment anchor, otherwise it points to the commented frame.
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
OUString SwResId(TranslateId aId)
std::vector< SwRect > SwRects
css::drawing::Direction3D aDirection
WinBits const WB_DIALOGCONTROL