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/. */
8 The XUL "controllers" object.
12 #ifndef nsXULControllers_h__
13 #define nsXULControllers_h__
17 #include "nsIControllers.h"
18 #include "nsCycleCollectionParticipant.h"
20 /* non-XPCOM class for holding controllers and their IDs */
21 class nsXULControllerData final
{
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
{
38 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
39 NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULControllers
, nsIControllers
)
40 NS_DECL_NSICONTROLLERS
43 virtual ~nsXULControllers(void);
45 void DeleteControllers();
47 nsTArray
<nsXULControllerData
*> mControllers
;
48 uint32_t mCurControllerID
;
51 #endif // nsXULControllers_h__