1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/.
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
20 virtual ~InterimItemWindow() override
;
21 virtual void dispose() override
;
23 virtual void Resize() override
;
24 virtual Size
GetOptimalSize() const override
;
25 virtual void StateChanged(StateChangedType nStateChange
) override
;
26 virtual void queue_resize(StateChangedType eReason
= StateChangedType::Layout
) override
;
27 virtual void GetFocus() override
;
29 bool ControlHasFocus() const;
31 virtual void Draw(OutputDevice
* pDevice
, const Point
& rPos
, DrawFlags nFlags
) override
;
34 // bAllowCycleFocusOut of true allows focus to be moved out of the Control
35 // via tab key into a parent window or sibling window, false means focus
36 // remains inside the InterimItemWindow and cycles back to the first child
37 // of this control on reaching pass the last child. This is suitable when
38 // the Control is the toplevel control and has no siblings or parent
39 InterimItemWindow(vcl::Window
* pParent
, const OUString
& rUIXMLDescription
, const OString
& rID
,
40 bool bAllowCycleFocusOut
= true, sal_uInt64 nLOKWindowId
= 0);
42 void InitControlBase(weld::Widget
* pWidget
);
44 // pass keystrokes from our child window through this to handle focus changes correctly
45 // returns true if keystroke is consumed
46 bool ChildKeyInput(const KeyEvent
& rKEvt
);
48 virtual void Layout();
50 std::unique_ptr
<weld::Builder
> m_xBuilder
;
51 VclPtr
<vcl::Window
> m_xVclContentArea
;
52 std::unique_ptr
<weld::Container
> m_xContainer
;
53 weld::Widget
* m_pWidget
;
58 void StartIdleLayout();
60 DECL_LINK(DoLayout
, Timer
*, void);
62 virtual void ImplPaintToDevice(::OutputDevice
* pTargetOutDev
, const Point
& rPos
) override
;
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */