xref: /aoo42x/main/vcl/inc/win/salframe.h (revision 79aad27f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SV_SALFRAME_H
25 #define _SV_SALFRAME_H
26 
27 #include <vcl/sysdata.hxx>
28 #include <salframe.hxx>
29 
30 class WinSalGraphics;
31 
32 // ----------------
33 // - WinSalFrame -
34 // ----------------
35 
36 class WinSalFrame : public SalFrame
37 {
38 public:
39     HWND                    mhWnd;                  // Window handle
40     HCURSOR                 mhCursor;               // cursor handle
41     HIMC                    mhDefIMEContext;        // default IME-Context
42     WinSalGraphics*         mpGraphics;             // current frame graphics
43     WinSalGraphics*         mpGraphics2;            // current frame graphics for other threads
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     SalFrameState           maState;                // frame state
49     int                     mnShowState;            // show state
50     long                    mnWidth;                // client width in pixeln
51     long                    mnHeight;               // client height in pixeln
52     int                     mnMinWidth;             // min. client width in pixeln
53     int                     mnMinHeight;            // min. client height in pixeln
54     int                     mnMaxWidth;             // max. client width in pixeln
55     int                     mnMaxHeight;            // max. client height in pixeln
56     RECT                    maFullScreenRect;       // fullscreen rect
57     int                     mnFullScreenShowState;  // fullscreen restore show state
58     UINT                    mnInputLang;            // current Input Language
59     UINT                    mnInputCodePage;        // current Input CodePage
60     sal_uIntPtr                   mnStyle;                // style
61     sal_Bool                    mbGraphics;             // is Graphics used
62     sal_Bool                    mbCaption;              // has window a caption
63     sal_Bool                    mbBorder;               // has window a border
64     sal_Bool                    mbFixBorder;            // has window a fixed border
65     sal_Bool                    mbSizeBorder;           // has window a sizeable border
66     sal_Bool                    mbNoIcon;               // is an window without an icon
67     sal_Bool                    mbFloatWin;             // is a FloatingWindow
68     sal_Bool                    mbFullScreen;           // TRUE: in full screen mode
69     sal_Bool                    mbPresentation;         // TRUE: Presentation Mode running
70     sal_Bool                    mbInShow;               // innerhalb eines Show-Aufrufs
71     sal_Bool                    mbRestoreMaximize;      // Restore-Maximize
72     sal_Bool                    mbInMoveMsg;            // Move-Message wird verarbeitet
73     sal_Bool                    mbInSizeMsg;            // Size-Message wird verarbeitet
74     sal_Bool                    mbFullScreenToolWin;    // WS_EX_TOOLWINDOW reset in FullScreenMode
75     sal_Bool                    mbDefPos;               // default-position
76     sal_Bool                    mbOverwriteState;       // TRUE: WindowState darf umgesetzt werden
77     sal_Bool                    mbIME;                  // TRUE: We are in IME Mode
78     sal_Bool                    mbHandleIME;            // TRUE: Wir handeln die IME-Messages
79     sal_Bool                    mbSpezIME;              // TRUE: Spez IME
80     sal_Bool                    mbAtCursorIME;          // TRUE: Wir behandeln nur einige IME-Messages
81     sal_Bool                    mbCandidateMode;        // TRUE: Wir befinden uns im Candidate-Modus
82     static sal_Bool             mbInReparent;           // TRUE: ignore focus lost and gain due to reparenting
83 
84     RGNDATA*                mpClipRgnData;
85     RECT*                   mpNextClipRect;
86     sal_Bool                    mbFirstClipRect;
87 	sal_Int32				mnDisplay;				// Display used for Fullscreen, 0 is primary monitor
88 
89     void updateScreenNumber();
90 public:
91     WinSalFrame();
92     virtual ~WinSalFrame();
93 
94     virtual SalGraphics*		GetGraphics();
95     virtual void				ReleaseGraphics( SalGraphics* pGraphics );
96     virtual sal_Bool				PostEvent( void* pData );
97     virtual void				SetTitle( const XubString& rTitle );
98     virtual void				SetIcon( sal_uInt16 nIcon );
99     virtual void                                SetMenu( SalMenu* pSalMenu );
100     virtual void                                DrawMenuBar();
101     virtual void                SetExtendedFrameStyle( SalExtStyle nExtStyle );
102     virtual void				Show( sal_Bool bVisible, sal_Bool bNoActivate = FALSE );
103     virtual void				Enable( sal_Bool bEnable );
104     virtual void                SetMinClientSize( long nWidth, long nHeight );
105     virtual void                SetMaxClientSize( long nWidth, long nHeight );
106     virtual void				SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
107     virtual void				GetClientSize( long& rWidth, long& rHeight );
108     virtual void				GetWorkArea( Rectangle& rRect );
109     virtual SalFrame*			GetParent() const;
110     virtual void				SetWindowState( const SalFrameState* pState );
111     virtual sal_Bool				GetWindowState( SalFrameState* pState );
112     virtual void				ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
113     virtual void				StartPresentation( sal_Bool bStart );
114     virtual void				SetAlwaysOnTop( sal_Bool bOnTop );
115     virtual void				ToTop( sal_uInt16 nFlags );
116     virtual void				SetPointer( PointerStyle ePointerStyle );
117     virtual void				CaptureMouse( sal_Bool bMouse );
118     virtual void				SetPointerPos( long nX, long nY );
119     using SalFrame::Flush;
120     virtual void				Flush();
121     virtual void				Sync();
122     virtual void				SetInputContext( SalInputContext* pContext );
123     virtual void				EndExtTextInput( sal_uInt16 nFlags );
124     virtual String				GetKeyName( sal_uInt16 nKeyCode );
125     virtual String				GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
126     virtual sal_Bool                MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
127     virtual LanguageType		GetInputLanguage();
128     virtual SalBitmap*			SnapShot();
129     virtual void				UpdateSettings( AllSettings& rSettings );
130     virtual void				Beep( SoundType eSoundType );
131     virtual const SystemEnvData*	GetSystemData() const;
132     virtual SalPointerState		GetPointerState();
133     virtual void				SetParent( SalFrame* pNewParent );
134     virtual bool				SetPluginParent( SystemParentData* pNewParent );
135     virtual void                SetBackgroundBitmap( SalBitmap* );
136     virtual void                SetScreenNumber( unsigned int );
137 	virtual void				ResetClipRegion();
138 	virtual void				BeginSetClipRegion( sal_uIntPtr nRects );
139 	virtual void				UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
140 	virtual void				EndSetClipRegion();
141 };
142 
143 void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect );
144 
145 #endif // _SV_SALFRAME_H
146