LibreOffice Module vcl (master) 1
svpframe.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_VCL_INC_HEADLESS_SVPFRAME_HXX
21#define INCLUDED_VCL_INC_HEADLESS_SVPFRAME_HXX
22
23#include <vcl/sysdata.hxx>
24
25#include <salframe.hxx>
26
27#include <vector>
28
29#ifdef IOS
30#include <quartz/salgdi.h>
31#define SvpSalInstance AquaSalInstance
32#define SvpSalGraphics AquaSalGraphics
33#endif
34
35class SvpSalInstance;
36class SvpSalGraphics;
37
38class SvpSalFrame : public SalFrame
39{
41 SvpSalFrame* m_pParent; // pointer to parent frame
42 std::vector< SvpSalFrame* > m_aChildren; // Vector of child frames
45#ifndef IOS
47#endif
52
54
55 std::vector< SvpSalGraphics* > m_aGraphics;
56
58 OUString m_sTitle;
59
60public:
62 SalFrame* pParent,
63 SalFrameStyleFlags nSalFrameStyle );
64 virtual ~SvpSalFrame() override;
65
66 void GetFocus();
67 void LoseFocus();
68 void PostPaint() const;
69
70 const OUString& title() const { return m_sTitle; }
71 SalFrameStyleFlags style() const { return m_nStyle; }
72 bool isVisible() const { return m_bVisible; }
73 bool hasFocus() const { return s_pFocusFrame == this; }
74
75 // SalFrame
76 virtual SalGraphics* AcquireGraphics() override;
77 virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
78
79 virtual bool PostEvent(std::unique_ptr<ImplSVEvent> pData) override;
80
81 virtual void SetTitle( const OUString& rTitle ) override;
82 virtual void SetIcon( sal_uInt16 nIcon ) override;
83 virtual void SetMenu( SalMenu* pMenu ) override;
84
85 virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ) override;
86 virtual void Show( bool bVisible, bool bNoActivate = false ) override;
87 virtual void SetMinClientSize( tools::Long nWidth, tools::Long nHeight ) override;
88 virtual void SetMaxClientSize( tools::Long nWidth, tools::Long nHeight ) override;
89 virtual void SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags ) override;
90 virtual void GetClientSize( tools::Long& rWidth, tools::Long& rHeight ) override;
91 virtual void GetWorkArea( tools::Rectangle& rRect ) override;
92 virtual SalFrame* GetParent() const override;
93 virtual void SetWindowState(const vcl::WindowData*) override;
94 virtual bool GetWindowState(vcl::WindowData*) override;
95 virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) override;
96 virtual void StartPresentation( bool bStart ) override;
97 virtual void SetAlwaysOnTop( bool bOnTop ) override;
98 virtual void ToTop( SalFrameToTop nFlags ) override;
99 virtual void SetPointer( PointerStyle ePointerStyle ) override;
100 virtual void CaptureMouse( bool bMouse ) override;
101 virtual void SetPointerPos( tools::Long nX, tools::Long nY ) override;
102 using SalFrame::Flush;
103 virtual void Flush() override;
104 virtual void SetInputContext( SalInputContext* pContext ) override;
105 virtual void EndExtTextInput( EndExtTextInputFlags nFlags ) override;
106 virtual OUString GetKeyName( sal_uInt16 nKeyCode ) override;
107 virtual bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) override;
108 virtual LanguageType GetInputLanguage() override;
109 virtual void UpdateSettings( AllSettings& rSettings ) override;
110 virtual void Beep() override;
111 virtual const SystemEnvData* GetSystemData() const override;
114 virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override;
115 virtual void SetParent( SalFrame* pNewParent ) override;
116 virtual void SetPluginParent( SystemParentData* pNewParent ) override;
117 virtual void ResetClipRegion() override;
118 virtual void BeginSetClipRegion( sal_uInt32 nRects ) override;
119 virtual void UnionClipRegion( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override;
120 virtual void EndSetClipRegion() override;
121
122 /*TODO: functional implementation */
123 virtual void SetScreenNumber( unsigned int ) override {}
124 virtual void SetApplicationID(const OUString &) override {}
125
126private:
128};
129
130template <typename charT, typename traits>
131inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& stream,
132 const SvpSalFrame& frame)
133{
134 stream << &frame << " (vis " << frame.isVisible() << " focus " << frame.hasFocus();
135 stream << " style " << std::hex << std::setfill('0') << std::setw(8) << static_cast<sal_uInt32>(frame.style());
136 OUString sTitle = frame.title();
137 if (!sTitle.isEmpty())
138 stream << " '" << sTitle << "'";
139 stream << ")";
140 return stream;
141}
142
143#endif // INCLUDED_VCL_INC_HEADLESS_SVPFRAME_HXX
144
145/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _cairo_surface cairo_surface_t
Definition: CairoCommon.hxx:46
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:115
virtual void Flush()=0
virtual void SetIcon(sal_uInt16 nIcon) override
virtual void SetMaxClientSize(tools::Long nWidth, tools::Long nHeight) override
std::vector< SvpSalFrame * > m_aChildren
Definition: svpframe.hxx:42
virtual void SetPosSize(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags) override
virtual KeyIndicatorState GetIndicatorState() override
static SvpSalFrame * s_pFocusFrame
Definition: svpframe.hxx:57
SvpSalFrame * m_pParent
Definition: svpframe.hxx:41
virtual void GetWorkArea(tools::Rectangle &rRect) override
const OUString & title() const
Definition: svpframe.hxx:70
bool isVisible() const
Definition: svpframe.hxx:72
bool m_bVisible
Definition: svpframe.hxx:44
virtual void SetPluginParent(SystemParentData *pNewParent) override
virtual ~SvpSalFrame() override
virtual void Show(bool bVisible, bool bNoActivate=false) override
tools::Long m_nMaxWidth
Definition: svpframe.hxx:50
virtual void SetMinClientSize(tools::Long nWidth, tools::Long nHeight) override
virtual void CaptureMouse(bool bMouse) override
tools::Long m_nMinHeight
Definition: svpframe.hxx:49
virtual OUString GetKeyName(sal_uInt16 nKeyCode) override
virtual void ShowFullScreen(bool bFullScreen, sal_Int32 nDisplay) override
virtual void ReleaseGraphics(SalGraphics *pGraphics) override
void PostPaint() const
virtual void SetScreenNumber(unsigned int) override
Definition: svpframe.hxx:123
virtual void UnionClipRegion(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
void GetFocus()
virtual void SetParent(SalFrame *pNewParent) override
virtual void StartPresentation(bool bStart) override
virtual void ResetClipRegion() override
virtual void GetClientSize(tools::Long &rWidth, tools::Long &rHeight) override
tools::Long m_nMinWidth
Definition: svpframe.hxx:48
virtual void SetTitle(const OUString &rTitle) override
virtual void UpdateSettings(AllSettings &rSettings) override
virtual SalGraphics * AcquireGraphics() override
virtual void SetWindowState(const vcl::WindowData *) override
virtual bool MapUnicodeToKeyCode(sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode &rKeyCode) override
SvpSalInstance * m_pInstance
Definition: svpframe.hxx:40
virtual const SystemEnvData * GetSystemData() const override
OUString m_sTitle
Definition: svpframe.hxx:58
bool hasFocus() const
Definition: svpframe.hxx:73
SalFrameStyleFlags style() const
Definition: svpframe.hxx:71
virtual SalPointerState GetPointerState() override
virtual void BeginSetClipRegion(sal_uInt32 nRects) override
virtual void EndExtTextInput(EndExtTextInputFlags nFlags) override
tools::Long m_nMaxHeight
Definition: svpframe.hxx:51
virtual void Flush() override
SvpSalFrame(SvpSalInstance *pInstance, SalFrame *pParent, SalFrameStyleFlags nSalFrameStyle)
virtual void SetApplicationID(const OUString &) override
Definition: svpframe.hxx:124
std::vector< SvpSalGraphics * > m_aGraphics
Definition: svpframe.hxx:55
virtual void SetPointerPos(tools::Long nX, tools::Long nY) override
virtual void EndSetClipRegion() override
virtual void SetMenu(SalMenu *pMenu) override
virtual void ToTop(SalFrameToTop nFlags) override
virtual bool PostEvent(std::unique_ptr< ImplSVEvent > pData) override
cairo_surface_t * m_pSurface
Definition: svpframe.hxx:46
virtual void SetAlwaysOnTop(bool bOnTop) override
SalFrameStyleFlags m_nStyle
Definition: svpframe.hxx:43
virtual LanguageType GetInputLanguage() override
virtual bool GetWindowState(vcl::WindowData *) override
virtual void SimulateKeyPress(sal_uInt16 nKeyCode) override
virtual void SetExtendedFrameStyle(SalExtStyle nExtStyle) override
virtual void SetPointer(PointerStyle ePointerStyle) override
virtual void Beep() override
SystemEnvData m_aSystemChildData
Definition: svpframe.hxx:53
virtual SalFrame * GetParent() const override
basegfx::B2IVector GetSurfaceFrameSize() const
virtual void SetInputContext(SalInputContext *pContext) override
void LoseFocus()
Reference< XOutputStream > stream
KeyIndicatorState
Definition: keycodes.hxx:187
long Long
PointerStyle
Definition: ptrstyle.hxx:26
sal_uInt64 SalExtStyle
Definition: salframe.hxx:95
SalFrameToTop
Definition: salframe.hxx:43
SalFrameStyleFlags
Definition: salframe.hxx:65
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, const SvpSalFrame &frame)
Definition: svpframe.hxx:131
sal_uInt16 sal_Unicode
EndExtTextInputFlags
Definition: window.hxx:346