Bug 1728955: part 3) Add logging to `nsBaseClipboard`. r=masayuki
[gecko.git] / dom / base / nsPIWindowRoot.h
blob2d72bb4a608bb54f835a138b8938e2a51206d488
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsPIWindowRoot_h__
8 #define nsPIWindowRoot_h__
10 #include "nsISupports.h"
11 #include "mozilla/dom/EventTarget.h"
13 class nsPIDOMWindowOuter;
14 class nsIControllers;
15 class nsIController;
16 class nsINode;
17 class nsIRemoteTab;
19 #define NS_IWINDOWROOT_IID \
20 { \
21 0xb8724c49, 0xc398, 0x4f9b, { \
22 0x82, 0x59, 0x87, 0x27, 0xa6, 0x47, 0xdd, 0x0f \
23 } \
26 class nsPIWindowRoot : public mozilla::dom::EventTarget {
27 public:
28 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWINDOWROOT_IID)
30 virtual nsPIDOMWindowOuter* GetWindow() = 0;
32 // get and set the node that is the context of a popup menu
33 virtual already_AddRefed<nsINode> GetPopupNode() = 0;
34 virtual void SetPopupNode(nsINode* aNode) = 0;
36 /**
37 * @param aForVisibleWindow true if caller needs controller which is
38 * associated with visible window.
40 virtual nsresult GetControllerForCommand(const char* aCommand,
41 bool aForVisibleWindow,
42 nsIController** aResult) = 0;
44 /**
45 * @param aForVisibleWindow true if caller needs controllers which are
46 * associated with visible window.
48 virtual nsresult GetControllers(bool aForVisibleWindow,
49 nsIControllers** aResult) = 0;
51 virtual void GetEnabledDisabledCommands(
52 nsTArray<nsCString>& aEnabledCommands,
53 nsTArray<nsCString>& aDisabledCommands) = 0;
55 virtual void SetParentTarget(mozilla::dom::EventTarget* aTarget) = 0;
56 virtual mozilla::dom::EventTarget* GetParentTarget() = 0;
58 // Stores a weak reference to the browser.
59 virtual void AddBrowser(nsIRemoteTab* aBrowser) = 0;
60 virtual void RemoveBrowser(nsIRemoteTab* aBrowser) = 0;
62 using BrowserEnumerator = void (*)(nsIRemoteTab* aTab, void* aArg);
64 // Enumerate all stored browsers that for which the weak reference is valid.
65 virtual void EnumerateBrowsers(BrowserEnumerator aEnumFunc, void* aArg) = 0;
67 virtual bool ShowFocusRings() = 0;
68 virtual void SetShowFocusRings(bool aEnable) = 0;
71 NS_DEFINE_STATIC_IID_ACCESSOR(nsPIWindowRoot, NS_IWINDOWROOT_IID)
73 #endif // nsPIWindowRoot_h__