Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / vcl / InterimItemWindow.hxx
blob8f7efc64e6e7524cf047f48ed2b07a8e73b5a971
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 protected:
38 // bAllowCycleFocusOut of true allows focus to be moved out of the Control
39 // via tab key into a parent window or sibling window, false means focus
40 // remains inside the InterimItemWindow and cycles back to the first child
41 // of this control on reaching pass the last child. This is suitable when
42 // the Control is the toplevel control and has no siblings or parent
43 InterimItemWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, const OUString& rID,
44 bool bAllowCycleFocusOut = true, sal_uInt64 nLOKWindowId = 0);
46 void InitControlBase(weld::Widget* pWidget);
48 // pass keystrokes from our child window through this to handle focus changes correctly
49 // returns true if keystroke is consumed
50 bool ChildKeyInput(const KeyEvent& rKEvt);
52 virtual void Layout();
54 // unclip a "SysObj" which is a native window element hosted in a vcl::Window
55 // if the SysObj is logically "visible" in the vcl::Window::IsVisible sense but
56 // is partially or wholly clipped out due to being overlapped or scrolled out
57 // of view. The clip state is flagged as dirty after this and vcl will restore
58 // the clip state the next time it evaluates the clip status
59 void UnclipVisibleSysObj();
61 std::unique_ptr<weld::Builder> m_xBuilder;
62 VclPtr<vcl::Window> m_xVclContentArea;
63 std::unique_ptr<weld::Container> m_xContainer;
64 weld::Widget* m_pWidget;
66 private:
67 Idle m_aLayoutIdle;
69 void StartIdleLayout();
71 DECL_DLLPRIVATE_LINK(DoLayout, Timer*, void);
73 virtual void ImplPaintToDevice(::OutputDevice* pTargetOutDev, const Point& rPos) override;
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */