Re: How to add a new class as an input parameter in a idl file

[email protected]
Newsgroups gmane.comp.mozilla.devel.dom
Organization http://groups.google.com
Message-ID <[email protected]>
On May 27, 5:35 pm, Boris Zbarsky <[email protected]> wrote:
> [email protected] wrote:
> > How can I add a new class as an input parameter in a idl file:
> > For example, I add this in a idl file
>
> >  void setMyClass(in MyClass myclass);
>
> Presumably MyClass is actually an interface, not a concrete class?  And in that
> case you should be including whatever IDL file defines it, or just
> forward-declaring it.
>
> If it's a C++ class (so setMyClass must not be a scriptable method, etc), there
> are ways to declare that too.  See, for example,http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/js/src/xpconnect/...
>
> -Boris

Boris,

Thank you.
My case is the 2nd case that you talked about in your mail.

So I add this:
[ptr] native MyClassPtr(MyClass);

And change the setter to :

void setMyClass(in MyClassPtr myClass);

But I get this error:

 Error: methods in [scriptable] interfaces that are non-scriptable
because they refer to native types (parameter "myClass") must be
marked [noscript]

Can you please tell me how can I make the method non-scrpitable? I
look at this as well, I don't understand how to make the method non-
scriptable.

Thank oyu.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.