tags:

views:

88

answers:

2

Hi,

I'm a noob to XPCOM development. In the course of writing XPCOM code in C++, I need to create addtional classes for use inside my XPCOM component. Do I need to create another XPCOM component for such classes? Can't I just add the new class in the header file?

+2  A: 

No, not at all. XPCOM describes the external interface. "Internal" classes are compiled by your C++ compiler. That compiler won't snitch on you, so XPCOM will never know they exist.

For your own sanity, it does make sense to keep those internal classes in their own header.

MSalters
A: 

You need to make interfaces only for the classes that you want to be discoverable and controllable from external sources (such as JavaScript). If some class is only used to implement the functionality of some other interface, then you need not (and should not) define an XPCOM interface for that class.