21 #include <strings.hrc>
29 :
InterimItemWindow(pEditWin,
"modules/swriter/ui/outlinebutton.ui",
"OutlineButton")
30 , m_xShowBtn(m_xBuilder->weld_button(
"show"))
31 , m_xHideBtn(m_xBuilder->weld_button(
"hide"))
32 , m_pEditWin(pEditWin)
34 , m_nDelayAppearing(0)
35 , m_aDelayTimer(
"SwOutlineContentVisibilityWin m_aDelayTimer")
44 auto nDim = std::max(aBtnsSize.Width(), aBtnsSize.Height());
114 (
void)rOutlineNodes.
Seek_Entry(static_cast<SwNode*>(const_cast<SwTextNode*>(pTextNode)),
119 const_cast<SwTextNode*
>(pTextNode)->GetAttrOutlineContentVisible(bVisible);
126 OUString sQuickHelp(
SwResId(STR_OUTLINE_CONTENT_TOGGLE_VISIBILITY));
130 sQuickHelp +=
" (" +
SwResId(STR_OUTLINE_CONTENT_TOGGLE_VISIBILITY_EXT) +
")";
172 if (rMEvt.IsLeaveWindow())
180 = GetEditWin()->LogicToPixel(GetFrame()->getFrameArea().SVRect());
181 auto nY = GetPosPixel().
getY() + rMEvt.GetPosPixel().getY();
182 if (nY <= 0 || nY <= aFrameAreaPxRect.
Top() || nY >= aFrameAreaPxRect.
Bottom()
183 || nY >= GetEditWin()->GetSizePixel().Height())
185 GetEditWin()->SetSavedOutlineFrame(
nullptr);
186 GetEditWin()->GetFrameControlsManager().RemoveControlsByType(
192 else if (rMEvt.IsEnterWindow())
197 if (GetFrame() != GetEditWin()->GetSavedOutlineFrame())
199 SwFrameControlPtr pFrameControl = GetEditWin()->GetFrameControlsManager().GetControl(
207 GetEditWin()->GetFrameControlsManager().RemoveControlsByType(
213 GetEditWin()->SetSavedOutlineFrame(
214 static_cast<SwTextFrame*>(const_cast<SwFrame*>(GetFrame())));
216 if (!m_bDestroyed && m_aDelayTimer.IsActive())
217 m_aDelayTimer.Stop();
219 SetZOrder(
this, ZOrderFlags::First);
228 GetEditWin()->ToggleOutlineContentVisibility(m_nOutlinePos, rMEvt.IsRight());
234 const int TICKS_BEFORE_WE_APPEAR = 3;
235 if (m_nDelayAppearing < TICKS_BEFORE_WE_APPEAR)
238 m_aDelayTimer.Start();
241 if (GetEditWin()->GetSavedOutlineFrame() == GetFrame())
243 m_aDelayTimer.Stop();
virtual Point GetPosPixel() const
#define LINK(Instance, Class, Member)
Base class of the Writer layout elements.
Represents the visualization of a paragraph.
Marks a position in the document model.
const SwNodes & GetNodes() const
std::unique_ptr< weld::Button > m_xHideBtn
virtual bool Contains(const Point &rDocPt) const override
Returns true if the point is inside the control.
void Left(const tools::Long nLeft)
const SwView & GetView() const
const IDocumentOutlineNodes * getIDocumentOutlineNodesAccess() const
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
const Color & GetFaceColor() const
virtual SwEditWin * GetEditWin() override
virtual Size GetSizePixel() const
virtual void SetSizePixel(const Size &rNewSize)
void SetSymbol(ButtonSymbol eTyle)
Of course Writer needs its own rectangles.
void SetQuickHelpText(const OUString &rHelpText)
SwWrtShell & GetWrtShell() const
void AddTop(const tools::Long nAdd)
Used by the UI to modify the document model.
OUString SwResId(TranslateId aId)
virtual const SwFrame * GetFrame() override
int m_nDelayAppearing
Before we show the control, wait a few timer ticks to avoid appearing with every mouse over...
const SwRect & getFrameArea() const
std::unique_ptr< weld::Button > m_xShowBtn
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
ButtonSymbol GetSymbol() const
SwTextNode * GetTextNodeFirst()
Point LogicToPixel(const Point &rLogicPt) const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
virtual int getOutlineLevel(const tSortedOutlineNodeList::size_type nIdx) const =0
IMPL_LINK_NOARG(SwOutlineContentVisibilityWin, DelayAppearHandler, Timer *, void)
virtual void Start(bool bStartTimer=true) override
virtual tSortedOutlineNodeList::size_type getOutlineNodesCount() const =0
Size get_preferred_size() const
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
void SetPaintTransparent(bool bTransparent)
virtual void ShowAll(bool bShow) override
void SetTimeout(sal_uInt64 nTimeoutMs)
SwTextNode is a paragraph in the document model.
SwOutlineContentVisibilityWin(SwEditWin *pEditWin, const SwFrame *pFrame)
const SwViewOption * GetViewOptions() const
virtual void dispose() override
::OutputDevice const * GetOutDev() const
bool IsRightToLeft() const
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void dispose() override
bool IsTreatSubOutlineLevelsAsContent() const
VclPtr< SwEditWin > m_pEditWin
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
std::shared_ptr< SwFrameControl > SwFrameControlPtr
std::vector< SwNode * >::size_type size_type
virtual void SetPosPixel(const Point &rNewPos)
void InitControlBase(weld::Widget *pWidget)
IMPL_LINK(SwOutlineContentVisibilityWin, MouseMoveHdl, const MouseEvent &, rMEvt, bool)
bool m_bDetectedRangeSegmentation false