20#include <config_wasm_strip.h>
45#include <editeng/editeng.hxx>
81#include <osl/diagnose.h>
92void collectUIInformation(
const OUString& aevent ,
const OUString& aID )
95 aDescription.
aID = aID;
98 aDescription.
aParent =
"MainWindow";
99 aDescription.
aKeyWord =
"SwEditWinUIObject";
107#define METABUTTON_WIDTH 16
108#define METABUTTON_HEIGHT 18
109#define POSTIT_MINIMUMSIZE_WITHOUT_META 50
115 if (bMenuButtonVisible)
132 rRenderContext.
Pop();
134 rRenderContext.
Pop();
136 pProcessor->process(
mpAnchor->getOverlayObjectPrimitive2DSequence());
144 if (bMenuButtonVisible)
151 return aRectangleLogic.
Contains(rPointLogic);
188 int x,
y, width, height;
201 int x,
y, width, height;
214 int x,
y, width, height;
228 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
230 *pDev, aNewViewInfos ));
233 pProcessor->process(
mpAnchor->getOverlayObjectPrimitive2DSequence());
238 if (
mxVScrollbar->get_vpolicy() != VclPolicyType::NEVER)
242 int x,
y, width, height;
289 mpAnchor->SetAnchorState(AnchorState::All);
360 nCntrl |= EEControlBits::MARKFIELDS | EEControlBits::PASTESPECIAL | EEControlBits::AUTOCORRECT | EEControlBits::USECHARATTRIBS;
367 const SwViewOption* pVOpt = pWrtShell->GetViewOptions();
369 nCntrl |= EEControlBits::MARKFIELDS;
373 nCntrl |= EEControlBits::ONLINESPELLING;
387 OUString aText =
mxMenuButton->get_item_label(
"deleteby");
390 aText = aRewriter.
Apply(aText);
422 else if (sMeta.getLength() > 23)
424 sMeta = OUString::Concat(sMeta.subView(0, 20)) +
"...";
434 sMeta = rLocalData.
getDate(aDate);
478 xVirDev->SetOutputSizePixel(aSize);
480 Gradient aGradient(css::awt::GradientStyle_LINEAR,
483 xVirDev->DrawGradient(aRect, aGradient);
486 xVirDev->SetFillColor();
488 xVirDev->DrawRect(aRect);
492 const tools::Long nBorderDistanceLeftAndRight = ((aSymbolRect.
GetWidth() * 250) + 500) / 1000;
493 aSymbolRect.
AdjustLeft(nBorderDistanceLeftAndRight );
494 aSymbolRect.
AdjustRight( -nBorderDistanceLeftAndRight );
497 aSymbolRect.
AdjustTop(nBorderDistanceTop );
503 DrawSymbolFlags::NONE);
545 bool bChange =
false;
577 OSL_FAIL(
"<SwAnnotationWin::SetPosAndSize()> - unexpected position of sidebar" );
588 aLineEnd = aLineStart;
605 mpAnchor = AnchorOverlayObject::CreateAnchorOverlayObject(
mrView,
614 mpAnchor->SetAnchorState(AnchorState::Tri);
649 mpAnchor->SetAnchorState(AnchorState::End);
657 mpAnchor->SetAnchorState(AnchorState::All);
661 if ( pWin !=
this && pWin->
Anchor() )
688 if ( bTableCursorNeeded )
694 pTmpCursor = pTableCursor;
701 pTmpCursor = pCursor;
703 std::unique_ptr<SwShellCursor> pTmpCursorForAnnotationTextRange( pTmpCursor );
712 pTmpCursorForAnnotationTextRange->FillRects();
717 SwRects* pRects(pTmpCursorForAnnotationTextRange.get());
718 for(
const SwRect & rNextRect : *pRects)
722 aPntRect.
Left(), aPntRect.
Top(),
773 if (aTextHeight > aHeight)
775 const int nThickness =
mxVScrollbar->get_scroll_thickness();
779 aWidth -= nThickness;
790 if (
mxVScrollbar->get_vpolicy() == VclPolicyType::NEVER)
807 int nStepIncrement =
mpOutliner->GetTextHeight() / 10;
819 nPageSize =
std::min(nPageSize, nUpper);
821 mxVScrollbar->vadjustment_configure(nCurrentDocPos, 0, nUpper,
822 nStepIncrement, nPageIncrement, nPageSize);
847 if (aOldHeight != aNewHeight)
856 if (aNewLowerValue < aBorder)
939 collectUIInformation(
"SHOW",
get_id());
949 mpAnchor->SetAnchorState(AnchorState::Tri);
957 collectUIInformation(
"HIDE",
get_id());
975 mpOutlinerView->GetEditView().SetInsertMode(pWrtShell->IsInsMode());
1034 rBnd.
Update(SID_ATTR_INSERT);
1049 if (!
mpOutliner->GetEditEngine().GetText().isEmpty())
1100 aItems[1] =
nullptr;
1129 if (rMEvt.IsEnterWindow())
1134 SetViewState(ViewState::VIEW);
1138 else if (rMEvt.IsLeaveWindow())
1140 mbMouseOver =
false;
1143 SetViewState(ViewState::NORMAL);
1177 tools::Long nDiff = GetOutlinerView()->GetEditView().GetVisArea().Top() - rScrolledWindow.vadjustment_get_value();
1178 GetOutlinerView()->Scroll( 0, nDiff );
1183 mrView.GetDocShell()->SetModified();
1188 mnDeleteEventId =
nullptr;
1202 const Fraction& f(pWrtShell->GetOut()->GetMapMode().GetScaleY());
1215 sal_Int32 nRequiredHeight = 0;
1217 for (
int i = 0;
i < fields; ++
i)
1226 if ((rDCEvt.
GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE))
1246 const Fraction& f(pWrtShell->GetOut()->GetMapMode().GetScaleY());
1257 const SwViewOption* pVOpt = pWrtShell->GetViewOptions();
1259 mpOutliner->SetControlWord(nCntrl & ~EEControlBits::ONLINESPELLING);
1261 mpOutliner->SetControlWord(nCntrl | EEControlBits::ONLINESPELLING);
1272 case ViewState::EDIT:
1276 mpAnchor->SetAnchorState(AnchorState::All);
1279 if ( pWin !=
this && pWin->
Anchor() )
1293 case ViewState::VIEW:
1307 case ViewState::NORMAL:
1315 mpAnchor->SetAnchorState(AnchorState::End);
1321 if ( ( pTopWinSelf !=
this ) &&
1322 ( pTopWinSelf != pTopWinActive ) &&
1328 if ( pTopWinSelf->
TextRange() !=
nullptr )
1355 if (!pTopNote->IsFollow())
1373 collectUIInformation(
"LEAVE",
get_id());
1377 const Color& aChangeColor )
1400#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1402 if ( bAnchorChanged )
1411#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1415 if ( bAnchorChanged )
1426#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
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() 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 SetReadOnly(bool bReadOnly)
void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll)
void SetBackgroundColor(const Color &rColor)
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)
vcl::ExtOutDevData * GetExtOutDevData() const
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)
constexpr tools::Long Y() const
void Move(tools::Long nHorzMove, tools::Long nVertMove)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
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)
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.
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
SwDoc * GetDoc()
returns Doc. But be careful!
SfxStyleSheetPool * GetEEStyleSheetPool() const
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
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
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.
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)
::sw::overlay::OverlayRanges * TextRange()
OutlinerView * GetOutlinerView()
std::optional< sal_Int32 > moMetaHeight
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)
bool GetIsExportTaggedPDF() const
sal_Int32 WrapBeginStructureElement(PDFWriter::StructElement eType, const OUString &rAlias=OUString())
void EndStructureElement()
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
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)
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