Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes | Static Public Attributes
xpidl.Param Class Reference

List of all members.

Public Member Functions

def __init__
def resolve
def nativeType
def toIDL

Public Attributes

 paramtype
 type
 name
 attlist
 location
 realtype

Static Public Attributes

 size_is = None
 iid_is = None
 const = False
 array = False
 retval = False
 shared = False
 optional = False
 null = None
 undefined = None

Detailed Description

Definition at line 985 of file xpidl.py.


Constructor & Destructor Documentation

def xpidl.Param.__init__ (   self,
  paramtype,
  type,
  name,
  attlist,
  location,
  realtype = None 
)

Definition at line 996 of file xpidl.py.

00996 
00997     def __init__(self, paramtype, type, name, attlist, location, realtype=None):
00998         self.paramtype = paramtype
00999         self.type = type
01000         self.name = name
01001         self.attlist = attlist
01002         self.location = location
01003         self.realtype = realtype
01004 
01005         for name, value, aloc in attlist:
01006             # Put the value-taking attributes first!
01007             if name == 'size_is':
01008                 if value is None:
01009                     raise IDLError("'size_is' must specify a parameter", aloc)
01010                 self.size_is = value
01011             elif name == 'iid_is':
01012                 if value is None:
01013                     raise IDLError("'iid_is' must specify a parameter", aloc)
01014                 self.iid_is = value
01015             elif name == 'Null':
01016                 if value is None:
01017                     raise IDLError("'Null' must specify a parameter", aloc)
01018                 if value not in ('Empty', 'Null', 'Stringify'):
01019                     raise IDLError("'Null' parameter value must be 'Empty', 'Null', or 'Stringify'",
01020                                    aloc);
01021                 self.null = value
01022             elif name == 'Undefined':
01023                 if value is None:
01024                     raise IDLError("'Undefined' must specify a parameter", aloc)
01025                 if value not in ('Empty', 'Null'):
01026                     raise IDLError("'Undefined' parameter value must be 'Empty' or 'Null'",
01027                                    aloc);
01028                 self.undefined = value
01029             else:
01030                 if value is not None:
01031                     raise IDLError("Unexpected value for attribute '%s'" % name,
01032                                    aloc)
01033 
01034                 if name == 'const':
01035                     self.const = True
01036                 elif name == 'array':
01037                     self.array = True
01038                 elif name == 'retval':
01039                     self.retval = True
01040                 elif name == 'shared':
01041                     self.shared = True
01042                 elif name == 'optional':
01043                     self.optional = True
01044                 else:
01045                     raise IDLError("Unexpected attribute '%s'" % name, aloc)


Member Function Documentation

def xpidl.Param.nativeType (   self)

Definition at line 1059 of file xpidl.py.

01059 
01060     def nativeType(self):
01061         kwargs = {}
01062         if self.shared: kwargs['shared'] = True
01063         if self.const: kwargs['const'] = True
01064 
01065         try:
01066             return self.realtype.nativeType(self.paramtype, **kwargs)
01067         except IDLError, e:
01068             raise IDLError(e.message, self.location)
01069         except TypeError, e:
01070             raise IDLError("Unexpected parameter attribute", self.location)

def xpidl.Param.resolve (   self,
  method 
)

Definition at line 1046 of file xpidl.py.

01046 
01047     def resolve(self, method):
01048         self.realtype = method.iface.idl.getName(self.type, self.location)
01049         if self.array:
01050             self.realtype = Array(self.realtype)
01051         if (self.null is not None and
01052             getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'):
01053             raise IDLError("'Null' attribute can only be used on DOMString",
01054                            self.location)
01055         if (self.undefined is not None and
01056             getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'):
01057             raise IDLError("'Undefined' attribute can only be used on DOMString",
01058                            self.location)

Here is the call graph for this function:

def xpidl.Param.toIDL (   self)

Definition at line 1071 of file xpidl.py.

01071 
01072     def toIDL(self):
01073         return "%s%s %s %s" % (paramAttlistToIDL(self.attlist),
01074                                self.paramtype,
01075                                self.type,
01076                                self.name)

Here is the call graph for this function:


Member Data Documentation

Definition at line 989 of file xpidl.py.

Definition at line 1000 of file xpidl.py.

Definition at line 988 of file xpidl.py.

xpidl.Param.iid_is = None [static]

Definition at line 987 of file xpidl.py.

Definition at line 1001 of file xpidl.py.

Definition at line 999 of file xpidl.py.

xpidl.Param.null = None [static]

Definition at line 993 of file xpidl.py.

Definition at line 992 of file xpidl.py.

Definition at line 997 of file xpidl.py.

Definition at line 1002 of file xpidl.py.

Definition at line 990 of file xpidl.py.

Definition at line 991 of file xpidl.py.

xpidl.Param.size_is = None [static]

Definition at line 986 of file xpidl.py.

Definition at line 998 of file xpidl.py.

xpidl.Param.undefined = None [static]

Definition at line 994 of file xpidl.py.


The documentation for this class was generated from the following file: