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 {
19 public:
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, DrawFlags nFlags) override;
35 
36 protected:
37  // bAllowCycleFocusOut of true allows focus to be moved out of the Control
38  // via tab key into a parent window or sibling window, false means focus
39  // remains inside the InterimItemWindow and cycles back to the first child
40  // of this control on reaching pass the last child. This is suitable when
41  // the Control is the toplevel control and has no siblings or parent
42  InterimItemWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, const OString& rID,
43  bool bAllowCycleFocusOut = true, sal_uInt64 nLOKWindowId = 0);
44 
45  void InitControlBase(weld::Widget* pWidget);
46 
47  // pass keystrokes from our child window through this to handle focus changes correctly
48  // returns true if keystroke is consumed
49  bool ChildKeyInput(const KeyEvent& rKEvt);
50 
51  virtual void Layout();
52 
53  std::unique_ptr<weld::Builder> m_xBuilder;
55  std::unique_ptr<weld::Container> m_xContainer;
57 
58 private:
60 
61  void StartIdleLayout();
62 
63  DECL_LINK(DoLayout, Timer*, void);
64 
65  virtual void ImplPaintToDevice(::OutputDevice* pTargetOutDev, const Point& rPos) override;
66 };
67 
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
virtual void ImplPaintToDevice(::OutputDevice *pTargetOutDev, const Point &rPos)
Definition: paint.cxx:1339
weld::Widget * m_pWidget
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:260
StateChangedType
Definition: window.hxx:289
VclPtr< vcl::Window > m_xVclContentArea
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1326
DrawFlags
Definition: window.hxx:332
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:303
virtual void Draw(::OutputDevice *pDev, const Point &rPos, DrawFlags nFlags)
Definition: window.cxx:1822
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
virtual Size GetOptimalSize() const override
Definition: ctrl.cxx:374
virtual void Resize() override
Definition: ctrl.cxx:74
std::unique_ptr< weld::Container > m_xContainer
Definition: ctrl.hxx:33
virtual void GetFocus()
Definition: window.cxx:1834
std::unique_ptr< weld::Builder > m_xBuilder
Layout
Definition: timer.hxx:26
An idle is a timer to be scheduled immediately.
Definition: idle.hxx:34