Back to index

lightning-sunbird  0.9+nobinonly
nsSOAPTypes.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications.
00019  * Portions created by the Initial Developer are Copyright (C) 2001
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Vidur Apparao <vidur@netscape.com> (original author)
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either the GNU General Public License Version 2 or later (the "GPL"), or
00027  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #include "nsSchemaPrivate.h"
00040 #include "nsIWebServiceErrorHandler.h"
00041 
00042 nsSOAPArray::nsSOAPArray(nsISchemaType* aAnyType)
00043   : mAnyType(aAnyType)
00044 {
00045 }
00046 
00047 nsSOAPArray::~nsSOAPArray()
00048 {
00049 }
00050 
00051 NS_IMPL_ISUPPORTS3_CI(nsSOAPArray,
00052                       nsISchemaComponent,
00053                       nsISchemaType,
00054                       nsISchemaComplexType)
00055 
00056 /* readonly attribute wstring targetNamespace; */
00057 NS_IMETHODIMP 
00058 nsSOAPArray::GetTargetNamespace(nsAString& aTargetNamespace)
00059 {
00060   aTargetNamespace.AssignLiteral(NS_SOAP_1_2_ENCODING_NAMESPACE);
00061   return NS_OK;
00062 }
00063 
00064 /* void resolve(in nsIWebServiceErrorHandler); */
00065 NS_IMETHODIMP
00066 nsSOAPArray::Resolve(nsIWebServiceErrorHandler* aErrorHandler) 
00067 {
00068   return NS_OK;
00069 }
00070 
00071 /* void clear(); */
00072 NS_IMETHODIMP
00073 nsSOAPArray::Clear()
00074 {
00075   return NS_OK;
00076 }
00077 
00078 /* readonly attribute wstring name; */
00079 NS_IMETHODIMP 
00080 nsSOAPArray::GetName(nsAString& aName)
00081 {
00082   aName.AssignLiteral("Array"); 
00083   return NS_OK;
00084 }
00085 
00086 /* readonly attribute unsigned short schemaType; */
00087 NS_IMETHODIMP 
00088 nsSOAPArray::GetSchemaType(PRUint16 *aSchemaType)
00089 {
00090   NS_ENSURE_ARG_POINTER(aSchemaType);
00091   *aSchemaType = nsISchemaType::SCHEMA_TYPE_COMPLEX;
00092   return NS_OK;
00093 }
00094 
00095 /* readonly attribute unsigned short contentModel; */
00096 NS_IMETHODIMP 
00097 nsSOAPArray::GetContentModel(PRUint16 *aContentModel)
00098 {
00099   NS_ENSURE_ARG_POINTER(aContentModel);
00100   *aContentModel = nsISchemaComplexType::CONTENT_MODEL_ELEMENT_ONLY;
00101   return NS_OK;
00102 }
00103 
00104 /* readonly attribute unsigned short derivation; */
00105 NS_IMETHODIMP 
00106 nsSOAPArray::GetDerivation(PRUint16 *aDerivation)
00107 {
00108   NS_ENSURE_ARG_POINTER(aDerivation);
00109   *aDerivation = nsISchemaComplexType::DERIVATION_SELF_CONTAINED;
00110   return NS_OK;
00111 }
00112 
00113 /* readonly attribute nsISchemaType baseType; */
00114 NS_IMETHODIMP 
00115 nsSOAPArray::GetBaseType(nsISchemaType * *aBaseType)
00116 {
00117   NS_ENSURE_ARG_POINTER(aBaseType);
00118   NS_ADDREF(*aBaseType = mAnyType);
00119   return NS_OK;
00120 }
00121 
00122 /* readonly attribute nsISchemaSimpleType simplBaseType; */
00123 NS_IMETHODIMP 
00124 nsSOAPArray::GetSimpleBaseType(nsISchemaSimpleType * *aSimpleBaseType)
00125 {
00126   NS_ENSURE_ARG_POINTER(aSimpleBaseType);
00127   *aSimpleBaseType = nsnull;
00128   return NS_OK;
00129 }
00130 
00131 /* readonly attribute nsISchemaModelGroup modelGroup; */
00132 NS_IMETHODIMP 
00133 nsSOAPArray::GetModelGroup(nsISchemaModelGroup * *aModelGroup)
00134 {
00135   NS_ENSURE_ARG_POINTER(aModelGroup);
00136   *aModelGroup = nsnull;
00137   return NS_OK;
00138 }
00139 
00140 /* readonly attribute PRUint32 attributeCount; */
00141 NS_IMETHODIMP 
00142 nsSOAPArray::GetAttributeCount(PRUint32 *aAttributeCount)
00143 {
00144   NS_ENSURE_ARG_POINTER(aAttributeCount);
00145   *aAttributeCount = 0;
00146   return NS_OK;
00147 }
00148 
00149 /* nsISchemaAttributeComponent getAttributeByIndex (in PRUint32 index); */
00150 NS_IMETHODIMP 
00151 nsSOAPArray::GetAttributeByIndex(PRUint32 index, 
00152                                  nsISchemaAttributeComponent **_retval)
00153 {
00154   NS_ENSURE_ARG_POINTER(_retval);
00155   *_retval = nsnull;
00156   return NS_OK;
00157 }
00158 
00159 /* nsISchemaAttributeComponent getAttributeByName (in AString name); */
00160 NS_IMETHODIMP 
00161 nsSOAPArray::GetAttributeByName(const nsAString& name, 
00162                                 nsISchemaAttributeComponent **_retval)
00163 {
00164   NS_ENSURE_ARG_POINTER(_retval);
00165   *_retval = nsnull;
00166   return NS_OK;
00167 }
00168 
00169 /* readonly attribute boolean abstract; */
00170 NS_IMETHODIMP 
00171 nsSOAPArray::GetAbstract(PRBool *aAbstract)
00172 {
00173   NS_ENSURE_ARG_POINTER(aAbstract);
00174   *aAbstract = PR_FALSE;
00175   return NS_OK;
00176 }
00177 
00178 /* readonly attribute boolean isArray; */
00179 NS_IMETHODIMP
00180 nsSOAPArray::GetIsArray(PRBool* aIsArray) 
00181 {
00182   NS_ENSURE_ARG_POINTER(aIsArray);
00183   *aIsArray = PR_TRUE;
00184   return NS_OK;
00185 }
00186 
00187 /* readonly attribute nsISchemaType arrayType; */
00188 NS_IMETHODIMP
00189 nsSOAPArray::GetArrayType(nsISchemaType** aArrayType)
00190 {
00191   NS_ENSURE_ARG_POINTER(aArrayType);
00192   *aArrayType = mAnyType;
00193   NS_ADDREF(*aArrayType);
00194   return NS_OK;
00195 }
00196 
00197 /* readonly attribute PRUint32 arrayDimension; */
00198 NS_IMETHODIMP
00199 nsSOAPArray::GetArrayDimension(PRUint32* aDimension)
00200 {
00201   NS_ENSURE_ARG_POINTER(aDimension);
00202   *aDimension = 0;
00203   return NS_OK;
00204 }
00205 
00206 nsSOAPArrayType::nsSOAPArrayType()
00207 {
00208 }
00209 
00210 nsSOAPArrayType::~nsSOAPArrayType()
00211 {
00212 }
00213 
00214 NS_IMPL_ISUPPORTS4_CI(nsSOAPArrayType,
00215                       nsISchemaComponent,
00216                       nsISchemaType,
00217                       nsISchemaSimpleType,
00218                       nsISchemaRestrictionType)
00219 
00220 /* readonly attribute wstring targetNamespace; */
00221 NS_IMETHODIMP 
00222 nsSOAPArrayType::GetTargetNamespace(nsAString& aTargetNamespace)
00223 {
00224   aTargetNamespace.AssignLiteral(NS_SOAP_1_2_ENCODING_NAMESPACE);
00225   return NS_OK;
00226 }
00227 
00228 /* void resolve(in nsIWebServiceErrorHandler); */
00229 NS_IMETHODIMP
00230 nsSOAPArrayType::Resolve(nsIWebServiceErrorHandler* aErrorHandler) 
00231 {
00232   return NS_OK;
00233 }
00234 
00235 /* void clear(); */
00236 NS_IMETHODIMP
00237 nsSOAPArrayType::Clear()
00238 {
00239   return NS_OK;
00240 }
00241 
00242 /* readonly attribute wstring name; */
00243 NS_IMETHODIMP 
00244 nsSOAPArrayType::GetName(nsAString& aName)
00245 {
00246   aName.AssignLiteral("arrayType");
00247   return NS_OK;
00248 }
00249 
00250 /* readonly attribute unsigned short schemaType; */
00251 NS_IMETHODIMP 
00252 nsSOAPArrayType::GetSchemaType(PRUint16 *aSchemaType)
00253 {
00254   NS_ENSURE_ARG_POINTER(aSchemaType);
00255   *aSchemaType = nsISchemaType::SCHEMA_TYPE_SIMPLE;
00256   return NS_OK;
00257 }
00258 
00259 /* readonly attribute unsigned short simpleType; */
00260 NS_IMETHODIMP 
00261 nsSOAPArrayType::GetSimpleType(PRUint16 *aSimpleType)
00262 {
00263   NS_ENSURE_ARG_POINTER(aSimpleType);
00264   *aSimpleType = nsISchemaSimpleType::SIMPLE_TYPE_RESTRICTION;
00265   return NS_OK;
00266 }
00267 
00268 /* readonly attribute nsISchemaSimpleType baseType; */
00269 NS_IMETHODIMP 
00270 nsSOAPArrayType::GetBaseType(nsISchemaSimpleType * *aBaseType)
00271 {
00272   NS_ENSURE_ARG_POINTER(aBaseType);
00273   *aBaseType = nsnull;
00274   return NS_OK;
00275 }
00276 
00277 /* readonly attribute PRUint32 facetCount; */
00278 NS_IMETHODIMP 
00279 nsSOAPArrayType::GetFacetCount(PRUint32 *aFacetCount)
00280 {
00281   NS_ENSURE_ARG_POINTER(aFacetCount);
00282   *aFacetCount = 0;
00283   return NS_OK;
00284 }
00285 
00286 /* nsISchemaFacet getFacet(in PRUint32 index); */
00287 NS_IMETHODIMP 
00288 nsSOAPArrayType::GetFacet(PRUint32 index, nsISchemaFacet **_retval)
00289 {
00290   NS_ENSURE_ARG_POINTER(_retval);
00291   *_retval = nsnull;
00292   return NS_OK;
00293 }