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