1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: salframe.h,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SV_SALFRAME_H
32 #define _SV_SALFRAME_H
35 #include <vcl/sysdata.hxx>
36 #include <vcl/salframe.hxx>
44 class WinSalFrame
: public SalFrame
47 HWND mhWnd
; // Window handle
48 HCURSOR mhCursor
; // cursor handle
49 HIMC mhDefIMEContext
; // default IME-Context
50 WinSalGraphics
* mpGraphics
; // current frame graphics
51 WinSalGraphics
* mpGraphics2
; // current frame graphics for other threads
52 WinSalFrame
* mpNextFrame
; // pointer to next frame
53 HMENU mSelectedhMenu
; // the menu where highlighting is currently going on
54 HMENU mLastActivatedhMenu
; // the menu that was most recently opened
55 SystemEnvData maSysData
; // system data
56 SalFrameState maState
; // frame state
57 int mnShowState
; // show state
58 long mnWidth
; // client width in pixeln
59 long mnHeight
; // client height in pixeln
60 int mnMinWidth
; // min. client width in pixeln
61 int mnMinHeight
; // min. client height in pixeln
62 int mnMaxWidth
; // max. client width in pixeln
63 int mnMaxHeight
; // max. client height in pixeln
64 RECT maFullScreenRect
; // fullscreen rect
65 int mnFullScreenShowState
; // fullscreen restore show state
66 UINT mnInputLang
; // current Input Language
67 UINT mnInputCodePage
; // current Input CodePage
68 ULONG mnStyle
; // style
69 BOOL mbGraphics
; // is Graphics used
70 BOOL mbCaption
; // has window a caption
71 BOOL mbBorder
; // has window a border
72 BOOL mbFixBorder
; // has window a fixed border
73 BOOL mbSizeBorder
; // has window a sizeable border
74 BOOL mbNoIcon
; // is an window without an icon
75 BOOL mbFloatWin
; // is a FloatingWindow
76 BOOL mbFullScreen
; // TRUE: in full screen mode
77 BOOL mbPresentation
; // TRUE: Presentation Mode running
78 BOOL mbInShow
; // innerhalb eines Show-Aufrufs
79 BOOL mbRestoreMaximize
; // Restore-Maximize
80 BOOL mbInMoveMsg
; // Move-Message wird verarbeitet
81 BOOL mbInSizeMsg
; // Size-Message wird verarbeitet
82 BOOL mbFullScreenToolWin
; // WS_EX_TOOLWINDOW reset in FullScreenMode
83 BOOL mbDefPos
; // default-position
84 BOOL mbOverwriteState
; // TRUE: WindowState darf umgesetzt werden
85 BOOL mbIME
; // TRUE: We are in IME Mode
86 BOOL mbHandleIME
; // TRUE: Wir handeln die IME-Messages
87 BOOL mbSpezIME
; // TRUE: Spez IME
88 BOOL mbAtCursorIME
; // TRUE: Wir behandeln nur einige IME-Messages
89 BOOL mbCandidateMode
; // TRUE: Wir befinden uns im Candidate-Modus
90 static BOOL mbInReparent
; // TRUE: ignore focus lost and gain due to reparenting
92 RGNDATA
* mpClipRgnData
;
95 sal_Int32 mnDisplay
; // Display used for Fullscreen, 0 is primary monitor
97 void updateScreenNumber();
100 virtual ~WinSalFrame();
102 virtual SalGraphics
* GetGraphics();
103 virtual void ReleaseGraphics( SalGraphics
* pGraphics
);
104 virtual BOOL
PostEvent( void* pData
);
105 virtual void SetTitle( const XubString
& rTitle
);
106 virtual void SetIcon( USHORT nIcon
);
107 virtual void SetMenu( SalMenu
* pSalMenu
);
108 virtual void DrawMenuBar();
109 virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle
);
110 virtual void Show( BOOL bVisible
, BOOL bNoActivate
= FALSE
);
111 virtual void Enable( BOOL bEnable
);
112 virtual void SetMinClientSize( long nWidth
, long nHeight
);
113 virtual void SetMaxClientSize( long nWidth
, long nHeight
);
114 virtual void SetPosSize( long nX
, long nY
, long nWidth
, long nHeight
, USHORT nFlags
);
115 virtual void GetClientSize( long& rWidth
, long& rHeight
);
116 virtual void GetWorkArea( Rectangle
& rRect
);
117 virtual SalFrame
* GetParent() const;
118 virtual void SetWindowState( const SalFrameState
* pState
);
119 virtual BOOL
GetWindowState( SalFrameState
* pState
);
120 virtual void ShowFullScreen( BOOL bFullScreen
, sal_Int32 nDisplay
);
121 virtual void StartPresentation( BOOL bStart
);
122 virtual void SetAlwaysOnTop( BOOL bOnTop
);
123 virtual void ToTop( USHORT nFlags
);
124 virtual void SetPointer( PointerStyle ePointerStyle
);
125 virtual void CaptureMouse( BOOL bMouse
);
126 virtual void SetPointerPos( long nX
, long nY
);
127 using SalFrame::Flush
;
128 virtual void Flush();
130 virtual void SetInputContext( SalInputContext
* pContext
);
131 virtual void EndExtTextInput( USHORT nFlags
);
132 virtual String
GetKeyName( USHORT nKeyCode
);
133 virtual String
GetSymbolKeyName( const XubString
& rFontName
, USHORT nKeyCode
);
134 virtual BOOL
MapUnicodeToKeyCode( sal_Unicode aUnicode
, LanguageType aLangType
, KeyCode
& rKeyCode
);
135 virtual LanguageType
GetInputLanguage();
136 virtual SalBitmap
* SnapShot();
137 virtual void UpdateSettings( AllSettings
& rSettings
);
138 virtual void Beep( SoundType eSoundType
);
139 virtual const SystemEnvData
* GetSystemData() const;
140 virtual SalPointerState
GetPointerState();
141 virtual SalIndicatorState
GetIndicatorState();
142 virtual void SimulateKeyPress( USHORT nKeyCode
);
143 virtual void SetParent( SalFrame
* pNewParent
);
144 virtual bool SetPluginParent( SystemParentData
* pNewParent
);
145 virtual void SetBackgroundBitmap( SalBitmap
* );
146 virtual void SetScreenNumber( unsigned int );
147 virtual void ResetClipRegion();
148 virtual void BeginSetClipRegion( ULONG nRects
);
149 virtual void UnionClipRegion( long nX
, long nY
, long nWidth
, long nHeight
);
150 virtual void EndSetClipRegion();
153 void ImplSalGetWorkArea( HWND hWnd
, RECT
*pRect
, const RECT
*pParentRect
);
155 #endif // _SV_SALFRAME_H