1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is Mozilla Communicator client code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
23 * Original Author: David W. Hyatt (hyatt@netscape.com)
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
41 Private interface to the XBL service
45 #ifndef nsIXBLService_h__
46 #define nsIXBLService_h__
48 #include "nsISupports.h"
52 class nsPIDOMEventTarget
;
55 class nsIXBLDocumentInfo
;
60 #define NS_IXBLSERVICE_IID \
61 { 0x8d3b37f5, 0xde7e, 0x4595, \
62 { 0xb8, 0x56, 0xf7, 0x11, 0xe8, 0xe7, 0xb5, 0x59 } }
64 class nsIXBLService
: public nsISupports
67 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXBLSERVICE_IID
)
69 // This function loads a particular XBL file and installs all of the bindings
70 // onto the element. aOriginPrincipal must not be null here.
71 NS_IMETHOD
LoadBindings(nsIContent
* aContent
, nsIURI
* aURL
,
72 nsIPrincipal
* aOriginPrincipal
, PRBool aAugmentFlag
,
73 nsXBLBinding
** aBinding
, PRBool
* aResolveStyle
) = 0;
75 // Indicates whether or not a binding is fully loaded.
76 NS_IMETHOD
BindingReady(nsIContent
* aBoundElement
, nsIURI
* aURI
, PRBool
* aIsReady
) = 0;
78 // Retrieves our base class (e.g., tells us what type of frame and content node to build)
79 NS_IMETHOD
ResolveTag(nsIContent
* aContent
, PRInt32
* aNameSpaceID
, nsIAtom
** aResult
) = 0;
81 // This method checks the hashtable and then calls FetchBindingDocument on a
82 // miss. aOriginPrincipal or aBoundDocument may be null to bypass security
84 NS_IMETHOD
LoadBindingDocumentInfo(nsIContent
* aBoundElement
,
85 nsIDocument
* aBoundDocument
,
87 nsIPrincipal
* aOriginPrincipal
,
88 PRBool aForceSyncLoad
,
89 nsIXBLDocumentInfo
** aResult
) = 0;
91 // Hooks up the global key event handlers to the document root.
92 NS_IMETHOD
AttachGlobalKeyHandler(nsPIDOMEventTarget
* aTarget
)=0;
93 NS_IMETHOD
DetachGlobalKeyHandler(nsPIDOMEventTarget
* aTarget
)=0;
97 NS_DEFINE_STATIC_IID_ACCESSOR(nsIXBLService
, NS_IXBLSERVICE_IID
)
99 #endif // nsIXBLService_h__