Scott Lanning wrote:
Is there a reference of all interfaces which you
can switch between with QueryInterface?
For example, you can get a DOMDocumentEvent from
a DOMDocument, or a DOMHTMLSelectElement from a DOMNode
(assuming the DOMNode is a select element).
  Or is there some procedure I could take to
make such a reference? I happened to find this in
content/base/src/nsDocument.cpp of Mozilla 1.7.5

NS_INTERFACE_MAP_BEGIN(nsDocument)
  NS_INTERFACE_MAP_ENTRY(nsIDocument)
  NS_INTERFACE_MAP_ENTRY(nsIDOMDocument)
  NS_INTERFACE_MAP_ENTRY(nsIDOMNSDocument)
  NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentEvent)
  ...
  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDocument)
  /* some code... */
NS_INTERFACE_MAP_END

If I took the NS_INTERFACE_MAP blocks from all .cpp files
in Mozilla, would each set of NS_INTERFACE_MAP_ENTRYs
be the be a set of QueryInterface-able interfaces?

Roughly, that is one way to find it... (See also Bsmedbergs post)

Or all of those sets combined that are within one file?
Hmm, there are also some NS_INTERFACE_MAP_END_INHERITING

This calls QI on the class passed in (baseclass); as NS_INTERFACE_MAP_END_INHERITING(baseclass)


Basically ensures that 'this' can QI to the same stuff as that baseclass.

in there. And NS_IMPL_QUERY_INTERFACEn. I'm lost.

NS_IMPL_QUERY_INTERFACEn(class, n1, n2, ..., n-1, n)

synonym for

NS_QUERY_INTERFACE_MAP_BEGIN(class)
  NS_INTERFACE_MAP_ENTRY(n1)
  NS_INTERFACE_MAP_ENTRY(n2)
  ....
  NS_INTERFACE_MAP_ENTRY(n-1)
  NS_INTERFACE_MAP_AMBIGUOUS(nsISupports, n)
NS_INTERFACE_MAP_END

[where n is allowed to be from 0 to 11]

hope that helps
~Justin Wood (Callek)
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to