LibreOffice Module vcl (master) 1
InterimItemWindow.hxx
Go to the documentation of this file.
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.
4 *
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 */
9
10#pragma once
11
12#include <vcl/dllapi.h>
13#include <vcl/ctrl.hxx>
14#include <vcl/idle.hxx>
15#include <vcl/weld.hxx>
16
18{
19public:
20 virtual ~InterimItemWindow() override;
21 virtual void dispose() override;
22
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;
31
32 bool ControlHasFocus() const;
33
34 virtual void Draw(OutputDevice* pDevice, const Point& rPos,
35 SystemTextColorFlags nFlags) override;
36
37protected:
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 OString& rID,
44 bool bAllowCycleFocusOut = true, sal_uInt64 nLOKWindowId = 0);
45
46 void InitControlBase(weld::Widget* pWidget);
47
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);
51
52 virtual void Layout();
53
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();
60
61 std::unique_ptr<weld::Builder> m_xBuilder;
63 std::unique_ptr<weld::Container> m_xContainer;
65
66private:
68
69 void StartIdleLayout();
70
71 DECL_DLLPRIVATE_LINK(DoLayout, Timer*, void);
72
73 virtual void ImplPaintToDevice(::OutputDevice* pTargetOutDev, const Point& rPos) override;
74};
75
76/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
SystemTextColorFlags
Definition: ctrl.hxx:82
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:257
virtual void Resize() override
Definition: ctrl.cxx:75
virtual Size GetOptimalSize() const override
Definition: ctrl.cxx:370
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
Definition: ctrl.cxx:59
An idle is a timer to be scheduled immediately.
Definition: idle.hxx:35
std::unique_ptr< weld::Builder > m_xBuilder
DECL_DLLPRIVATE_LINK(DoLayout, Timer *, void)
VclPtr< vcl::Window > m_xVclContentArea
weld::Widget * m_pWidget
std::unique_ptr< weld::Container > m_xContainer
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:171
Definition: timer.hxx:27
virtual void GetFocus()
Definition: window.cxx:1845
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1358
virtual void Draw(::OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags)
Definition: window.cxx:1833
virtual void ImplPaintToDevice(::OutputDevice *pTargetOutDev, const Point &rPos)
Definition: paint.cxx:1350
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
Layout
StateChangedType
Definition: window.hxx:291