Back to index

lightning-sunbird  0.9+nobinonly
XSLTFunctions.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 TransforMiiX XSLT processor code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Keith Visco.
00019  * Portions created by the Initial Developer are Copyright (C) 1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef TRANSFRMX_XSLT_FUNCTIONS_H
00039 #define TRANSFRMX_XSLT_FUNCTIONS_H
00040 
00041 #include "Expr.h"
00042 #include "XMLUtils.h"
00043 #include "nsAutoPtr.h"
00044 
00045 class txPattern;
00046 class txStylesheet;
00047 class txKeyValueHashKey;
00048 class txExecutionState;
00049 class txNamespaceMap;
00050 
00054 class DocumentFunctionCall : public FunctionCall {
00055 
00056 public:
00057 
00061     DocumentFunctionCall(const nsAString& aBaseURI);
00062 
00063     TX_DECL_FUNCTION;
00064 
00065 private:
00066     nsString mBaseURI;
00067 };
00068 
00069 /*
00070  * The definition for the XSLT key() function
00071  */
00072 class txKeyFunctionCall : public FunctionCall {
00073 
00074 public:
00075 
00076     /*
00077      * Creates a new key() function call
00078      */
00079     txKeyFunctionCall(txNamespaceMap* aMappings);
00080 
00081     TX_DECL_FUNCTION;
00082 
00083 private:
00084     nsRefPtr<txNamespaceMap> mMappings;
00085 };
00086 
00090 class txFormatNumberFunctionCall : public FunctionCall {
00091 
00092 public:
00093 
00097     txFormatNumberFunctionCall(txStylesheet* aStylesheet, txNamespaceMap* aMappings);
00098 
00099     TX_DECL_FUNCTION;
00100 
00101 private:
00102     static const PRUnichar FORMAT_QUOTE;
00103 
00104     enum FormatParseState {
00105         Prefix,
00106         IntDigit,
00107         IntZero,
00108         FracZero,
00109         FracDigit,
00110         Suffix,
00111         Finished
00112     };
00113     
00114     txStylesheet* mStylesheet;
00115     nsRefPtr<txNamespaceMap> mMappings;
00116 };
00117 
00122 class txDecimalFormat : public TxObject {
00123 
00124 public:
00125     /*
00126      * Creates a new decimal format and initilizes all properties with
00127      * default values
00128      */
00129     txDecimalFormat();
00130     MBool isEqual(txDecimalFormat* other);
00131     
00132     PRUnichar       mDecimalSeparator;
00133     PRUnichar       mGroupingSeparator;
00134     nsString        mInfinity;
00135     PRUnichar       mMinusSign;
00136     nsString        mNaN;
00137     PRUnichar       mPercent;
00138     PRUnichar       mPerMille;
00139     PRUnichar       mZeroDigit;
00140     PRUnichar       mDigit;
00141     PRUnichar       mPatternSeparator;
00142 };
00143 
00147 class CurrentFunctionCall : public FunctionCall {
00148 
00149 public:
00150 
00154     CurrentFunctionCall();
00155 
00156     TX_DECL_FUNCTION;
00157 };
00158 
00162 class UnparsedEntityUriFunctionCall : public FunctionCall {
00163 
00164 public:
00165 
00169     UnparsedEntityUriFunctionCall();
00170 
00171     TX_DECL_FUNCTION;
00172 
00173 private:
00174 };
00175 
00179 class GenerateIdFunctionCall : public FunctionCall {
00180 
00181 public:
00182 
00186     GenerateIdFunctionCall();
00187 
00188     TX_DECL_FUNCTION;
00189 };
00190 
00194 class SystemPropertyFunctionCall : public FunctionCall {
00195 
00196 public:
00197 
00203     SystemPropertyFunctionCall(txNamespaceMap* aMappings);
00204 
00205     TX_DECL_FUNCTION;
00206 
00207 private:
00208     /*
00209      * resolve namespaceIDs with this node
00210      */
00211     nsRefPtr<txNamespaceMap> mMappings;
00212 };
00213 
00217 class ElementAvailableFunctionCall : public FunctionCall {
00218 
00219 public:
00220 
00226     ElementAvailableFunctionCall(txNamespaceMap* aMappings);
00227 
00228     TX_DECL_FUNCTION;
00229 
00230 private:
00231     /*
00232      * resolve namespaceIDs with this node
00233      */
00234     nsRefPtr<txNamespaceMap> mMappings;
00235 };
00236 
00240 class FunctionAvailableFunctionCall : public FunctionCall {
00241 
00242 public:
00243 
00247     FunctionAvailableFunctionCall(txNamespaceMap* aMappings);
00248 
00249     TX_DECL_FUNCTION;
00250 
00251 private:
00252     /*
00253      * resolve namespaceIDs with this node
00254      */
00255     nsRefPtr<txNamespaceMap> mMappings;
00256 };
00257 
00258 #endif