LibreOffice Module vcl (master) 1
win/salframe.h
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_WIN_SALFRAME_H
21#define INCLUDED_VCL_INC_WIN_SALFRAME_H
22
23#include <sal/config.h>
24
25#include <string_view>
26
27#include <vcl/sysdata.hxx>
28#include <vcl/windowstate.hxx>
29#include <salframe.hxx>
30#include <svsys.h>
31
32class WinSalGraphics;
33
34class WinSalFrame final: public SalFrame
35{
37
38public:
39 HWND mhWnd; // Window handle
40 HCURSOR mhCursor; // cursor handle
41 HIMC mhDefIMEContext; // default IME-Context
42 WinSalGraphics* mpLocalGraphics; // current main thread frame graphics
43 WinSalGraphics* mpThreadGraphics; // current frame graphics for other threads (DCX_CACHE)
44 WinSalFrame* mpNextFrame; // pointer to next frame
45 HMENU mSelectedhMenu; // the menu where highlighting is currently going on
46 HMENU mLastActivatedhMenu; // the menu that was most recently opened
47 SystemEnvData maSysData; // system data
48 int mnShowState; // show state
49 int mnMinWidth; // min. client width in pixeln
50 int mnMinHeight; // min. client height in pixeln
51 int mnMaxWidth; // max. client width in pixeln
52 int mnMaxHeight; // max. client height in pixeln
53 RECT maFullScreenRect; // fullscreen rect
54 int mnFullScreenShowState; // fullscreen restore show state
55 bool mbFullScreenCaption; // WS_CAPTION reset in full screen mode.
56 UINT mnInputLang; // current Input Language
57 UINT mnInputCodePage; // current Input CodePage
59 bool mbGraphics; // is Graphics used
60 bool mbCaption; // has window a caption
61 bool mbBorder; // has window a border
62 bool mbFixBorder; // has window a fixed border
63 bool mbSizeBorder; // has window a sizeable border
64 bool mbNoIcon; // is a window without an icon
65 bool mbFloatWin; // is a FloatingWindow
66 bool mbPresentation; // TRUE: Presentation Mode running
67 bool mbInShow; // inside a show call
68 bool mbRestoreMaximize; // Restore-Maximize
69 bool mbInMoveMsg; // Move-Message is being processed
70 bool mbInSizeMsg; // Size-Message is being processed
71 bool mbFullScreenToolWin; // WS_EX_TOOLWINDOW reset in FullScreenMode
72 bool mbDefPos; // default-position
73 bool mbOverwriteState; // TRUE: possible to change WindowState
74 bool mbIME; // TRUE: We are in IME Mode
75 bool mbHandleIME; // TRUE: We are handling the IME-Messages
76 bool mbSpezIME; // TRUE: special IME
77 bool mbAtCursorIME; // TRUE: We are only handling some IME-Messages
78 bool mbCandidateMode; // TRUE: We are in Candidate-Mode
79 static bool mbInReparent; // TRUE: ignore focus lost and gain due to reparenting
80
81 RGNDATA* mpClipRgnData;
84 sal_Int32 mnDisplay; // Display used for Fullscreen, 0 is primary monitor
85 bool mbPropertiesStored; // has values stored in the window property store
86
88
89private:
90 void ImplSetParentFrame( HWND hNewParentWnd, bool bAsChild );
91 bool InitFrameGraphicsDC( WinSalGraphics *pGraphics, HDC hDC, HWND hWnd );
93
94public:
96 virtual ~WinSalFrame() override;
97
98 virtual SalGraphics* AcquireGraphics() override;
99 virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
100 virtual bool PostEvent(std::unique_ptr<ImplSVEvent> pData) override;
101 virtual void SetTitle( const OUString& rTitle ) override;
102 virtual void SetIcon( sal_uInt16 nIcon ) override;
103 virtual void SetMenu( SalMenu* pSalMenu ) override;
104 virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ) override;
105 virtual void Show( bool bVisible, bool bNoActivate = false ) override;
106 virtual void SetMinClientSize( tools::Long nWidth, tools::Long nHeight ) override;
107 virtual void SetMaxClientSize( tools::Long nWidth, tools::Long nHeight ) override;
108 virtual void SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags ) override;
109 virtual void GetClientSize( tools::Long& rWidth, tools::Long& rHeight ) override;
110 virtual void GetWorkArea( tools::Rectangle& rRect ) override;
111 virtual SalFrame* GetParent() const override;
112 virtual void SetWindowState(const vcl::WindowData*) override;
113 virtual bool GetWindowState(vcl::WindowData*) override;
114 virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) override;
115 virtual void StartPresentation( bool bStart ) override;
116 virtual void SetAlwaysOnTop( bool bOnTop ) override;
117 virtual void ToTop( SalFrameToTop nFlags ) override;
118 virtual void SetPointer( PointerStyle ePointerStyle ) override;
119 virtual void CaptureMouse( bool bMouse ) override;
120 virtual void SetPointerPos( tools::Long nX, tools::Long nY ) override;
121 using SalFrame::Flush;
122 virtual void Flush() override;
123 virtual void SetInputContext( SalInputContext* pContext ) override;
124 virtual void EndExtTextInput( EndExtTextInputFlags nFlags ) override;
125 virtual OUString GetKeyName( sal_uInt16 nKeyCode ) override;
126 virtual bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) override;
127 virtual LanguageType GetInputLanguage() override;
128 virtual void UpdateSettings( AllSettings& rSettings ) override;
129 virtual void Beep() override;
130 virtual const SystemEnvData* GetSystemData() const override;
133 virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override;
134 virtual void SetParent( SalFrame* pNewParent ) override;
135 virtual void SetPluginParent( SystemParentData* pNewParent ) override;
136 virtual void SetScreenNumber( unsigned int ) override;
137 virtual void SetApplicationID( const OUString &rApplicationID ) override;
138 virtual void ResetClipRegion() override;
139 virtual void BeginSetClipRegion( sal_uInt32 nRects ) override;
140 virtual void UnionClipRegion( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override;
141 virtual void EndSetClipRegion() override;
142 virtual void UpdateDarkMode() override;
143 virtual bool GetUseDarkMode() const override;
144 virtual bool GetUseReducedAnimation() const override;
145
146 constexpr vcl::WindowState state() const { return m_eState; }
148 constexpr bool isFullScreen() const { return bool(m_eState & vcl::WindowState::FullScreen); }
149};
150
151void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect );
152
155
156// get foreign key names
157namespace vcl_sal {
159 std::u16string_view pLang,
160 LONG nSymbol );
161}
162
163#endif // INCLUDED_VCL_INC_WIN_SALFRAME_H
164
165/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:115
virtual void Flush()=0
virtual ~WinSalFrame() override
virtual void StartPresentation(bool bStart) override
virtual SalFrame * GetParent() const override
bool mbPresentation
Definition: win/salframe.h:66
bool mbInSizeMsg
Definition: win/salframe.h:70
virtual void SetInputContext(SalInputContext *pContext) override
virtual void GetClientSize(tools::Long &rWidth, tools::Long &rHeight) override
WinSalFrame * mpNextFrame
Definition: win/salframe.h:44
virtual void SetTitle(const OUString &rTitle) override
void ImplSetParentFrame(HWND hNewParentWnd, bool bAsChild)
virtual void SetPluginParent(SystemParentData *pNewParent) override
virtual bool MapUnicodeToKeyCode(sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode &rKeyCode) override
static bool mbInReparent
Definition: win/salframe.h:79
virtual void SetApplicationID(const OUString &rApplicationID) override
UINT mnInputLang
Definition: win/salframe.h:56
virtual void ShowFullScreen(bool bFullScreen, sal_Int32 nDisplay) override
WinSalGraphics * mpLocalGraphics
Definition: win/salframe.h:42
virtual void SetPointerPos(tools::Long nX, tools::Long nY) override
virtual void Beep() override
virtual void EndExtTextInput(EndExtTextInputFlags nFlags) override
virtual bool GetWindowState(vcl::WindowData *) override
constexpr bool isFullScreen() const
Definition: win/salframe.h:148
void updateScreenNumber()
virtual void Flush() override
virtual const SystemEnvData * GetSystemData() const override
vcl::WindowState m_eState
Definition: win/salframe.h:36
WinSalGraphics * mpThreadGraphics
Definition: win/salframe.h:43
virtual bool GetUseReducedAnimation() const override
virtual void UpdateDarkMode() override
virtual void Show(bool bVisible, bool bNoActivate=false) override
HCURSOR mhCursor
Definition: win/salframe.h:40
bool mbInMoveMsg
Definition: win/salframe.h:69
bool InitFrameGraphicsDC(WinSalGraphics *pGraphics, HDC hDC, HWND hWnd)
SystemEnvData maSysData
Definition: win/salframe.h:47
bool mbRestoreMaximize
Definition: win/salframe.h:68
bool mbSpezIME
Definition: win/salframe.h:76
virtual void SetMinClientSize(tools::Long nWidth, tools::Long nHeight) override
bool mbGraphics
Definition: win/salframe.h:59
bool mbCaption
Definition: win/salframe.h:60
virtual void SetPointer(PointerStyle ePointerStyle) override
virtual void SetExtendedFrameStyle(SalExtStyle nExtStyle) override
virtual void SetIcon(sal_uInt16 nIcon) override
virtual void SetWindowState(const vcl::WindowData *) override
virtual void ResetClipRegion() override
virtual OUString GetKeyName(sal_uInt16 nKeyCode) override
virtual void GetWorkArea(tools::Rectangle &rRect) override
virtual bool PostEvent(std::unique_ptr< ImplSVEvent > pData) override
virtual KeyIndicatorState GetIndicatorState() override
void UpdateFrameState()
virtual SalGraphics * AcquireGraphics() override
RGNDATA * mpClipRgnData
Definition: win/salframe.h:81
virtual LanguageType GetInputLanguage() override
bool ReleaseFrameGraphicsDC(WinSalGraphics *pGraphics)
bool mbSizeBorder
Definition: win/salframe.h:63
bool mbFullScreenToolWin
Definition: win/salframe.h:71
virtual void SetPosSize(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags) override
virtual void SetMaxClientSize(tools::Long nWidth, tools::Long nHeight) override
bool mbHandleIME
Definition: win/salframe.h:75
HIMC mhDefIMEContext
Definition: win/salframe.h:41
virtual void UnionClipRegion(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
virtual void BeginSetClipRegion(sal_uInt32 nRects) override
SalFrameStyleFlags mnStyle
Definition: win/salframe.h:58
UINT mnInputCodePage
Definition: win/salframe.h:57
constexpr vcl::WindowState state() const
Definition: win/salframe.h:146
virtual SalPointerState GetPointerState() override
sal_Int32 mnDisplay
Definition: win/salframe.h:84
bool mbFullScreenCaption
Definition: win/salframe.h:55
virtual void ReleaseGraphics(SalGraphics *pGraphics) override
virtual void SetMenu(SalMenu *pSalMenu) override
bool mbFixBorder
Definition: win/salframe.h:62
virtual void SetParent(SalFrame *pNewParent) override
HMENU mLastActivatedhMenu
Definition: win/salframe.h:46
HMENU mSelectedhMenu
Definition: win/salframe.h:45
bool mbAtCursorIME
Definition: win/salframe.h:77
virtual void UpdateSettings(AllSettings &rSettings) override
int mnFullScreenShowState
Definition: win/salframe.h:54
bool mbFloatWin
Definition: win/salframe.h:65
bool mbPropertiesStored
Definition: win/salframe.h:85
bool mbOverwriteState
Definition: win/salframe.h:73
RECT * mpNextClipRect
Definition: win/salframe.h:82
RECT maFullScreenRect
Definition: win/salframe.h:53
virtual void SetAlwaysOnTop(bool bOnTop) override
bool mbCandidateMode
Definition: win/salframe.h:78
bool mbFirstClipRect
Definition: win/salframe.h:83
virtual void SetScreenNumber(unsigned int) override
virtual void CaptureMouse(bool bMouse) override
virtual void EndSetClipRegion() override
virtual void ToTop(SalFrameToTop nFlags) override
virtual void SimulateKeyPress(sal_uInt16 nKeyCode) override
virtual bool GetUseDarkMode() const override
WinSalGraphics never owns the HDC it uses to draw, because the HDC can have various origins with diff...
Definition: win/salgdi.h:141
KeyIndicatorState
Definition: keycodes.hxx:187
long Long
OUString getKeysReplacementName(std::u16string_view pLang, LONG nSymbol)
WindowState
Definition: windowstate.hxx:28
PointerStyle
Definition: ptrstyle.hxx:26
sal_uInt64 SalExtStyle
Definition: salframe.hxx:95
SalFrameToTop
Definition: salframe.hxx:43
SalFrameStyleFlags
Definition: salframe.hxx:65
sal_uInt16 sal_Unicode
bool OSSupportsDarkMode()
bool UseDarkMode()
void ImplSalGetWorkArea(HWND hWnd, RECT *pRect, const RECT *pParentRect)
EndExtTextInputFlags
Definition: window.hxx:346