xpcom/base/nsIInterfaceRequestor.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/base/nsIInterfaceRequestor.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +/**
    1.13 + * The nsIInterfaceRequestor interface defines a generic interface for 
    1.14 + * requesting interfaces that a given object might provide access to.
    1.15 + * This is very similar to QueryInterface found in nsISupports.  
    1.16 + * The main difference is that interfaces returned from GetInterface()
    1.17 + * are not required to provide a way back to the object implementing this 
    1.18 + * interface.  The semantics of QI() dictate that given an interface A that 
    1.19 + * you QI() on to get to interface B, you must be able to QI on B to get back 
    1.20 + * to A.  This interface however allows you to obtain an interface C from A 
    1.21 + * that may or most likely will not have the ability to get back to A. 
    1.22 + */
    1.23 +
    1.24 +[scriptable, uuid(033A1470-8B2A-11d3-AF88-00A024FFC08C)]
    1.25 +interface nsIInterfaceRequestor : nsISupports
    1.26 +{
    1.27 +   /**
    1.28 +    * Retrieves the specified interface pointer.
    1.29 +    *
    1.30 +    * @param uuid The IID of the interface being requested.
    1.31 +    * @param result [out] The interface pointer to be filled in if
    1.32 +    *               the interface is accessible.
    1.33 +    * @throws NS_NOINTERFACE - interface not accessible.
    1.34 +    * @throws NS_ERROR* - method failure.
    1.35 +    */
    1.36 +	void getInterface(in nsIIDRef uuid, 
    1.37 +                      [iid_is(uuid),retval] out nsQIResult result);
    1.38 +};
    1.39 +

mercurial