Zhu Lihua wrote:

> Hi,
> 
> Thank you, Joost, Niklas and Bjoern.
> 
> It's still abit abstract for me. I know SlotIDs are constants defined
> in .hrc files, e.g., sc.hrc. What about WhichIDs?

They are also defined in some hrc or hxx files somewhere.

> Could you please give me a simple example to illustrate the relationship
> between "module", "item", "whichId" and "SlotId"?

"Modules" here means the application module. While slotids mark a
functionality in the UI, whichids mark the corresponding attribute in
the document core of the application.

As an example, we have a slotid that can be used to change the font size
of a text, SID_ATTR_FONT_SIZE. The id has a numerical value that is
defined in svx.hrc. When an item with that slotid is passed to a
SfxDispatcher call to one of our documents, its ID is converted to the
matching whichid that the attribute "font size" has in the "document pool".

> 
>>>From Niklas' explanation, I sense each module have a range of WhichIDs.
> What does "module" means here? Does it mean the application module? 
Yes.

> Writer, calc, impress and so on. "an ItemPool can define a Slot-ID for
> each Which-ID. The same Slot-ID is then used for an item across the
> modules", I can't understand the above explanation. Different module
> have different WhichIDs. How can it use same SlotID? Does it define the
> same SlotID for different WhichID in different modules?

The slotid is a universal ID, it is understood in all modules. In the
code of each application module there is a conversion table that
converts the slot ids into the matching whichids.

Usually you don't need to care for the exact values, you just should be
aware of this fact.

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "nospamfor...@gmx.de".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to