Bug 1777562 [wpt PR 34663] - [FedCM] Rename FederatedCredential to IdentityCredential...
[gecko.git] / widget / cocoa / nsWindowMap.h
blob9326415df78e10d49b3e7f120bccf0a99e73c2d2
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsWindowMap_h_
7 #define nsWindowMap_h_
9 #import <Cocoa/Cocoa.h>
11 // WindowDataMap
13 // In both mozilla and embedding apps, we need to have a place to put
14 // per-top-level-window logic and data, to handle such things as IME
15 // commit when the window gains/loses focus. We can't use a window
16 // delegate, because an embeddor probably already has one. Nor can we
17 // subclass NSWindow, again because we can't impose that burden on the
18 // embeddor.
20 // So we have a global map of NSWindow -> TopLevelWindowData, and set
21 // up TopLevelWindowData as a notification observer etc.
23 @interface WindowDataMap : NSObject {
24 @private
25 NSMutableDictionary* mWindowMap; // dict of TopLevelWindowData keyed by address of NSWindow
28 + (WindowDataMap*)sharedWindowDataMap;
30 - (void)ensureDataForWindow:(NSWindow*)inWindow;
31 - (id)dataForWindow:(NSWindow*)inWindow;
33 // set data for a given window. inData is retained (and any previously set data
34 // is released).
35 - (void)setData:(id)inData forWindow:(NSWindow*)inWindow;
37 // remove the data for the given window. the data is released.
38 - (void)removeDataForWindow:(NSWindow*)inWindow;
40 @end
42 @class ChildView;
44 // TopLevelWindowData
46 // Class to hold per-window data, and handle window state changes.
48 @interface TopLevelWindowData : NSObject {
49 @private
52 - (id)initWithWindow:(NSWindow*)inWindow;
53 + (void)activateInWindow:(NSWindow*)aWindow;
54 + (void)deactivateInWindow:(NSWindow*)aWindow;
55 + (void)activateInWindowViews:(NSWindow*)aWindow;
56 + (void)deactivateInWindowViews:(NSWindow*)aWindow;
58 @end
60 #endif // nsWindowMap_h_