Changes

Jump to: navigation, search

Real World Mozilla First XPCOM Component

134 bytes added, 20:55, 11 November 2007
m
Attributes and Methods
=== Attributes and Methods ===
Next comes the body of your interface. Our interface defines one attribute and one method. AString name; An attribute is a value you can '''Get''' and '''Set''' (NOTE: you can specify attributes that are Get only, that is read-only). We have an attribute called '''name''' of type '''AString''' long add(in long a unicode, or two-byte string class. For more details about strings in Mozilla, see http://developer.mozilla.org/en/docs/XPCOM_string_guidelong b).;
Next comes the body of your interface. Our interface also defines one '''attribute''' and one '''method'''. An attribute is a single method value you can '''Get''' and '''Set''' (NOTE: you can specify attributes that are Get only, that is read-only). We have an attribute called '''addname''' of type '''AString'''(a unicode, which takes or two long integers as input-byte string class. For more details about strings in Mozilla, adds them, and returns see the result as a long integer[http://developer.mozilla.org/en/docs/XPCOM_string_guide XPCOM String Guide]).
Our interface also defines a single method called '''add''', which takes two long integers as input, adds them, and returns the result as a long integer; we'll write that code below. Because we are using the Mozilla build system to help us create our component, we can get it to translate our IDL into .h and .cpp stub files automatically. But To do this we first we have to generate some makefiles.
== Build system changes ==

Navigation menu