Hi,
I am trying the example in "Creating XPCOM Components". In that document, the webLock component registered "xpcom-startup" and "content-policy" as following:
//suppose "servman" have been initiated
nsCOMPtr<nsICategoryManager>catman;
servman->GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,...);
catman->AddCategoryEntry("xpcom-startup",...)
catman->AddCategoryEntry("content-policy",...)
So my questions are:
a) Is there document, in which I can find all the categoies that mozilla support?
No. XPCOM itself uses only a few categories (xpcom-startup and xpcom-shutdown, and a few others). Components (such as content policy, applications, etc) define and use others. Each component defines what categories they use and how.
b) nsICategoryManager interface is not frozen. So can anyone tell me whether I can use other frozen interface to have my component register to events?
nsICategoryManager is frozen. see http://lxr.mozilla.org/mozilla/source/xpcom/components/nsICategoryManager.idl#43
c) Could you guys explain the observer register and notification machenism?
When XPCOM is finished registration, it looks at the xpcom-startup category. It treats each category entry as a contractID. It does a GetService on that contractID, asks for the nsIObserver interfaces, and fires an observer event at the interface.
--BDS _______________________________________________ Mozilla-xpcom mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-xpcom
