2001-09-25 05:32:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04: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-29 01:56:07 +04:00
|
|
|
|
1999-12-06 02:04:22 +03:00
|
|
|
/*
|
1999-05-29 01:56:07 +04:00
|
|
|
|
1999-12-06 02:04:22 +03:00
|
|
|
The XUL "controllers" object.
|
1999-05-29 01:56:07 +04:00
|
|
|
|
1999-12-06 02:04:22 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsXULControllers_h__
|
|
|
|
#define nsXULControllers_h__
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2013-03-17 11:55:16 +04:00
|
|
|
#include "nsTArray.h"
|
1999-12-06 02:04:22 +03:00
|
|
|
#include "nsWeakPtr.h"
|
|
|
|
#include "nsIControllers.h"
|
2007-03-08 14:17:16 +03:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
1999-12-06 02:04:22 +03:00
|
|
|
|
2001-03-30 07:20:56 +04:00
|
|
|
/* non-XPCOM class for holding controllers and their IDs */
|
|
|
|
class nsXULControllerData
|
|
|
|
{
|
|
|
|
public:
|
2012-08-22 19:56:38 +04:00
|
|
|
nsXULControllerData(uint32_t inControllerID, nsIController* inController)
|
2001-03-30 07:20:56 +04:00
|
|
|
: mControllerID(inControllerID)
|
|
|
|
, mController(inController)
|
2017-07-06 15:00:35 +03:00
|
|
|
{
|
2001-03-30 07:20:56 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
~nsXULControllerData() {}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t GetControllerID() { return mControllerID; }
|
2001-03-30 07:20:56 +04:00
|
|
|
|
|
|
|
nsresult GetController(nsIController **outController)
|
|
|
|
{
|
|
|
|
NS_IF_ADDREF(*outController = mController);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mControllerID;
|
2001-03-30 07:20:56 +04:00
|
|
|
nsCOMPtr<nsIController> mController;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-06-10 22:11:40 +04:00
|
|
|
nsresult NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
2002-01-10 17:16:05 +03:00
|
|
|
|
2014-01-17 03:45:40 +04:00
|
|
|
class nsXULControllers : public nsIControllers
|
1999-12-06 02:04:22 +03:00
|
|
|
{
|
1999-05-29 01:56:07 +04:00
|
|
|
public:
|
2010-06-10 22:11:40 +04:00
|
|
|
friend nsresult
|
1999-12-06 02:04:22 +03:00
|
|
|
NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
|
|
|
|
2007-03-08 14:17:16 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULControllers, nsIControllers)
|
1999-12-06 02:04:22 +03:00
|
|
|
NS_DECL_NSICONTROLLERS
|
2017-07-06 15:00:35 +03:00
|
|
|
|
1999-12-06 02:04:22 +03:00
|
|
|
protected:
|
|
|
|
nsXULControllers();
|
|
|
|
virtual ~nsXULControllers(void);
|
|
|
|
|
2001-03-30 07:20:56 +04:00
|
|
|
void DeleteControllers();
|
|
|
|
|
2011-08-10 09:36:00 +04:00
|
|
|
nsTArray<nsXULControllerData*> mControllers;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mCurControllerID;
|
1999-05-29 01:56:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-12-06 02:04:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
#endif // nsXULControllers_h__
|