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