/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is ETNA Xml editor. * * The Initial Developer of the Original Code is The Connexions Project. * * Portions created by the Initial Developer are Copyright (C) 2004-2006 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Laurent Jouanneau , Original author * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "nsISupports.idl" #include "nsIArray.idl" #include "domstubs.idl" #include "nsISimpleEnumerator.idl" interface diIValidationSchema; interface diIValidationSchemaQuery; interface diISchemaParserError; /** * */ [scriptable, uuid(fbc62dc9-9ee6-4325-a38d-a528975adb32)] interface diISchemaBlankDocumentInfo : nsISupports { readonly attribute AString label; readonly attribute AString id; readonly attribute AString description; }; /** * this interface is to store all information about a schema installed in * the software : its name, its corresponding validator ... */ [scriptable, uuid(5650fc27-f36d-4e85-808a-91b8a55cac7d)] interface diISchemaDescriptor : nsISupports { readonly attribute AString uri; readonly attribute AString displayName; readonly attribute AString description; readonly attribute AString localesURI; readonly attribute diIValidationSchema schema; readonly attribute diIValidationSchemaQuery schemaQuery; readonly attribute boolean hasError; readonly attribute diISchemaParserError parserError; readonly attribute AString errorMessage; nsISimpleEnumerator enumerateNamespaces(); nsISimpleEnumerator enumerateBlankDocument(); }; /** * a service that is used to manage all schema stored in an application * should implement this interface. */ [scriptable, uuid(fe9c1221-328a-4601-972a-1f3b1b98da78)] interface diISchemaManager : nsISupports { readonly attribute diISchemaParserError lastParserError; readonly attribute AString lastErrorMessage; /** * load a schema and parse it, to retrieve some information about it (name, description, etc..) * It stores this informations in the schema registry * @return true : registration is ok */ boolean registerSchema(in AString aSchemaUri); /** * delete informations about a schema in the schema registry */ boolean unregisterSchema(in AString aSchemaUri); /** * return an enumerator on the diISchemaDescriptor list (the schema registry) */ nsISimpleEnumerator enumerateSchemas(); /** * get the diISchemaDescriptor corresponding to a registered schema. */ diISchemaDescriptor getSchema(in AString aSchemaUri); /** * try to find a registered schema that validate the document */ diISchemaDescriptor getCorrespondingSchema(in nsIDOMDocument aDoc, in boolean aPrepareForEditing); }; [scriptable, uuid(2c482175-0c4f-4f0d-828b-09d1490796cd)] interface diISchemaManagerRunnable : nsISupports { attribute AString schemaURI; }; %{C++ //{0bbd25de-caf2-4a7e-8033-3c4d7a9c9be8} #define DISCHEMA_MANAGER_CONTRACTID "@disruptive-innovations.com/xmleditor/schema-manager;1" #define DISCHEMA_MANAGER_CID { 0x0bbd25de, 0xcaf2, 0x4a7e, { 0x80, 0x33, 0x3c, 0x4d, 0x7a, 0x9c, 0x9b, 0xe8}} #define DISCHEMA_MANAGER_RUNNABLE_CONTRACTID "@disruptive-innovations.com/xmleditor/schema-manager-runnable;1" #define DISCHEMA_MANAGER_RUNNABLE_CID { 0xbe229b77, 0x41db, 0x4c0a, { 0xba, 0x63, 0xd4, 0x90, 0x6d, 0xc4, 0xca, 0xda } } %}