2001-09-26 02:58:40 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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/. */
|
2001-04-06 05:26:49 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* nsICommandParams is used to pass parameters to commands executed
|
|
|
|
* via nsICommandManager, and to get command state.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-07-10 12:48:43 +03:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
class nsCommandParams;
|
|
|
|
%}
|
|
|
|
|
2018-07-10 10:50:44 +03:00
|
|
|
[scriptable, builtinclass, uuid(b1fdf3c4-74e3-4f7d-a14d-2b76bcf53482)]
|
2001-04-06 05:26:49 +04:00
|
|
|
interface nsICommandParams : nsISupports
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* List of primitive types for parameter values.
|
|
|
|
*/
|
|
|
|
const short eNoType = 0; /* Only used for sanity checking */
|
|
|
|
const short eBooleanType = 1;
|
2002-07-16 02:04:13 +04:00
|
|
|
const short eLongType = 2;
|
2001-04-06 05:26:49 +04:00
|
|
|
const short eDoubleType = 3;
|
|
|
|
const short eWStringType = 4;
|
|
|
|
const short eISupportsType = 5;
|
2002-07-16 02:04:13 +04:00
|
|
|
const short eStringType = 6;
|
2001-04-06 05:26:49 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* getValueType
|
2014-08-18 08:58:10 +04:00
|
|
|
*
|
2001-04-06 05:26:49 +04:00
|
|
|
* Get the type of a specified parameter
|
|
|
|
*/
|
2002-07-16 02:04:13 +04:00
|
|
|
short getValueType(in string name);
|
2001-04-06 05:26:49 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* get_Value
|
2014-08-18 08:58:10 +04:00
|
|
|
*
|
2001-04-06 05:26:49 +04:00
|
|
|
* Get the value of a specified parameter. Will return
|
|
|
|
* an error if the parameter does not exist, or if the value
|
|
|
|
* is of the wrong type (no coercion is performed for you).
|
2014-08-18 08:58:10 +04:00
|
|
|
*
|
2001-04-06 05:26:49 +04:00
|
|
|
* nsISupports values can contain any XPCOM interface,
|
|
|
|
* as documented for the command. It is permissible
|
|
|
|
* for it to contain nsICommandParams, but not *this*
|
|
|
|
* one (i.e. self-containing is not allowed).
|
|
|
|
*/
|
2002-07-16 02:04:13 +04:00
|
|
|
boolean getBooleanValue(in string name);
|
|
|
|
long getLongValue(in string name);
|
|
|
|
double getDoubleValue(in string name);
|
|
|
|
AString getStringValue(in string name);
|
2018-07-10 12:04:46 +03:00
|
|
|
ACString getCStringValue(in string name);
|
2002-07-16 02:04:13 +04:00
|
|
|
nsISupports getISupportsValue(in string name);
|
2014-08-18 08:58:10 +04:00
|
|
|
|
2001-04-06 05:26:49 +04:00
|
|
|
/*
|
|
|
|
* set_Value
|
2014-08-18 08:58:10 +04:00
|
|
|
*
|
2001-04-06 05:26:49 +04:00
|
|
|
* Set the value of a specified parameter (thus creating
|
|
|
|
* an entry for it).
|
2014-08-18 08:58:10 +04:00
|
|
|
*
|
2001-04-06 05:26:49 +04:00
|
|
|
* nsISupports values can contain any XPCOM interface,
|
|
|
|
* as documented for the command. It is permissible
|
|
|
|
* for it to contain nsICommandParams, but not *this*
|
|
|
|
* one (i.e. self-containing is not allowed).
|
|
|
|
*/
|
2002-07-16 02:04:13 +04:00
|
|
|
void setBooleanValue(in string name, in boolean value);
|
|
|
|
void setLongValue(in string name, in long value);
|
|
|
|
void setDoubleValue(in string name, in double value);
|
|
|
|
void setStringValue(in string name, in AString value);
|
2018-07-10 12:04:46 +03:00
|
|
|
void setCStringValue(in string name, in ACString value);
|
2002-07-16 02:04:13 +04:00
|
|
|
void setISupportsValue(in string name, in nsISupports value);
|
2014-08-18 08:58:10 +04:00
|
|
|
|
2001-04-06 05:26:49 +04:00
|
|
|
/*
|
|
|
|
* removeValue
|
2014-08-18 08:58:10 +04:00
|
|
|
*
|
2001-04-06 05:26:49 +04:00
|
|
|
* Remove the specified parameter from the list.
|
|
|
|
*/
|
2002-07-16 02:04:13 +04:00
|
|
|
void removeValue(in string name);
|
2018-07-10 12:48:43 +03:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
/**
|
|
|
|
* In order to avoid circular dependency issues, these methods are defined
|
|
|
|
* in nsCommandParams.h. Consumers need to #include that header.
|
|
|
|
*/
|
|
|
|
inline nsCommandParams* AsCommandParams();
|
|
|
|
inline const nsCommandParams* AsCommandParams() const;
|
|
|
|
%}
|
2001-04-06 05:26:49 +04:00
|
|
|
};
|
|
|
|
|