20#include <config_wasm_strip.h>
45#include <editeng/editeng.hxx>
78#include <osl/diagnose.h>
89void collectUIInformation(
const OUString& aevent ,
const OUString& aID )
92 aDescription.
aID = aID;
95 aDescription.
aParent =
"MainWindow";
96 aDescription.
aKeyWord =
"SwEditWinUIObject";
104#define METABUTTON_WIDTH 16
105#define METABUTTON_HEIGHT 18
106#define POSTIT_MINIMUMSIZE_WITHOUT_META 50
112 if (bMenuButtonVisible)
129 rRenderContext.
Pop();
131 rRenderContext.
Pop();
133 pProcessor->process(
mpAnchor->getOverlayObjectPrimitive2DSequence());
141 if (bMenuButtonVisible)
148 return aRectangleLogic.
Contains(rPointLogic);
178 int x,
y, width, height;
191 int x,
y, width, height;
204 int x,
y, width, height;
218 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
220 *pDev, aNewViewInfos ));
223 pProcessor->process(
mpAnchor->getOverlayObjectPrimitive2DSequence());
228 if (
mxVScrollbar->get_vpolicy() != VclPolicyType::NEVER)
232 int x,
y, width, height;
274 mpAnchor->SetAnchorState(AnchorState::All);
354 nCntrl |= EEControlBits::MARKFIELDS | EEControlBits::PASTESPECIAL | EEControlBits::AUTOCORRECT | EEControlBits::USECHARATTRIBS;
356 nCntrl |= EEControlBits::MARKFIELDS;
360 nCntrl |= EEControlBits::ONLINESPELLING;
373 OUString aText =
mxMenuButton->get_item_label(
"deleteby");
376 aText = aRewriter.
Apply(aText);
409 else if (sMeta.getLength() > 23)
411 sMeta = OUString::Concat(sMeta.subView(0, 20)) +
"...";
421 sMeta = rLocalData.
getDate(aDate);
462 xVirDev->SetOutputSizePixel(aSize);
464 Gradient aGradient(GradientStyle::Linear,
467 xVirDev->DrawGradient(aRect, aGradient);
470 xVirDev->SetFillColor();
472 xVirDev->DrawRect(aRect);
476 const tools::Long nBorderDistanceLeftAndRight = ((aSymbolRect.
GetWidth() * 250) + 500) / 1000;
477 aSymbolRect.
AdjustLeft(nBorderDistanceLeftAndRight );
478 aSymbolRect.
AdjustRight( -nBorderDistanceLeftAndRight );
481 aSymbolRect.
AdjustTop(nBorderDistanceTop );
487 DrawSymbolFlags::NONE);
525 bool bChange =
false;
557 OSL_FAIL(
"<SwAnnotationWin::SetPosAndSize()> - unexpected position of sidebar" );
566 Size aSize(aLineEnd.getX() - aLineStart.getX(), aLineEnd.getY() - aLineStart.getY());
568 aLineEnd = aLineStart;
585 mpAnchor = AnchorOverlayObject::CreateAnchorOverlayObject(
mrView,
594 mpAnchor->SetAnchorState(AnchorState::Tri);
629 mpAnchor->SetAnchorState(AnchorState::End);
637 mpAnchor->SetAnchorState(AnchorState::All);
641 if ( pWin !=
this && pWin->
Anchor() )
668 if ( bTableCursorNeeded )
674 pTmpCursor = pTableCursor;
681 pTmpCursor = pCursor;
683 std::unique_ptr<SwShellCursor> pTmpCursorForAnnotationTextRange( pTmpCursor );
692 pTmpCursorForAnnotationTextRange->FillRects();
697 SwRects* pRects(pTmpCursorForAnnotationTextRange.get());
698 for(
const SwRect & rNextRect : *pRects)
702 aPntRect.
Left(), aPntRect.
Top(),
753 if (aTextHeight > aHeight)
755 const int nThickness =
mxVScrollbar->get_scroll_thickness();
759 aWidth -= nThickness;
770 if (
mxVScrollbar->get_vpolicy() == VclPolicyType::NEVER)
787 int nStepIncrement =
mpOutliner->GetTextHeight() / 10;
799 nPageSize =
std::min(nPageSize, nUpper);
801 mxVScrollbar->vadjustment_configure(nCurrentDocPos, 0, nUpper,
802 nStepIncrement, nPageIncrement, nPageSize);
827 if (aOldHeight != aNewHeight)
836 if (aNewLowerValue < aBorder)
899 IDocumentUndoRedo& rUndoRedo(
901 const bool bDocUndoEnabled = rUndoRedo.DoesUndo();
902 const bool bOutlinerUndoEnabled =
mpOutliner->IsUndoEnabled();
903 const bool bOutlinerModified =
mpOutliner->IsModified();
904 const bool bDisableAndRestoreUndoMode = !bDocUndoEnabled && bOutlinerUndoEnabled;
906 if (bDisableAndRestoreUndoMode)
920 aEditAttr.
Put(rNewItem);
923 if (!
mpOutliner->IsUndoEnabled() && !bOutlinerModified)
941 nCntrl |= EEControlBits::ONLINESPELLING;
949 if (bDisableAndRestoreUndoMode)
977 collectUIInformation(
"SHOW",
get_id());
987 mpAnchor->SetAnchorState(AnchorState::Tri);
995 collectUIInformation(
"HIDE",
get_id());
1071 rBnd.
Update(SID_ATTR_INSERT);
1086 if (!
mpOutliner->GetEditEngine().GetText().isEmpty())
1130 aItems[1] =
nullptr;
1159 if (rMEvt.IsEnterWindow())
1164 SetViewState(ViewState::VIEW);
1168 else if (rMEvt.IsLeaveWindow())
1170 mbMouseOver =
false;
1173 SetViewState(ViewState::NORMAL);
1207 tools::Long nDiff = GetOutlinerView()->GetEditView().GetVisArea().Top() - rScrolledWindow.vadjustment_get_value();
1208 GetOutlinerView()->Scroll( 0, nDiff );
1213 mrView.GetDocShell()->SetModified();
1218 mnDeleteEventId =
nullptr;
1239 sal_Int32 nRequiredHeight = 0;
1241 for (
int i = 0;
i < fields; ++
i)
1244 return nRequiredHeight;
1268 nCntrl |= EEControlBits::ONLINESPELLING;
1281 case ViewState::EDIT:
1285 mpAnchor->SetAnchorState(AnchorState::All);
1288 if ( pWin !=
this && pWin->
Anchor() )
1302 case ViewState::VIEW:
1316 case ViewState::NORMAL:
1324 mpAnchor->SetAnchorState(AnchorState::End);
1330 if ( ( pTopWinSelf !=
this ) &&
1331 ( pTopWinSelf != pTopWinActive ) &&
1337 if ( pTopWinSelf->
TextRange() !=
nullptr )
1366 pTopNote = pSidebarWin;
1381 collectUIInformation(
"LEAVE",
get_id());
1385 const Color& aChangeColor )
1408#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1410 if ( bAnchorChanged )
1419#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1423 if ( bAnchorChanged )
1434#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
sal_Int32 GetMinimumSizeWithMeta() const
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.
static bool IsFieldShadings()
bool IsOnlineSpell() const
vcl::RenderContext * GetOut() const
const SwViewOption * GetViewOptions() const
SwWrtShell & GetWrtShell() const
SwWrtShell * GetWrtShellPtr() const
SwDocShell * GetDocShell()
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
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 OString &, 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