2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-05-28 21:56:07 +00:00
|
|
|
|
1999-12-05 23:04:22 +00:00
|
|
|
/*
|
1999-05-28 21:56:07 +00:00
|
|
|
|
1999-12-05 23:04:22 +00:00
|
|
|
The XUL "controllers" object.
|
1999-05-28 21:56:07 +00:00
|
|
|
|
1999-12-05 23:04:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsXULControllers_h__
|
|
|
|
#define nsXULControllers_h__
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2013-03-17 07:55:16 +00:00
|
|
|
#include "nsTArray.h"
|
1999-12-05 23:04:22 +00:00
|
|
|
#include "nsWeakPtr.h"
|
|
|
|
#include "nsIControllers.h"
|
2007-03-08 11:17:16 +00:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
1999-12-05 23:04:22 +00:00
|
|
|
|
2001-03-30 03:20:56 +00:00
|
|
|
/* non-XPCOM class for holding controllers and their IDs */
|
|
|
|
class nsXULControllerData
|
|
|
|
{
|
|
|
|
public:
|
2012-08-22 15:56:38 +00:00
|
|
|
nsXULControllerData(uint32_t inControllerID, nsIController* inController)
|
2001-03-30 03:20:56 +00:00
|
|
|
: mControllerID(inControllerID)
|
|
|
|
, mController(inController)
|
2017-07-06 12:00:35 +00:00
|
|
|
{
|
2001-03-30 03:20:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
~nsXULControllerData() {}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t GetControllerID() { return mControllerID; }
|
2001-03-30 03:20:56 +00:00
|
|
|
|
|
|
|
nsresult GetController(nsIController **outController)
|
|
|
|
{
|
|
|
|
NS_IF_ADDREF(*outController = mController);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2017-07-06 12:00:35 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mControllerID;
|
2001-03-30 03:20:56 +00:00
|
|
|
nsCOMPtr<nsIController> mController;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
nsresult NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
2002-01-10 14:16:05 +00:00
|
|
|
|
2014-01-16 23:45:40 +00:00
|
|
|
class nsXULControllers : public nsIControllers
|
1999-12-05 23:04:22 +00:00
|
|
|
{
|
1999-05-28 21:56:07 +00:00
|
|
|
public:
|
2010-06-10 18:11:40 +00:00
|
|
|
friend nsresult
|
1999-12-05 23:04:22 +00:00
|
|
|
NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
|
|
|
|
2007-03-08 11:17:16 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULControllers, nsIControllers)
|
1999-12-05 23:04:22 +00:00
|
|
|
NS_DECL_NSICONTROLLERS
|
2017-07-06 12:00:35 +00:00
|
|
|
|
1999-12-05 23:04:22 +00:00
|
|
|
protected:
|
|
|
|
nsXULControllers();
|
|
|
|
virtual ~nsXULControllers(void);
|
|
|
|
|
2001-03-30 03:20:56 +00:00
|
|
|
void DeleteControllers();
|
|
|
|
|
2011-08-10 05:36:00 +00:00
|
|
|
nsTArray<nsXULControllerData*> mControllers;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mCurControllerID;
|
1999-05-28 21:56:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-12-05 23:04:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif // nsXULControllers_h__
|