20#ifndef INCLUDED_VCL_TOOLBOX_HXX
21#define INCLUDED_VCL_TOOLBOX_HXX
86 = std::numeric_limits<ImplToolItems::size_type>::max();
88 static constexpr auto ITEM_NOTFOUND
89 = std::numeric_limits<ImplToolItems::size_type>::max();
99 std::unique_ptr<ImplToolBoxPrivateData>
mpData;
162 using Window::ImplInit;
164 SAL_DLLPRIVATE
void InvalidateItem(ImplToolItems::size_type nPosition);
165 SAL_DLLPRIVATE
void InvalidateSpin(
bool bInvalidateUpper =
true,
166 bool bInvalidateLower =
true);
167 SAL_DLLPRIVATE
void InvalidateMenuButton();
169 SAL_DLLPRIVATE
void ImplInitToolBoxData();
172 SAL_DLLPRIVATE
void ImplInitSettings(
bool bFont,
bool bForeground,
bool bBackground );
174 SAL_DLLPRIVATE
bool ImplCalcItem();
175 SAL_DLLPRIVATE ImplToolItems::size_type ImplCalcBreaks(
tools::Long nWidth, sal_Int32* pMaxLineWidth,
bool bCalcHorz )
const;
176 SAL_DLLPRIVATE
void ImplFormat(
bool bResize =
false );
179 SAL_DLLPRIVATE
void ImplDrawItem(
vcl::RenderContext& rRenderContext, ImplToolItems::size_type nPos, sal_uInt16 nHighlight );
180 using Window::ImplInvalidate;
181 SAL_DLLPRIVATE
void ImplInvalidate(
bool bNewCalc =
false,
bool bFullPaint =
false );
182 SAL_DLLPRIVATE
void ImplUpdateItem( ImplToolItems::size_type nIndex = ITEM_NOTFOUND );
183 SAL_DLLPRIVATE
bool ImplHandleMouseMove(
const MouseEvent& rMEvt,
bool bRepeat =
false );
184 SAL_DLLPRIVATE
bool ImplHandleMouseButtonUp(
const MouseEvent& rMEvt,
bool bCancel =
false );
185 SAL_DLLPRIVATE
void ImplChangeHighlight(
ImplToolItem const * pItem,
bool bNoGrabFocus =
false );
186 SAL_DLLPRIVATE
bool ImplChangeHighlightUpDn(
bool bUp,
bool bNoCycle =
false );
187 SAL_DLLPRIVATE ImplToolItems::size_type ImplGetItemLine(
ImplToolItem const * pCurrentItem );
188 SAL_DLLPRIVATE
ImplToolItem* ImplGetFirstValidItem( ImplToolItems::size_type nLine );
189 SAL_DLLPRIVATE
bool ImplOpenItem(
vcl::KeyCode aKeyCode );
190 SAL_DLLPRIVATE
bool ImplActivateItem(
vcl::KeyCode aKeyCode );
191 SAL_DLLPRIVATE
void ImplShowFocus();
192 SAL_DLLPRIVATE
void ImplHideFocus();
193 SAL_DLLPRIVATE
void ImplUpdateInputEnable();
194 SAL_DLLPRIVATE
void ImplFillLayoutData();
195 SAL_DLLPRIVATE
bool ImplHasClippedItems();
197 SAL_DLLPRIVATE
bool ImplIsFloatingMode()
const;
198 SAL_DLLPRIVATE
bool ImplIsInPopupMode()
const;
199 SAL_DLLPRIVATE
const OUString& ImplGetHelpText(
ToolBoxItemId nItemId )
const;
200 SAL_DLLPRIVATE
Size ImplGetOptimalFloatingSize();
201 SAL_DLLPRIVATE
bool ImplHasExternalMenubutton()
const;
212 SAL_DLLPRIVATE
void ImplFloatControl(
bool bStart,
FloatingWindow* pWindow );
214 SAL_DLLPRIVATE
int ImplGetDragWidth()
const;
217 static SAL_DLLPRIVATE
int ImplGetDragWidth(
const vcl::Window& rWindow,
219 SAL_DLLPRIVATE
void ImplUpdateDragArea()
const;
222 SAL_DLLPRIVATE
void ImplCheckUpdate();
229 SAL_DLLPRIVATE
bool ImplDrawNativeBackground(
vcl::RenderContext& rRenderContext)
const;
230 SAL_DLLPRIVATE
void ImplDrawTransparentBackground(
const vcl::Region &rRegion);
237 SAL_DLLPRIVATE
const ImplToolItem *ImplGetFirstClippedItem()
const;
238 SAL_DLLPRIVATE
Size ImplCalcSize( ImplToolItems::size_type nCalcLines, sal_uInt16 nCalcMode = 0 );
239 SAL_DLLPRIVATE
void ImplCalcFloatSizes();
240 SAL_DLLPRIVATE
Size ImplCalcFloatSize( ImplToolItems::size_type& rLines );
241 SAL_DLLPRIVATE
void ImplCalcMinMaxFloatSize(
Size& rMinSize,
Size& rMaxSize );
242 SAL_DLLPRIVATE
void ImplSetMinMaxFloatSize();
243 SAL_DLLPRIVATE ImplToolItems::size_type ImplCalcLines(
tools::Long nToolSize )
const;
244 SAL_DLLPRIVATE sal_uInt16 ImplTestLineSize(
const Point& rPos )
const;
245 SAL_DLLPRIVATE
void ImplLineSizing(
const Point& rPos,
tools::Rectangle& rRect, sal_uInt16 nLineMode );
247 SAL_DLLPRIVATE
void ImplDrawMenuButton(
vcl::RenderContext& rRenderContext,
bool bHighlight);
248 SAL_DLLPRIVATE
void ImplDrawButton(
vcl::RenderContext& rRenderContext,
const tools::Rectangle &rRect, sal_uInt16 highlight,
bool bChecked,
bool bEnabled,
bool bIsWindow);
249 SAL_DLLPRIVATE ImplToolItems::size_type ImplCountLineBreaks()
const;
261 const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
263 virtual void dispose()
override;
265 virtual void Click();
277 virtual void Resize()
override;
297 virtual void InsertItem(
const OUString& rCommand,
298 const css::uno::Reference<css::frame::XFrame>& rFrame,
300 const Size& rRequestedSize,
301 ImplToolItems::size_type nPos = APPEND );
304 ImplToolItems::size_type nPos = APPEND );
306 const OUString& rText,
308 ImplToolItems::size_type nPos = APPEND );
309 void InsertItem(
ToolBoxItemId nItemId,
const OUString& rText,
310 const OUString& rCommand,
312 ImplToolItems::size_type nPos = APPEND );
315 ImplToolItems::size_type nPos = APPEND );
317 void InsertSeparator( ImplToolItems::size_type nPos = APPEND, sal_uInt16 nPixSize = 0 );
318 void InsertBreak( ImplToolItems::size_type nPos = APPEND );
319 void RemoveItem( ImplToolItems::size_type nPos );
335 void SetLineCount( ImplToolItems::size_type nNewLines );
336 void ShowLine(
bool bNext );
338 ImplToolItems::size_type GetItemCount()
const;
340 ImplToolItems::size_type GetItemPos(
ToolBoxItemId nItemId )
const;
341 ImplToolItems::size_type GetItemPos(
const Point& rPos )
const;
342 ToolBoxItemId GetItemId( ImplToolItems::size_type nPos )
const;
362 void SetItemWindowNonInteractive(
ToolBoxItemId nItemId,
bool bNonInteractive);
370 void SetItemImageMirrorMode(
ToolBoxItemId nItemId,
bool bMirror );
371 void SetItemText(
ToolBoxItemId nItemId,
const OUString& rText );
387 void EnableItem(
ToolBoxItemId nItemId,
bool bEnable =
true );
402 void SetItemCommand(
ToolBoxItemId nItemId,
const OUString& rCommand );
405 using Window::SetQuickHelpText;
407 using Window::GetQuickHelpText;
416 Size CalcWindowSizePixel();
418 Size CalcWindowSizePixel( ImplToolItems::size_type nCalcLines );
420 Size CalcWindowSizePixel( ImplToolItems::size_type nCalcLines,
WindowAlign eAlign );
422 Size CalcFloatingWindowSizePixel();
424 Size CalcFloatingWindowSizePixel( ImplToolItems::size_type nCalcLines );
426 Size CalcPopupWindowSizePixel();
429 Size CalcMinimumWindowSizePixel();
431 ImplToolItems::size_type GetFloatingLines()
const;
437 void Lock(
bool bLock );
439 static bool AlwaysLocked();
441 void EnableCustomize(
bool bEnable =
true );
468 bool IsMenuEnabled()
const;
470 void UpdateCustomMenu();
480 bool WillUsePopupMode()
const;
481 void WillUsePopupMode(
bool b);
496 Size GetDefaultImageSize()
const;
497 void ChangeHighlight( ImplToolItems::size_type nPos );
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void Resizing(Size &rSize)
virtual void StateChanged(StateChangedType nType) override
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
virtual Size GetOptimalSize() const override
virtual void StartDocking()
virtual bool EventNotify(NotifyEvent &rNEvt) override
virtual void EndDocking(const tools::Rectangle &rRect, bool bFloatMode)
virtual bool Docking(const Point &rPos, tools::Rectangle &rRect)
DockingWindow & operator=(const DockingWindow &)=delete
virtual void Tracking(const TrackingEvent &rTEvt) override
SAL_DLLPRIVATE void ImplInitSettings()
virtual void ToggleFloatingMode()
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
virtual void doDeferredInit(WinBits nBits)
An idle is a timer to be scheduled immediately.
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
void SetStyle(WinBits nStyle)
virtual void RequestHelp(const HelpEvent &rHEvt)
void SetHelpText(const OUString &rHelpText)
virtual void Command(const CommandEvent &rCEvt)
virtual void MouseButtonDown(const MouseEvent &rMEvt)
virtual void MouseButtonUp(const MouseEvent &rMEvt)
virtual void KeyInput(const KeyEvent &rKEvt)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
const OUString & GetHelpId() const
virtual OUString GetDisplayText() const
virtual void MouseMove(const MouseEvent &rMEvt)
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
virtual void Deactivate()
virtual void ImplInvalidate(const vcl::Region *pRegion, InvalidateFlags nFlags)
virtual void ApplySettings(vcl::RenderContext &rRenderContext)
void SetQuickHelpText(const OUString &rHelpText)
const OUString & GetQuickHelpText() const
const OUString & GetHelpText() const
virtual FactoryFunction GetUITestFactory() const
void SetHelpId(const OUString &)
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
void Clear(EHistoryType eHistory)
static void ImplCalcBorder(WindowAlign eAlign, tools::Long &rLeft, tools::Long &rTop, tools::Long &rRight, tools::Long &rBottom)