Fix typo
[LibreOffice.git] / include / vcl / InterimItemWindow.hxx
blobba4aa4c3133e46a7554c42dfddb827b241dbf1df
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #pragma once
12 #include <vcl/dllapi.h>
13 #include <vcl/ctrl.hxx>
14 #include <vcl/idle.hxx>
15 #include <vcl/weld.hxx>
17 class VCL_DLLPUBLIC InterimItemWindow : public Control
19 public:
20 virtual ~InterimItemWindow() override;
21 virtual void dispose() override;
23 virtual void Resize() override;
24 virtual Size GetOptimalSize() const override;
25 // throw away cached size request of child so GetOptimalSize will
26 // fetch it anew
27 void InvalidateChildSizeCache();
28 virtual void StateChanged(StateChangedType nStateChange) override;
29 virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
30 virtual void GetFocus() override;
32 bool ControlHasFocus() const;
34 virtual void Draw(OutputDevice* pDevice, const Point& rPos,
35 SystemTextColorFlags nFlags) override;
37 void SetPriority(TaskPriority nPriority);
39 protected:
40 // bAllowCycleFocusOut of true allows focus to be moved out of the Control
41 // via tab key into a parent window or sibling window, false means focus
42 // remains inside the InterimItemWindow and cycles back to the first child
43 // of this control on reaching pass the last child. This is suitable when
44 // the Control is the toplevel control and has no siblings or parent
45 InterimItemWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, const OUString& rID,
46 bool bAllowCycleFocusOut = true, sal_uInt64 nLOKWindowId = 0);
48 void InitControlBase(weld::Widget* pWidget);
50 // pass keystrokes from our child window through this to handle focus changes correctly
51 // returns true if keystroke is consumed
52 bool ChildKeyInput(const KeyEvent& rKEvt);
54 virtual void Layout();
56 // unclip a "SysObj" which is a native window element hosted in a vcl::Window
57 // if the SysObj is logically "visible" in the vcl::Window::IsVisible sense but
58 // is partially or wholly clipped out due to being overlapped or scrolled out
59 // of view. The clip state is flagged as dirty after this and vcl will restore
60 // the clip state the next time it evaluates the clip status
61 void UnclipVisibleSysObj();
63 std::unique_ptr<weld::Builder> m_xBuilder;
64 VclPtr<vcl::Window> m_xVclContentArea;
65 std::unique_ptr<weld::Container> m_xContainer;
66 weld::Widget* m_pWidget;
68 private:
69 Idle m_aLayoutIdle;
71 void StartIdleLayout();
73 DECL_DLLPRIVATE_LINK(DoLayout, Timer*, void);
75 virtual void ImplPaintToDevice(::OutputDevice* pTargetOutDev, const Point& rPos) override;
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */