1 /* -*- 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 #ifndef IPC_GLUE_WINDOWSMESSAGELOOP_H
9 #define IPC_GLUE_WINDOWSMESSAGELOOP_H
11 // This file is only meant to compile on windows
14 #include "base/basictypes.h"
15 #include "nsISupportsImpl.h"
28 MOZ_COUNT_CTOR(DeferredMessage
);
31 virtual ~DeferredMessage()
33 MOZ_COUNT_DTOR(DeferredMessage
);
36 virtual void Run() = 0;
39 // Uses CallWndProc to deliver a message at a later time. Messages faked with
40 // this class must not have pointers in their wParam or lParam members as they
41 // may be invalid by the time the message actually runs.
42 class DeferredSendMessage
: public DeferredMessage
45 DeferredSendMessage(HWND aHWnd
,
64 // Uses RedrawWindow to fake several painting-related messages. Flags passed
65 // to the constructor go directly to RedrawWindow.
66 class DeferredRedrawMessage
: public DeferredMessage
69 DeferredRedrawMessage(HWND aHWnd
,
82 // Uses UpdateWindow to generate a WM_PAINT message if needed.
83 class DeferredUpdateMessage
: public DeferredMessage
86 DeferredUpdateMessage(HWND aHWnd
);
95 // This class duplicates a string that may exist in the lParam member of the
97 class DeferredSettingChangeMessage
: public DeferredSendMessage
100 DeferredSettingChangeMessage(HWND aHWnd
,
105 ~DeferredSettingChangeMessage();
107 wchar_t* lParamString
;
110 // This class uses SetWindowPos to fake various size-related messages. Flags
111 // passed to the constructor go straight through to SetWindowPos.
112 class DeferredWindowPosMessage
: public DeferredMessage
115 DeferredWindowPosMessage(HWND aHWnd
,
117 bool aForCalcSize
= false,
126 // This class duplicates a data buffer for a WM_COPYDATA message.
127 class DeferredCopyDataMessage
: public DeferredSendMessage
130 DeferredCopyDataMessage(HWND aHWnd
,
135 ~DeferredCopyDataMessage();
137 COPYDATASTRUCT copyData
;
140 class DeferredStyleChangeMessage
: public DeferredMessage
143 DeferredStyleChangeMessage(HWND aHWnd
,
155 class DeferredSetIconMessage
: public DeferredSendMessage
158 DeferredSetIconMessage(HWND aHWnd
,
166 } /* namespace windows */
167 } /* namespace ipc */
168 } /* namespace mozilla */
170 #endif /* IPC_GLUE_WINDOWSMESSAGELOOP_H */