Bug 1799694 - Rename action/menu button class names in unified extensions. r=Itiel...
[gecko.git] / dom / xul / nsXULControllers.h
blob495cf64e71931475a8a0c662f3ef5fce04154712
1 /* -*- Mode: C++; tab-width: 4; 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 /*
8 The XUL "controllers" object.
12 #ifndef nsXULControllers_h__
13 #define nsXULControllers_h__
15 #include "nsCOMPtr.h"
16 #include "nsTArray.h"
17 #include "nsIControllers.h"
18 #include "nsCycleCollectionParticipant.h"
20 /* non-XPCOM class for holding controllers and their IDs */
21 class nsXULControllerData final {
22 public:
23 nsXULControllerData(uint32_t inControllerID, nsIController* inController);
24 ~nsXULControllerData() = default;
26 uint32_t GetControllerID() { return mControllerID; }
28 nsresult GetController(nsIController** outController);
30 uint32_t mControllerID;
31 nsCOMPtr<nsIController> mController;
34 class nsXULControllers final : public nsIControllers {
35 public:
36 nsXULControllers();
38 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
39 NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULControllers, nsIControllers)
40 NS_DECL_NSICONTROLLERS
42 protected:
43 virtual ~nsXULControllers(void);
45 void DeleteControllers();
47 nsTArray<nsXULControllerData*> mControllers;
48 uint32_t mCurControllerID;
51 #endif // nsXULControllers_h__