1 /* vim: set sw=2 sts=2 et cin: */
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 //=============================================================================
10 * os2FrameWindow is a helper class instantiated by nsWindow to handle
11 * operations that are specific to OS/2 frame windows. It never references
12 * the frame's client window except to create it. See nsWindow.h for details.
13 * Note: nsWindow.h must be #included in *.cpp before #including this file.
16 //=============================================================================
18 #ifndef _os2framewindow_h
19 #define _os2framewindow_h
21 //=============================================================================
23 //=============================================================================
28 os2FrameWindow(nsWindow
* aOwner
);
31 HWND
CreateFrameWindow(nsWindow
* aParent
,
33 const nsIntRect
& aRect
,
34 nsWindowType aWindowType
,
35 nsBorderStyle aBorderStyle
);
36 uint32_t GetFCFlags(nsWindowType aWindowType
,
37 nsBorderStyle aBorderStyle
);
38 nsresult
Show(bool aState
);
39 void SetWindowListVisibility(bool aState
);
40 nsresult
GetBounds(nsIntRect
& aRect
);
41 nsresult
Move(int32_t aX
, int32_t aY
);
42 nsresult
Resize(int32_t aWidth
, int32_t aHeight
,
44 nsresult
Resize(int32_t aX
, int32_t aY
, int32_t w
, int32_t h
,
46 void ActivateTopLevelWidget();
47 nsresult
SetSizeMode(int32_t aMode
);
48 nsresult
HideWindowChrome(bool aShouldHide
);
49 nsresult
SetTitle(const nsAString
& aTitle
);
50 nsresult
SetIcon(const nsAString
& aIconSpec
);
51 nsresult
ConstrainPosition(bool aAllowSlop
,
52 int32_t* aX
, int32_t* aY
);
53 MRESULT
ProcessFrameMessage(ULONG msg
, MPARAM mp1
, MPARAM mp2
);
54 HWND
GetFrameWnd() {return mFrameWnd
;}
56 friend MRESULT EXPENTRY
fnwpFrame(HWND hwnd
, ULONG msg
,
57 MPARAM mp1
, MPARAM mp2
);
60 nsWindow
* mOwner
; // the nsWindow that created this instance
61 HWND mFrameWnd
; // the frame's window handle
62 HWND mTitleBar
; // the frame controls that have
63 HWND mSysMenu
; // to be hidden or shown when
64 HWND mMinMax
; // HideWindowChrome() is called
65 uint32_t mSavedStyle
; // frame style saved by HideWindowChrome()
66 HPOINTER mFrameIcon
; // current frame icon
67 bool mChromeHidden
; // are frame controls hidden?
68 bool mNeedActivation
; // triggers activation when focus changes
69 PFNWP mPrevFrameProc
; // the frame's original wndproc
70 nsIntRect mFrameBounds
; // the frame's location & dimensions
73 #endif //_os2framewindow_h
75 //=============================================================================