Back to index

lightning-sunbird  0.9+nobinonly
rdf.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; 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.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
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 of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or 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 /*
00039 
00040   A catch-all header file for miscellaneous RDF stuff. Currently
00041   contains error codes and vocabulary macros.
00042 
00043  */
00044 
00045 #ifndef rdf_h___
00046 #define rdf_h___
00047 
00048 #include "nsError.h"
00049 
00063 #define DEFINE_RDF_VOCAB(ns, prefix, name) \
00064 static const char kURI##prefix##_##name[] = ns #name
00065 
00070 #define RDF_NAMESPACE_URI  "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
00071 #define WEB_NAMESPACE_URI  "http://home.netscape.com/WEB-rdf#"
00072 #define NC_NAMESPACE_URI   "http://home.netscape.com/NC-rdf#"
00073 #define DEVMO_NAMESPACE_URI_PREFIX "http://developer.mozilla.org/rdf/vocabulary/"
00074 
00080 
00081 /* Returned from nsIRDFCursor::Advance() if the cursor has no more
00082    elements to enuemrate */
00083 #define NS_RDF_CURSOR_EMPTY       NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_RDF, 1)
00084 
00085 /* Returned from nsIRDFDataSource::GetSource() and GetTarget() if the source/target
00086    has no value */
00087 #define NS_RDF_NO_VALUE           NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_RDF, 2)
00088 
00089 /* Returned from nsIRDFDataSource::Assert() and Unassert() if the assertion (or
00090    unassertion was accepted by the datasource*/
00091 #define NS_RDF_ASSERTION_ACCEPTED NS_OK
00092 
00093 /* Returned from nsIRDFDataSource::Assert() and Unassert() if the assertion (or
00094    unassertion) was rejected by the datasource; i.e., the datasource was not
00095    willing to record the statement. */
00096 #define NS_RDF_ASSERTION_REJECTED NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_RDF, 3)
00097 
00098 /* Return this from rdfITripleVisitor to stop cycling */
00099 #define NS_RDF_STOP_VISIT         NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_RDF, 4)
00100 
00101 
00102 
00103 /* ContractID prefixes for RDF DLL registration. */
00104 #define NS_RDF_CONTRACTID                           "@mozilla.org/rdf"
00105 #define NS_RDF_DATASOURCE_CONTRACTID                NS_RDF_CONTRACTID "/datasource;1"
00106 #define NS_RDF_DATASOURCE_CONTRACTID_PREFIX         NS_RDF_DATASOURCE_CONTRACTID "?name="
00107 #define NS_RDF_RESOURCE_FACTORY_CONTRACTID          "@mozilla.org/rdf/resource-factory;1"
00108 #define NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX   NS_RDF_RESOURCE_FACTORY_CONTRACTID "?name="
00109 #define NS_RDF_INFER_DATASOURCE_CONTRACTID_PREFIX   NS_RDF_CONTRACTID "/infer-datasource;1?engine="
00110 
00111 #define NS_RDF_SERIALIZER                            NS_RDF_CONTRACTID "/serializer;1?format="
00112 
00113 // contract ID is in the form
00114 // @mozilla.org/rdf/delegate-factory;1?key=<key>&scheme=<scheme>
00115 #define NS_RDF_DELEGATEFACTORY_CONTRACTID    "@mozilla.org/rdf/delegate-factory;1"
00116 #define NS_RDF_DELEGATEFACTORY_CONTRACTID_PREFIX    NS_RDF_DELEGATEFACTORY_CONTRACTID "?key="
00117 
00120 #endif /* rdf_h___ */