<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dtardon</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dtardon"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Dtardon"/>
	<updated>2026-05-09T12:33:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137331</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137331"/>
		<updated>2009-08-13T06:31:46Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: replace HTML entities in code listings by characters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;lt;type&amp;gt;XDispatch&amp;lt;/type&amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
{&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
 /** is called when the status of the feature changes.&lt;br /&gt;
&lt;br /&gt;
 @param State&lt;br /&gt;
 provides information about changes of the requested feature&lt;br /&gt;
 */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the URL of the feature. */&lt;br /&gt;
 com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
 string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
 boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the &amp;lt;type&amp;gt;XDispatch&amp;lt;/type&amp;gt; has to be requeried. */&lt;br /&gt;
 boolean Requery;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
 any State;&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang { &lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{ &lt;br /&gt;
 // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
 /** initializes the object. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;p&amp;gt;It should be called directly after the object is created.&lt;br /&gt;
 */&lt;br /&gt;
 void initialize( [in] sequence&amp;lt;any&amp;gt; aArguments ) &lt;br /&gt;
 raises( com::sun::star::uno::Exception );&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module util {&lt;br /&gt;
&lt;br /&gt;
published interface XUpdatable: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** refreshes the data of the object from the connected data source. */&lt;br /&gt;
 void update();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//=============================================================================&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides a function to execute the command which is bound to the toolbar controller.&lt;br /&gt;
&lt;br /&gt;
 @param &lt;br /&gt;
 a combination of &amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;gt;KeyModifier&amp;lt;/type&amp;gt; value that represent the current state of the modifier keys.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;p&amp;gt;&lt;br /&gt;
 This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&lt;br /&gt;
 &amp;lt;/p&amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void execute( [in] short KeyModifier );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a single click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void click();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a double click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void doubleClick();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create a popup window for additional functions.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;gt;XWindow&amp;lt;/type&amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createPopupWindow();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create an item window which can be added to the toolbar.&lt;br /&gt;
&lt;br /&gt;
 @param Parent&lt;br /&gt;
 a &amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;gt;XWindow&amp;lt;/type&amp;gt; which must be used as a parent for the requested item window.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;gt;XWindow&amp;lt;/type&amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XSubToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** if the controller features a sub-toolbar. &lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 &amp;lt;TRUE/&amp;gt; if the controller offers a sub toolbar, otherwise &amp;lt;FALSE/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;p&amp;gt;&lt;br /&gt;
 Enables implementations to dynamically decide to support sub-toolbars&lt;br /&gt;
 or not.&lt;br /&gt;
 &amp;lt;/p&amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 boolean opensSubToolbar();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides the resource URL of the sub-toolbar this controller opens.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 name of the sub-toolbar this controller offers. A empty string &lt;br /&gt;
 will be interpreted as if this controller offers no sub-toolbar.&lt;br /&gt;
 */&lt;br /&gt;
 string getSubToolbarName();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that a sub-toolbar function has been &lt;br /&gt;
 selected.&lt;br /&gt;
&lt;br /&gt;
 @param aCommand&lt;br /&gt;
 a string which identifies the function that has been selected by&lt;br /&gt;
 a user.&lt;br /&gt;
 */&lt;br /&gt;
 void functionSelected( [in] string aCommand );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that it should set an image which&lt;br /&gt;
 represents the current selected function.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;p&amp;gt;&lt;br /&gt;
 Only the controller instance is able to set the correct image for the&lt;br /&gt;
 current function. A toolbar implementation will ask sub-toolbar &lt;br /&gt;
 controllers to update their image whenever it has to update the images&lt;br /&gt;
 of all its buttons.&lt;br /&gt;
 &amp;lt;/p&amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void updateImage();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBNewForm&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:Refresh&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SFX2_DLLPUBLIC SfxToolBoxControl:&lt;br /&gt;
    public ::com::sun::star::awt::XDockableWindowListener,&lt;br /&gt;
    public ::com::sun::star::frame::XSubToolbarController,&lt;br /&gt;
    public svt::ToolboxController &lt;br /&gt;
{&lt;br /&gt;
    friend class SfxToolbox;&lt;br /&gt;
    friend class SfxToolBox_Impl;&lt;br /&gt;
    friend class SfxToolboxCustomizer;&lt;br /&gt;
    friend class SfxPopupWindow;&lt;br /&gt;
    friend struct SfxTbxCtrlFactory;&lt;br /&gt;
&lt;br /&gt;
    SfxToolBoxControl_Impl* pImpl;&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
    DECL_LINK( PopupModeEndHdl, void * );&lt;br /&gt;
    DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&lt;br /&gt;
&lt;br /&gt;
    // old SfxToolBoxControl methods&lt;br /&gt;
    virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&lt;br /&gt;
    virtual void Select( BOOL bMod1 = FALSE );&lt;br /&gt;
    virtual void Select( USHORT nModifier );&lt;br /&gt;
&lt;br /&gt;
    virtual void DoubleClick();&lt;br /&gt;
    virtual void Click();&lt;br /&gt;
    virtual SfxPopupWindowType GetPopupWindowType() const;&lt;br /&gt;
    virtual SfxPopupWindow* CreatePopupWindow();&lt;br /&gt;
    virtual SfxPopupWindow* CreatePopupWindowCascading();&lt;br /&gt;
    virtual Window* CreateItemWindow( Window *pParent );&lt;br /&gt;
&lt;br /&gt;
    // Must be called by subclass to set a new popup window instance&lt;br /&gt;
    void SetPopupWindow( SfxPopupWindow* pWindow );&lt;br /&gt;
&lt;br /&gt;
    // XInterface&lt;br /&gt;
    virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL acquire() throw();&lt;br /&gt;
    virtual void SAL_CALL release() throw();&lt;br /&gt;
&lt;br /&gt;
    // XEventListener&lt;br /&gt;
    virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
    // XComponent&lt;br /&gt;
    virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
    // new controller API&lt;br /&gt;
    // XStatusListener&lt;br /&gt;
    virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
    // XToolbarController&lt;br /&gt;
    virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL click() &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL doubleClick() &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::awt::XWindow &amp;gt; SAL_CALL createPopupWindow() &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::awt::XWindow &amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::awt::XWindow &amp;gt;&amp;amp; rParent ) &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
    // XSubToolbarController&lt;br /&gt;
    virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
    // XDockableWindowListener&lt;br /&gt;
    virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &lt;br /&gt;
    virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
    // helper methods&lt;br /&gt;
    void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp; rSubToolBarResName );&lt;br /&gt;
    ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::frame::XFrame &amp;gt;&amp;amp; xFrame, const ::rtl::OUString&amp;amp; rSubToolBarResName );&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
    SFX_DECL_TOOLBOX_CONTROL();&lt;br /&gt;
&lt;br /&gt;
    SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp; rBox, BOOL bShowStrings = FALSE );&lt;br /&gt;
    virtual ~SfxToolBoxControl();&lt;br /&gt;
&lt;br /&gt;
    ToolBox&amp;amp; GetToolBox() const;&lt;br /&gt;
    unsigned short GetId() const;&lt;br /&gt;
    unsigned short GetSlotId() const;&lt;br /&gt;
&lt;br /&gt;
    void Dispatch( &lt;br /&gt;
    const ::rtl::OUString&amp;amp; aCommand, &lt;br /&gt;
    ::com::sun::star::uno::Sequence&amp;lt; ::com::sun::star::beans::PropertyValue &amp;gt;&amp;amp; aArgs );&lt;br /&gt;
    static void Dispatch( &lt;br /&gt;
    const ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;gt;&amp;amp; rDispatchProvider, const rtl::OUString&amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;lt; ::com::sun::star::beans::PropertyValue &amp;gt;&amp;amp; aArgs );&lt;br /&gt;
&lt;br /&gt;
    static SfxItemState GetItemState( const SfxPoolItem* pState );&lt;br /&gt;
    static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service StatusbarController&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** with this interface a component can receive events if a feature has &lt;br /&gt;
 changed.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;p&amp;gt;&lt;br /&gt;
 The statusbar controller implementation should register itself as a &lt;br /&gt;
 listener when its &amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;gt;XUpdatable&amp;lt;/member&amp;gt; &lt;br /&gt;
 interface has been called.&lt;br /&gt;
 &amp;lt;/p&amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
 /** used to initialize a component with required arguments.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;b&amp;gt;A statusbar controller needs at least three additional arguments &lt;br /&gt;
 provided as &amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;gt;PropertyValue&amp;lt;/type&amp;gt;:&lt;br /&gt;
 &amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Frame&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;a &lt;br /&gt;
 &amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;gt;XFrame&amp;lt;/type&amp;gt; instance&lt;br /&gt;
 to which the toolbar controller belongs.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;&amp;lt;b&amp;gt;CommandURL&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;a string which specifies the command a &lt;br /&gt;
 statusbar controller is bound.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;&amp;lt;b&amp;gt;ServiceManager&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;a &amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;gt;&lt;br /&gt;
 XMultiServiceFactory&amp;lt;/type&amp;gt; instance which can be used to &lt;br /&gt;
 create additional UNO services.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;/ul&amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
 /** used to notify an implementation that it needs to add its listener or &lt;br /&gt;
 remove and add them again.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;p&amp;gt;&lt;br /&gt;
 A status bar controller instance is ready for use after this call has &lt;br /&gt;
 been made the first time. The status bar implementation guarentees that &lt;br /&gt;
 the controller&amp;#039;s item window has been added to the status bar and its &lt;br /&gt;
 reference is held by it.&lt;br /&gt;
 &amp;lt;/p&amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** used to notify changed features and requests for additional user &lt;br /&gt;
 interface items.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;p&amp;gt;&lt;br /&gt;
 Mostly used by a status bar implementation to forward information to &lt;br /&gt;
 and request services from a status bar controller component. This &lt;br /&gt;
 interface must be useable after &lt;br /&gt;
 &amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;gt;XInitialitation::initialize&amp;lt;/member&amp;gt; &lt;br /&gt;
 has been called. The behavior of the interface is undefined if the &lt;br /&gt;
 controller component hasn&amp;#039;t been initialized.&lt;br /&gt;
 &amp;lt;/p&amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::frame::XStatusbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang { &lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{ &lt;br /&gt;
 // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
 /** initializes the object. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;p&amp;gt;It should be called directly after the object is created.&lt;br /&gt;
 */&lt;br /&gt;
 void initialize( [in] sequence&amp;lt;any&amp;gt; aArguments ) &lt;br /&gt;
 raises( com::sun::star::uno::Exception );&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module util {&lt;br /&gt;
&lt;br /&gt;
published interface XUpdatable: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** refreshes the data of the object from the connected data source. */&lt;br /&gt;
 void update();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//=============================================================================&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XStatusbarController : ::com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse button has been pressed. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;lt;TRUE/&amp;gt; if the event should not be processed and &amp;lt;FALSE/&amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse has been moved. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;lt;TRUE/&amp;gt; if the event should not be processed and &amp;lt;FALSE/&amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse button has been released. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;lt;TRUE/&amp;gt; if the event should not be processed and &amp;lt;FALSE/&amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if a command event is available for a controller.&lt;br /&gt;
&lt;br /&gt;
 @param aPos&lt;br /&gt;
 the current mouse position in pixel.&lt;br /&gt;
&lt;br /&gt;
 @param nCommand&lt;br /&gt;
 describes which command has been invoked.&lt;br /&gt;
&lt;br /&gt;
 @param bMouseEvent&lt;br /&gt;
 &amp;lt;TRUE/&amp;gt; if the command is based on a mouse event, otherwise &amp;lt;FALSE/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 @param aData&lt;br /&gt;
 for future use only.&lt;br /&gt;
 */&lt;br /&gt;
 void command( [in] ::com::sun::star::awt::Point aPos,&lt;br /&gt;
 [in] long nCommand,&lt;br /&gt;
 [in] boolean bMouseEvent,&lt;br /&gt;
 [in] any aData );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if a command event is available for a controller.&lt;br /&gt;
&lt;br /&gt;
 @param xGraphics&lt;br /&gt;
 the current graphics which should be used for painting.&lt;br /&gt;
&lt;br /&gt;
 @param rOutputRectangle&lt;br /&gt;
 the output rectangle for graphic operations.&lt;br /&gt;
&lt;br /&gt;
 @param nItemId&lt;br /&gt;
 the item id of the controller.&lt;br /&gt;
&lt;br /&gt;
 @param nStyle&lt;br /&gt;
 the style of the statusbar item. The controller should respect the provided&lt;br /&gt;
&lt;br /&gt;
style when paints.&lt;br /&gt;
 */&lt;br /&gt;
 void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&lt;br /&gt;
 [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&lt;br /&gt;
 [in] long nItemId,&lt;br /&gt;
 [in] long nStyle );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the user clicked with mouse into the &lt;br /&gt;
 field of the corresponding control.&lt;br /&gt;
 */&lt;br /&gt;
 void click();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the user double-clicked with mouse &lt;br /&gt;
 into the field of the corresponding control.&lt;br /&gt;
 */&lt;br /&gt;
 void doubleClick();&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBStatusType&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBStatusDBName&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:StatusbarLogo&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value/&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&lt;br /&gt;
{&lt;br /&gt;
 USHORT nSlotId;&lt;br /&gt;
 USHORT nId;&lt;br /&gt;
 StatusBar* pBar;&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 // new controller API&lt;br /&gt;
 // XInterface&lt;br /&gt;
 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL acquire() throw();&lt;br /&gt;
 virtual void SAL_CALL release() throw();&lt;br /&gt;
&lt;br /&gt;
 // XEventListener&lt;br /&gt;
 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XComponent&lt;br /&gt;
 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // XStatusListener&lt;br /&gt;
 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XStatusbarController&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp; aPos, &lt;br /&gt;
 ::sal_Int32 nCommand, &lt;br /&gt;
 ::sal_Bool bMouseEvent, &lt;br /&gt;
 const ::com::sun::star::uno::Any&amp;amp; aData ) &lt;br /&gt;
&lt;br /&gt;
throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::awt::XGraphics &amp;gt;&amp;amp; xGraphics, &lt;br /&gt;
 const ::com::sun::star::awt::Rectangle&amp;amp; rOutputRectangle, &lt;br /&gt;
 ::sal_Int32 nItemId, &lt;br /&gt;
 ::sal_Int32 nStyle )&lt;br /&gt;
&lt;br /&gt;
throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // Old sfx2 interface&lt;br /&gt;
 virtual void StateChanged( USHORT nSID, SfxItemState eState,&lt;br /&gt;
 const SfxPoolItem* pState );&lt;br /&gt;
 virtual void Click();&lt;br /&gt;
 virtual void DoubleClick();&lt;br /&gt;
 virtual void Command( const CommandEvent&amp;amp; rCEvt );&lt;br /&gt;
 virtual BOOL MouseButtonDown( const MouseEvent &amp;amp; );&lt;br /&gt;
 virtual BOOL MouseMove( const MouseEvent &amp;amp; );&lt;br /&gt;
 virtual BOOL MouseButtonUp( const MouseEvent &amp;amp; );&lt;br /&gt;
 virtual void Paint( const UserDrawEvent &amp;amp;rUDEvt );&lt;br /&gt;
&lt;br /&gt;
 static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp; rBar );&lt;br /&gt;
 virtual ~SfxStatusBarControl();&lt;br /&gt;
&lt;br /&gt;
 USHORT GetSlotId() const { return nSlotId; }&lt;br /&gt;
 USHORT GetId() const { return nId; }&lt;br /&gt;
 StatusBar&amp;amp; GetStatusBar() const { return *pBar; }&lt;br /&gt;
 void CaptureMouse();&lt;br /&gt;
 void ReleaseMouse();&lt;br /&gt;
&lt;br /&gt;
 static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&lt;br /&gt;
if ( bNotify &amp;amp;&amp;amp; pContnr )&lt;br /&gt;
{&lt;br /&gt;
  ::com::sun::star::uno::Any aState;&lt;br /&gt;
  if ( ( eState &amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;&amp;amp; pState &amp;amp;&amp;amp; !IsInvalidItem( pState ) &amp;amp;&amp;amp; !pState-&amp;gt;ISA(SfxVoidItem) )&lt;br /&gt;
  {&lt;br /&gt;
    // Retrieve metric from pool to have correct sub ID when calling QueryValue&lt;br /&gt;
    USHORT nSubId( 0 );&lt;br /&gt;
    SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&lt;br /&gt;
&lt;br /&gt;
    // retrieve the core metric&lt;br /&gt;
    // it&amp;#039;s enough to check the objectshell, the only shell that does not &lt;br /&gt;
    // use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&lt;br /&gt;
    if ( pSlotServ &amp;amp;&amp;amp; pDispatcher )&lt;br /&gt;
    {&lt;br /&gt;
      SfxShell* pShell = pDispatcher-&amp;gt;GetShell( pSlotServ-&amp;gt;GetShellLevel() );&lt;br /&gt;
      DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&lt;br /&gt;
      if ( pShell )&lt;br /&gt;
        eMapUnit = GetCoreMetric( pShell-&amp;gt;GetPool(), nSID );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if ( eMapUnit == SFX_MAPUNIT_TWIP )&lt;br /&gt;
      nSubId |= CONVERT_TWIPS;&lt;br /&gt;
    pState-&amp;gt;QueryValue( aState, (BYTE)nSubId );&lt;br /&gt;
  }&lt;br /&gt;
  else if ( eState == SFX_ITEM_DONTCARE )&lt;br /&gt;
  {&lt;br /&gt;
    // Use special uno struct to transport don&amp;#039;t care state&lt;br /&gt;
    ::com::sun::star::frame::status::ItemStatus aItemStatus;&lt;br /&gt;
    aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&lt;br /&gt;
    aState = makeAny( aItemStatus );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  ::com::sun::star::frame::FeatureStateEvent aEvent;&lt;br /&gt;
  aEvent.FeatureURL = aDispatchURL;&lt;br /&gt;
  aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&lt;br /&gt;
  aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&lt;br /&gt;
  aEvent.Requery = sal_False;&lt;br /&gt;
  aEvent.State = aState;&lt;br /&gt;
&lt;br /&gt;
  ::cppu::OInterfaceIteratorHelper aIt( *pContnr );&lt;br /&gt;
  while( aIt.hasMoreElements() )&lt;br /&gt;
  {&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
      ((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;gt;statusChanged( aEvent );&lt;br /&gt;
    }&lt;br /&gt;
    catch( ::com::sun::star::uno::RuntimeException&amp;amp; )&lt;br /&gt;
    {&lt;br /&gt;
      aIt.remove();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SVL_DLLPUBLIC SfxPoolItem&lt;br /&gt;
{&lt;br /&gt;
friend class SfxItemPool;&lt;br /&gt;
friend class SfxItemDesruptor_Impl;&lt;br /&gt;
friend class SfxItemPoolCache;&lt;br /&gt;
friend class SfxItemSet;&lt;br /&gt;
friend class SfxVoidItem;&lt;br /&gt;
&lt;br /&gt;
 ULONG nRefCount; // Referenzzaehler&lt;br /&gt;
 USHORT nWhich;&lt;br /&gt;
 USHORT nKind;&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
 inline void SetRefCount( ULONG n );&lt;br /&gt;
 inline void SetKind( USHORT n );&lt;br /&gt;
public:&lt;br /&gt;
 inline ULONG AddRef( ULONG n = 1 ) const;&lt;br /&gt;
private:&lt;br /&gt;
 inline ULONG ReleaseRef( ULONG n = 1 ) const;&lt;br /&gt;
 SVL_DLLPRIVATE long Delete_Impl(void*);&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 SfxPoolItem( USHORT nWhich = 0 );&lt;br /&gt;
 SfxPoolItem( const SfxPoolItem&amp;amp; );&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 TYPEINFO();&lt;br /&gt;
&lt;br /&gt;
 virtual ~SfxPoolItem();&lt;br /&gt;
 void SetWhich( USHORT nId ) &lt;br /&gt;
 { DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&lt;br /&gt;
 USHORT Which() const { DBG_CHKTHIS(SfxPoolItem, 0); return nWhich; }&lt;br /&gt;
 virtual int operator==( const SfxPoolItem&amp;amp; ) const = 0;&lt;br /&gt;
 int operator!=( const SfxPoolItem&amp;amp; rItem ) const&lt;br /&gt;
 { return !(*this == rItem); }&lt;br /&gt;
 virtual int Compare( const SfxPoolItem &amp;amp;rWith ) const;&lt;br /&gt;
 virtual int Compare( const SfxPoolItem &amp;amp;rWith, const IntlWrapper&amp;amp; rIntlWrapper ) const;&lt;br /&gt;
&lt;br /&gt;
 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&lt;br /&gt;
 SfxMapUnit eCoreMetric,&lt;br /&gt;
 SfxMapUnit ePresentationMetric,&lt;br /&gt;
 XubString &amp;amp;rText,&lt;br /&gt;
 const IntlWrapper * pIntlWrapper = 0 ) const;&lt;br /&gt;
&lt;br /&gt;
 virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;&lt;br /&gt;
 virtual int ScaleMetrics( long lMult, long lDiv );&lt;br /&gt;
 virtual int HasMetrics() const;&lt;br /&gt;
&lt;br /&gt;
 virtual BOOL QueryValue( com::sun::star::uno::Any&amp;amp; rVal, BYTE nMemberId = 0 ) const;&lt;br /&gt;
 virtual BOOL PutValue( const com::sun::star::uno::Any&amp;amp; rVal, BYTE nMemberId = 0 );&lt;br /&gt;
&lt;br /&gt;
 virtual SfxPoolItem* Create( SvStream &amp;amp;, USHORT nItemVersion ) const;&lt;br /&gt;
 virtual SvStream&amp;amp; Store( SvStream &amp;amp;, USHORT nItemVersion ) const;&lt;br /&gt;
 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;&lt;br /&gt;
&lt;br /&gt;
 ULONG GetRefCount() const { return nRefCount; }&lt;br /&gt;
 inline USHORT GetKind() const { return nKind; }&lt;br /&gt;
&lt;br /&gt;
 static bool readByteString(SvStream &amp;amp; rStream, UniString &amp;amp; rString);&lt;br /&gt;
 static void writeByteString(SvStream &amp;amp; rStream,UniString const &amp;amp; rString);&lt;br /&gt;
 static bool readUnicodeString(SvStream &amp;amp; rStream, UniString &amp;amp; rString, bool bUnicode);&lt;br /&gt;
 static void writeUnicodeString(SvStream &amp;amp; rStream, UniString const &amp;amp; rString);&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
 SfxPoolItem&amp;amp; operator=( const SfxPoolItem&amp;amp; ); // n.i.!!&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp; rVal, BYTE nMemberId ) const&lt;br /&gt;
{&lt;br /&gt;
  sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS);&lt;br /&gt;
  nMemberId &amp;amp;= ~CONVERT_TWIPS;&lt;br /&gt;
  switch( nMemberId )&lt;br /&gt;
  {&lt;br /&gt;
    // jetzt alles signed&lt;br /&gt;
    case 0:&lt;br /&gt;
    {&lt;br /&gt;
      ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&lt;br /&gt;
      aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&lt;br /&gt;
      aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&lt;br /&gt;
      aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&lt;br /&gt;
      aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&lt;br /&gt;
      rVal &amp;lt;&amp;lt;= aUpperLowerMarginScale;&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    case MID_UP_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); break;&lt;br /&gt;
    case MID_LO_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); break;&lt;br /&gt;
    case MID_UP_REL_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int16) nPropUpper; break;&lt;br /&gt;
    case MID_LO_REL_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int16) nPropLower; break;&lt;br /&gt;
  }&lt;br /&gt;
  return sal_True;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137321</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137321"/>
		<updated>2009-08-13T05:55:45Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: replace HTML entities in the code showing class SfxToolBoxControl by characters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
{&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
 /** is called when the status of the feature changes.&lt;br /&gt;
&lt;br /&gt;
 @param State&lt;br /&gt;
 provides information about changes of the requested feature&lt;br /&gt;
 */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the URL of the feature. */&lt;br /&gt;
 com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
 string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
 boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
 boolean Requery;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
 any State;&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang { &lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{ &lt;br /&gt;
 // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
 /** initializes the object. &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&lt;br /&gt;
 */&lt;br /&gt;
 void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &lt;br /&gt;
 raises( com::sun::star::uno::Exception );&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module util {&lt;br /&gt;
&lt;br /&gt;
published interface XUpdatable: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** refreshes the data of the object from the connected data source. */&lt;br /&gt;
 void update();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//=============================================================================&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides a function to execute the command which is bound to the toolbar controller.&lt;br /&gt;
&lt;br /&gt;
 @param &lt;br /&gt;
 a combination of &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;KeyModifier&amp;amp;lt;/type&amp;amp;gt; value that represent the current state of the modifier keys.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void execute( [in] short KeyModifier );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a single click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void click();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a double click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void doubleClick();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create a popup window for additional functions.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createPopupWindow();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create an item window which can be added to the toolbar.&lt;br /&gt;
&lt;br /&gt;
 @param Parent&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which must be used as a parent for the requested item window.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XSubToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** if the controller features a sub-toolbar. &lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 &amp;amp;lt;TRUE/&amp;amp;gt; if the controller offers a sub toolbar, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Enables implementations to dynamically decide to support sub-toolbars&lt;br /&gt;
 or not.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 boolean opensSubToolbar();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides the resource URL of the sub-toolbar this controller opens.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 name of the sub-toolbar this controller offers. A empty string &lt;br /&gt;
 will be interpreted as if this controller offers no sub-toolbar.&lt;br /&gt;
 */&lt;br /&gt;
 string getSubToolbarName();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that a sub-toolbar function has been &lt;br /&gt;
 selected.&lt;br /&gt;
&lt;br /&gt;
 @param aCommand&lt;br /&gt;
 a string which identifies the function that has been selected by&lt;br /&gt;
 a user.&lt;br /&gt;
 */&lt;br /&gt;
 void functionSelected( [in] string aCommand );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that it should set an image which&lt;br /&gt;
 represents the current selected function.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Only the controller instance is able to set the correct image for the&lt;br /&gt;
 current function. A toolbar implementation will ask sub-toolbar &lt;br /&gt;
 controllers to update their image whenever it has to update the images&lt;br /&gt;
 of all its buttons.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void updateImage();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBNewForm&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:Refresh&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SFX2_DLLPUBLIC SfxToolBoxControl:&lt;br /&gt;
    public ::com::sun::star::awt::XDockableWindowListener,&lt;br /&gt;
    public ::com::sun::star::frame::XSubToolbarController,&lt;br /&gt;
    public svt::ToolboxController &lt;br /&gt;
{&lt;br /&gt;
    friend class SfxToolbox;&lt;br /&gt;
    friend class SfxToolBox_Impl;&lt;br /&gt;
    friend class SfxToolboxCustomizer;&lt;br /&gt;
    friend class SfxPopupWindow;&lt;br /&gt;
    friend struct SfxTbxCtrlFactory;&lt;br /&gt;
&lt;br /&gt;
    SfxToolBoxControl_Impl* pImpl;&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
    DECL_LINK( PopupModeEndHdl, void * );&lt;br /&gt;
    DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&lt;br /&gt;
&lt;br /&gt;
    // old SfxToolBoxControl methods&lt;br /&gt;
    virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&lt;br /&gt;
    virtual void Select( BOOL bMod1 = FALSE );&lt;br /&gt;
    virtual void Select( USHORT nModifier );&lt;br /&gt;
&lt;br /&gt;
    virtual void DoubleClick();&lt;br /&gt;
    virtual void Click();&lt;br /&gt;
    virtual SfxPopupWindowType GetPopupWindowType() const;&lt;br /&gt;
    virtual SfxPopupWindow* CreatePopupWindow();&lt;br /&gt;
    virtual SfxPopupWindow* CreatePopupWindowCascading();&lt;br /&gt;
    virtual Window* CreateItemWindow( Window *pParent );&lt;br /&gt;
&lt;br /&gt;
    // Must be called by subclass to set a new popup window instance&lt;br /&gt;
    void SetPopupWindow( SfxPopupWindow* pWindow );&lt;br /&gt;
&lt;br /&gt;
    // XInterface&lt;br /&gt;
    virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL acquire() throw();&lt;br /&gt;
    virtual void SAL_CALL release() throw();&lt;br /&gt;
&lt;br /&gt;
    // XEventListener&lt;br /&gt;
    virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
    // XComponent&lt;br /&gt;
    virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
    // new controller API&lt;br /&gt;
    // XStatusListener&lt;br /&gt;
    virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
    // XToolbarController&lt;br /&gt;
    virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL click() &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL doubleClick() &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::awt::XWindow &amp;gt; SAL_CALL createPopupWindow() &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::awt::XWindow &amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::awt::XWindow &amp;gt;&amp;amp; rParent ) &lt;br /&gt;
    throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
    // XSubToolbarController&lt;br /&gt;
    virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
    // XDockableWindowListener&lt;br /&gt;
    virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &lt;br /&gt;
    virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
    virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
    // helper methods&lt;br /&gt;
    void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp; rSubToolBarResName );&lt;br /&gt;
    ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::frame::XFrame &amp;gt;&amp;amp; xFrame, const ::rtl::OUString&amp;amp; rSubToolBarResName );&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
    SFX_DECL_TOOLBOX_CONTROL();&lt;br /&gt;
&lt;br /&gt;
    SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp; rBox, BOOL bShowStrings = FALSE );&lt;br /&gt;
    virtual ~SfxToolBoxControl();&lt;br /&gt;
&lt;br /&gt;
    ToolBox&amp;amp; GetToolBox() const;&lt;br /&gt;
    unsigned short GetId() const;&lt;br /&gt;
    unsigned short GetSlotId() const;&lt;br /&gt;
&lt;br /&gt;
    void Dispatch( &lt;br /&gt;
    const ::rtl::OUString&amp;amp; aCommand, &lt;br /&gt;
    ::com::sun::star::uno::Sequence&amp;lt; ::com::sun::star::beans::PropertyValue &amp;gt;&amp;amp; aArgs );&lt;br /&gt;
    static void Dispatch( &lt;br /&gt;
    const ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;gt;&amp;amp; rDispatchProvider, const rtl::OUString&amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;lt; ::com::sun::star::beans::PropertyValue &amp;gt;&amp;amp; aArgs );&lt;br /&gt;
&lt;br /&gt;
    static SfxItemState GetItemState( const SfxPoolItem* pState );&lt;br /&gt;
    static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service StatusbarController&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** with this interface a component can receive events if a feature has &lt;br /&gt;
 changed.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 The statusbar controller implementation should register itself as a &lt;br /&gt;
 listener when its &amp;amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;amp;gt;XUpdatable&amp;amp;lt;/member&amp;amp;gt; &lt;br /&gt;
 interface has been called.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
 /** used to initialize a component with required arguments.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;b&amp;amp;gt;A statusbar controller needs at least three additional arguments &lt;br /&gt;
 provided as &amp;amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;amp;gt;PropertyValue&amp;amp;lt;/type&amp;amp;gt;:&lt;br /&gt;
 &amp;amp;lt;ul&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Frame&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &lt;br /&gt;
 &amp;amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;amp;gt;XFrame&amp;amp;lt;/type&amp;amp;gt; instance&lt;br /&gt;
 to which the toolbar controller belongs.&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;CommandURL&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a string which specifies the command a &lt;br /&gt;
 statusbar controller is bound.&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;ServiceManager&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;&lt;br /&gt;
 XMultiServiceFactory&amp;amp;lt;/type&amp;amp;gt; instance which can be used to &lt;br /&gt;
 create additional UNO services.&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
 /** used to notify an implementation that it needs to add its listener or &lt;br /&gt;
 remove and add them again.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 A status bar controller instance is ready for use after this call has &lt;br /&gt;
 been made the first time. The status bar implementation guarentees that &lt;br /&gt;
 the controller&amp;#039;s item window has been added to the status bar and its &lt;br /&gt;
 reference is held by it.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** used to notify changed features and requests for additional user &lt;br /&gt;
 interface items.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Mostly used by a status bar implementation to forward information to &lt;br /&gt;
 and request services from a status bar controller component. This &lt;br /&gt;
 interface must be useable after &lt;br /&gt;
 &amp;amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;XInitialitation::initialize&amp;amp;lt;/member&amp;amp;gt; &lt;br /&gt;
 has been called. The behavior of the interface is undefined if the &lt;br /&gt;
 controller component hasn&amp;#039;t been initialized.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::frame::XStatusbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang { &lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{ &lt;br /&gt;
 // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
 /** initializes the object. &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&lt;br /&gt;
 */&lt;br /&gt;
 void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &lt;br /&gt;
 raises( com::sun::star::uno::Exception );&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module util {&lt;br /&gt;
&lt;br /&gt;
published interface XUpdatable: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** refreshes the data of the object from the connected data source. */&lt;br /&gt;
 void update();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//=============================================================================&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XStatusbarController : ::com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse button has been pressed. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse has been moved. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse button has been released. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if a command event is available for a controller.&lt;br /&gt;
&lt;br /&gt;
 @param aPos&lt;br /&gt;
 the current mouse position in pixel.&lt;br /&gt;
&lt;br /&gt;
 @param nCommand&lt;br /&gt;
 describes which command has been invoked.&lt;br /&gt;
&lt;br /&gt;
 @param bMouseEvent&lt;br /&gt;
 &amp;amp;lt;TRUE/&amp;amp;gt; if the command is based on a mouse event, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 @param aData&lt;br /&gt;
 for future use only.&lt;br /&gt;
 */&lt;br /&gt;
 void command( [in] ::com::sun::star::awt::Point aPos,&lt;br /&gt;
 [in] long nCommand,&lt;br /&gt;
 [in] boolean bMouseEvent,&lt;br /&gt;
 [in] any aData );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if a command event is available for a controller.&lt;br /&gt;
&lt;br /&gt;
 @param xGraphics&lt;br /&gt;
 the current graphics which should be used for painting.&lt;br /&gt;
&lt;br /&gt;
 @param rOutputRectangle&lt;br /&gt;
 the output rectangle for graphic operations.&lt;br /&gt;
&lt;br /&gt;
 @param nItemId&lt;br /&gt;
 the item id of the controller.&lt;br /&gt;
&lt;br /&gt;
 @param nStyle&lt;br /&gt;
 the style of the statusbar item. The controller should respect the provided&lt;br /&gt;
&lt;br /&gt;
style when paints.&lt;br /&gt;
 */&lt;br /&gt;
 void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&lt;br /&gt;
 [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&lt;br /&gt;
 [in] long nItemId,&lt;br /&gt;
 [in] long nStyle );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the user clicked with mouse into the &lt;br /&gt;
 field of the corresponding control.&lt;br /&gt;
 */&lt;br /&gt;
 void click();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the user double-clicked with mouse &lt;br /&gt;
 into the field of the corresponding control.&lt;br /&gt;
 */&lt;br /&gt;
 void doubleClick();&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBStatusType&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBStatusDBName&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:StatusbarLogo&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value/&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&lt;br /&gt;
{&lt;br /&gt;
 USHORT nSlotId;&lt;br /&gt;
 USHORT nId;&lt;br /&gt;
 StatusBar* pBar;&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 // new controller API&lt;br /&gt;
 // XInterface&lt;br /&gt;
 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL acquire() throw();&lt;br /&gt;
 virtual void SAL_CALL release() throw();&lt;br /&gt;
&lt;br /&gt;
 // XEventListener&lt;br /&gt;
 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XComponent&lt;br /&gt;
 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // XStatusListener&lt;br /&gt;
 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XStatusbarController&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp;amp; aPos, &lt;br /&gt;
 ::sal_Int32 nCommand, &lt;br /&gt;
 ::sal_Bool bMouseEvent, &lt;br /&gt;
 const ::com::sun::star::uno::Any&amp;amp;amp; aData ) &lt;br /&gt;
&lt;br /&gt;
throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XGraphics &amp;amp;gt;&amp;amp;amp; xGraphics, &lt;br /&gt;
 const ::com::sun::star::awt::Rectangle&amp;amp;amp; rOutputRectangle, &lt;br /&gt;
 ::sal_Int32 nItemId, &lt;br /&gt;
 ::sal_Int32 nStyle )&lt;br /&gt;
&lt;br /&gt;
throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // Old sfx2 interface&lt;br /&gt;
 virtual void StateChanged( USHORT nSID, SfxItemState eState,&lt;br /&gt;
 const SfxPoolItem* pState );&lt;br /&gt;
 virtual void Click();&lt;br /&gt;
 virtual void DoubleClick();&lt;br /&gt;
 virtual void Command( const CommandEvent&amp;amp;amp; rCEvt );&lt;br /&gt;
 virtual BOOL MouseButtonDown( const MouseEvent &amp;amp;amp; );&lt;br /&gt;
 virtual BOOL MouseMove( const MouseEvent &amp;amp;amp; );&lt;br /&gt;
 virtual BOOL MouseButtonUp( const MouseEvent &amp;amp;amp; );&lt;br /&gt;
 virtual void Paint( const UserDrawEvent &amp;amp;amp;rUDEvt );&lt;br /&gt;
&lt;br /&gt;
 static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp;amp; rBar );&lt;br /&gt;
 virtual ~SfxStatusBarControl();&lt;br /&gt;
&lt;br /&gt;
 USHORT GetSlotId() const { return nSlotId; }&lt;br /&gt;
 USHORT GetId() const { return nId; }&lt;br /&gt;
 StatusBar&amp;amp;amp; GetStatusBar() const { return *pBar; }&lt;br /&gt;
 void CaptureMouse();&lt;br /&gt;
 void ReleaseMouse();&lt;br /&gt;
&lt;br /&gt;
 static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&lt;br /&gt;
if ( bNotify &amp;amp;&amp;amp; pContnr )&lt;br /&gt;
{&lt;br /&gt;
  ::com::sun::star::uno::Any aState;&lt;br /&gt;
  if ( ( eState &amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;&amp;amp; pState &amp;amp;&amp;amp; !IsInvalidItem( pState ) &amp;amp;&amp;amp; !pState-&amp;gt;ISA(SfxVoidItem) )&lt;br /&gt;
  {&lt;br /&gt;
    // Retrieve metric from pool to have correct sub ID when calling QueryValue&lt;br /&gt;
    USHORT nSubId( 0 );&lt;br /&gt;
    SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&lt;br /&gt;
&lt;br /&gt;
    // retrieve the core metric&lt;br /&gt;
    // it&amp;#039;s enough to check the objectshell, the only shell that does not &lt;br /&gt;
    // use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&lt;br /&gt;
    if ( pSlotServ &amp;amp;&amp;amp; pDispatcher )&lt;br /&gt;
    {&lt;br /&gt;
      SfxShell* pShell = pDispatcher-&amp;gt;GetShell( pSlotServ-&amp;gt;GetShellLevel() );&lt;br /&gt;
      DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&lt;br /&gt;
      if ( pShell )&lt;br /&gt;
        eMapUnit = GetCoreMetric( pShell-&amp;gt;GetPool(), nSID );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if ( eMapUnit == SFX_MAPUNIT_TWIP )&lt;br /&gt;
      nSubId |= CONVERT_TWIPS;&lt;br /&gt;
    pState-&amp;gt;QueryValue( aState, (BYTE)nSubId );&lt;br /&gt;
  }&lt;br /&gt;
  else if ( eState == SFX_ITEM_DONTCARE )&lt;br /&gt;
  {&lt;br /&gt;
    // Use special uno struct to transport don&amp;#039;t care state&lt;br /&gt;
    ::com::sun::star::frame::status::ItemStatus aItemStatus;&lt;br /&gt;
    aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&lt;br /&gt;
    aState = makeAny( aItemStatus );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  ::com::sun::star::frame::FeatureStateEvent aEvent;&lt;br /&gt;
  aEvent.FeatureURL = aDispatchURL;&lt;br /&gt;
  aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&lt;br /&gt;
  aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&lt;br /&gt;
  aEvent.Requery = sal_False;&lt;br /&gt;
  aEvent.State = aState;&lt;br /&gt;
&lt;br /&gt;
  ::cppu::OInterfaceIteratorHelper aIt( *pContnr );&lt;br /&gt;
  while( aIt.hasMoreElements() )&lt;br /&gt;
  {&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
      ((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;gt;statusChanged( aEvent );&lt;br /&gt;
    }&lt;br /&gt;
    catch( ::com::sun::star::uno::RuntimeException&amp;amp; )&lt;br /&gt;
    {&lt;br /&gt;
      aIt.remove();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SVL_DLLPUBLIC SfxPoolItem&lt;br /&gt;
{&lt;br /&gt;
friend class SfxItemPool;&lt;br /&gt;
friend class SfxItemDesruptor_Impl;&lt;br /&gt;
friend class SfxItemPoolCache;&lt;br /&gt;
friend class SfxItemSet;&lt;br /&gt;
friend class SfxVoidItem;&lt;br /&gt;
&lt;br /&gt;
 ULONG nRefCount; // Referenzzaehler&lt;br /&gt;
 USHORT nWhich;&lt;br /&gt;
 USHORT nKind;&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
 inline void SetRefCount( ULONG n );&lt;br /&gt;
 inline void SetKind( USHORT n );&lt;br /&gt;
public:&lt;br /&gt;
 inline ULONG AddRef( ULONG n = 1 ) const;&lt;br /&gt;
private:&lt;br /&gt;
 inline ULONG ReleaseRef( ULONG n = 1 ) const;&lt;br /&gt;
 SVL_DLLPRIVATE long Delete_Impl(void*);&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 SfxPoolItem( USHORT nWhich = 0 );&lt;br /&gt;
 SfxPoolItem( const SfxPoolItem&amp;amp; );&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 TYPEINFO();&lt;br /&gt;
&lt;br /&gt;
 virtual ~SfxPoolItem();&lt;br /&gt;
 void SetWhich( USHORT nId ) &lt;br /&gt;
 { DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&lt;br /&gt;
 USHORT Which() const { DBG_CHKTHIS(SfxPoolItem, 0); return nWhich; }&lt;br /&gt;
 virtual int operator==( const SfxPoolItem&amp;amp; ) const = 0;&lt;br /&gt;
 int operator!=( const SfxPoolItem&amp;amp; rItem ) const&lt;br /&gt;
 { return !(*this == rItem); }&lt;br /&gt;
 virtual int Compare( const SfxPoolItem &amp;amp;rWith ) const;&lt;br /&gt;
 virtual int Compare( const SfxPoolItem &amp;amp;rWith, const IntlWrapper&amp;amp; rIntlWrapper ) const;&lt;br /&gt;
&lt;br /&gt;
 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&lt;br /&gt;
 SfxMapUnit eCoreMetric,&lt;br /&gt;
 SfxMapUnit ePresentationMetric,&lt;br /&gt;
 XubString &amp;amp;rText,&lt;br /&gt;
 const IntlWrapper * pIntlWrapper = 0 ) const;&lt;br /&gt;
&lt;br /&gt;
 virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;&lt;br /&gt;
 virtual int ScaleMetrics( long lMult, long lDiv );&lt;br /&gt;
 virtual int HasMetrics() const;&lt;br /&gt;
&lt;br /&gt;
 virtual BOOL QueryValue( com::sun::star::uno::Any&amp;amp; rVal, BYTE nMemberId = 0 ) const;&lt;br /&gt;
 virtual BOOL PutValue( const com::sun::star::uno::Any&amp;amp; rVal, BYTE nMemberId = 0 );&lt;br /&gt;
&lt;br /&gt;
 virtual SfxPoolItem* Create( SvStream &amp;amp;, USHORT nItemVersion ) const;&lt;br /&gt;
 virtual SvStream&amp;amp; Store( SvStream &amp;amp;, USHORT nItemVersion ) const;&lt;br /&gt;
 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;&lt;br /&gt;
&lt;br /&gt;
 ULONG GetRefCount() const { return nRefCount; }&lt;br /&gt;
 inline USHORT GetKind() const { return nKind; }&lt;br /&gt;
&lt;br /&gt;
 static bool readByteString(SvStream &amp;amp; rStream, UniString &amp;amp; rString);&lt;br /&gt;
 static void writeByteString(SvStream &amp;amp; rStream,UniString const &amp;amp; rString);&lt;br /&gt;
 static bool readUnicodeString(SvStream &amp;amp; rStream, UniString &amp;amp; rString, bool bUnicode);&lt;br /&gt;
 static void writeUnicodeString(SvStream &amp;amp; rStream, UniString const &amp;amp; rString);&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
 SfxPoolItem&amp;amp; operator=( const SfxPoolItem&amp;amp; ); // n.i.!!&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp; rVal, BYTE nMemberId ) const&lt;br /&gt;
{&lt;br /&gt;
  sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS);&lt;br /&gt;
  nMemberId &amp;amp;= ~CONVERT_TWIPS;&lt;br /&gt;
  switch( nMemberId )&lt;br /&gt;
  {&lt;br /&gt;
    // jetzt alles signed&lt;br /&gt;
    case 0:&lt;br /&gt;
    {&lt;br /&gt;
      ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&lt;br /&gt;
      aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&lt;br /&gt;
      aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&lt;br /&gt;
      aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&lt;br /&gt;
      aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&lt;br /&gt;
      rVal &amp;lt;&amp;lt;= aUpperLowerMarginScale;&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    case MID_UP_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); break;&lt;br /&gt;
    case MID_LO_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); break;&lt;br /&gt;
    case MID_UP_REL_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int16) nPropUpper; break;&lt;br /&gt;
    case MID_LO_REL_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int16) nPropLower; break;&lt;br /&gt;
  }&lt;br /&gt;
  return sal_True;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137319</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137319"/>
		<updated>2009-08-13T04:49:30Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: add some missing curly braces to examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
{&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
 /** is called when the status of the feature changes.&lt;br /&gt;
&lt;br /&gt;
 @param State&lt;br /&gt;
 provides information about changes of the requested feature&lt;br /&gt;
 */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the URL of the feature. */&lt;br /&gt;
 com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
 string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
 boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
 boolean Requery;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
 any State;&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang { &lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{ &lt;br /&gt;
 // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
 /** initializes the object. &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&lt;br /&gt;
 */&lt;br /&gt;
 void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &lt;br /&gt;
 raises( com::sun::star::uno::Exception );&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module util {&lt;br /&gt;
&lt;br /&gt;
published interface XUpdatable: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** refreshes the data of the object from the connected data source. */&lt;br /&gt;
 void update();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//=============================================================================&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides a function to execute the command which is bound to the toolbar controller.&lt;br /&gt;
&lt;br /&gt;
 @param &lt;br /&gt;
 a combination of &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;KeyModifier&amp;amp;lt;/type&amp;amp;gt; value that represent the current state of the modifier keys.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void execute( [in] short KeyModifier );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a single click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void click();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a double click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void doubleClick();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create a popup window for additional functions.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createPopupWindow();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create an item window which can be added to the toolbar.&lt;br /&gt;
&lt;br /&gt;
 @param Parent&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which must be used as a parent for the requested item window.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XSubToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** if the controller features a sub-toolbar. &lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 &amp;amp;lt;TRUE/&amp;amp;gt; if the controller offers a sub toolbar, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Enables implementations to dynamically decide to support sub-toolbars&lt;br /&gt;
 or not.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 boolean opensSubToolbar();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides the resource URL of the sub-toolbar this controller opens.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 name of the sub-toolbar this controller offers. A empty string &lt;br /&gt;
 will be interpreted as if this controller offers no sub-toolbar.&lt;br /&gt;
 */&lt;br /&gt;
 string getSubToolbarName();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that a sub-toolbar function has been &lt;br /&gt;
 selected.&lt;br /&gt;
&lt;br /&gt;
 @param aCommand&lt;br /&gt;
 a string which identifies the function that has been selected by&lt;br /&gt;
 a user.&lt;br /&gt;
 */&lt;br /&gt;
 void functionSelected( [in] string aCommand );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that it should set an image which&lt;br /&gt;
 represents the current selected function.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Only the controller instance is able to set the correct image for the&lt;br /&gt;
 current function. A toolbar implementation will ask sub-toolbar &lt;br /&gt;
 controllers to update their image whenever it has to update the images&lt;br /&gt;
 of all its buttons.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void updateImage();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBNewForm&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:Refresh&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SFX2_DLLPUBLIC SfxToolBoxControl:&lt;br /&gt;
 public ::com::sun::star::awt::XDockableWindowListener,&lt;br /&gt;
 public ::com::sun::star::frame::XSubToolbarController,&lt;br /&gt;
 public svt::ToolboxController &lt;br /&gt;
{&lt;br /&gt;
friend class SfxToolbox;&lt;br /&gt;
friend class SfxToolBox_Impl;&lt;br /&gt;
friend class SfxToolboxCustomizer;&lt;br /&gt;
friend class SfxPopupWindow;&lt;br /&gt;
friend struct SfxTbxCtrlFactory;&lt;br /&gt;
&lt;br /&gt;
 SfxToolBoxControl_Impl* pImpl;&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 DECL_LINK( PopupModeEndHdl, void * );&lt;br /&gt;
 DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&lt;br /&gt;
&lt;br /&gt;
 // old SfxToolBoxControl methods&lt;br /&gt;
 virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&lt;br /&gt;
 virtual void Select( BOOL bMod1 = FALSE );&lt;br /&gt;
 virtual void Select( USHORT nModifier );&lt;br /&gt;
&lt;br /&gt;
 virtual void DoubleClick();&lt;br /&gt;
 virtual void Click();&lt;br /&gt;
 virtual SfxPopupWindowType GetPopupWindowType() const;&lt;br /&gt;
 virtual SfxPopupWindow* CreatePopupWindow();&lt;br /&gt;
 virtual SfxPopupWindow* CreatePopupWindowCascading();&lt;br /&gt;
 virtual Window* CreateItemWindow( Window *pParent );&lt;br /&gt;
&lt;br /&gt;
 // Must be called by subclass to set a new popup window instance&lt;br /&gt;
 void SetPopupWindow( SfxPopupWindow* pWindow );&lt;br /&gt;
&lt;br /&gt;
 // XInterface&lt;br /&gt;
 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL acquire() throw();&lt;br /&gt;
 virtual void SAL_CALL release() throw();&lt;br /&gt;
&lt;br /&gt;
 // XEventListener&lt;br /&gt;
 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XComponent&lt;br /&gt;
 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // new controller API&lt;br /&gt;
 // XStatusListener&lt;br /&gt;
 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XToolbarController&lt;br /&gt;
 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL click() &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL doubleClick() &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createPopupWindow() &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt;&amp;amp;amp; rParent ) &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // XSubToolbarController&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // XDockableWindowListener&lt;br /&gt;
 virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &lt;br /&gt;
 virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // helper methods&lt;br /&gt;
 void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&lt;br /&gt;
 ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XFrame &amp;amp;gt;&amp;amp;amp; xFrame, const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 SFX_DECL_TOOLBOX_CONTROL();&lt;br /&gt;
&lt;br /&gt;
 SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp;amp; rBox, BOOL bShowStrings = FALSE );&lt;br /&gt;
 virtual ~SfxToolBoxControl();&lt;br /&gt;
&lt;br /&gt;
 ToolBox&amp;amp;amp; GetToolBox() const;&lt;br /&gt;
 unsigned short GetId() const;&lt;br /&gt;
 unsigned short GetSlotId() const;&lt;br /&gt;
&lt;br /&gt;
 void Dispatch( &lt;br /&gt;
 const ::rtl::OUString&amp;amp;amp; aCommand, &lt;br /&gt;
 ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&lt;br /&gt;
 static void Dispatch( &lt;br /&gt;
const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;amp;gt;&amp;amp;amp; rDispatchProvider, const rtl::OUString&amp;amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&lt;br /&gt;
&lt;br /&gt;
 static SfxItemState GetItemState( const SfxPoolItem* pState );&lt;br /&gt;
 static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service StatusbarController&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** with this interface a component can receive events if a feature has &lt;br /&gt;
 changed.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 The statusbar controller implementation should register itself as a &lt;br /&gt;
 listener when its &amp;amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;amp;gt;XUpdatable&amp;amp;lt;/member&amp;amp;gt; &lt;br /&gt;
 interface has been called.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
 /** used to initialize a component with required arguments.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;b&amp;amp;gt;A statusbar controller needs at least three additional arguments &lt;br /&gt;
 provided as &amp;amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;amp;gt;PropertyValue&amp;amp;lt;/type&amp;amp;gt;:&lt;br /&gt;
 &amp;amp;lt;ul&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Frame&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &lt;br /&gt;
 &amp;amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;amp;gt;XFrame&amp;amp;lt;/type&amp;amp;gt; instance&lt;br /&gt;
 to which the toolbar controller belongs.&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;CommandURL&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a string which specifies the command a &lt;br /&gt;
 statusbar controller is bound.&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;ServiceManager&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;&lt;br /&gt;
 XMultiServiceFactory&amp;amp;lt;/type&amp;amp;gt; instance which can be used to &lt;br /&gt;
 create additional UNO services.&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
 /** used to notify an implementation that it needs to add its listener or &lt;br /&gt;
 remove and add them again.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 A status bar controller instance is ready for use after this call has &lt;br /&gt;
 been made the first time. The status bar implementation guarentees that &lt;br /&gt;
 the controller&amp;#039;s item window has been added to the status bar and its &lt;br /&gt;
 reference is held by it.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** used to notify changed features and requests for additional user &lt;br /&gt;
 interface items.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Mostly used by a status bar implementation to forward information to &lt;br /&gt;
 and request services from a status bar controller component. This &lt;br /&gt;
 interface must be useable after &lt;br /&gt;
 &amp;amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;XInitialitation::initialize&amp;amp;lt;/member&amp;amp;gt; &lt;br /&gt;
 has been called. The behavior of the interface is undefined if the &lt;br /&gt;
 controller component hasn&amp;#039;t been initialized.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::frame::XStatusbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang { &lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{ &lt;br /&gt;
 // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
 /** initializes the object. &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&lt;br /&gt;
 */&lt;br /&gt;
 void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &lt;br /&gt;
 raises( com::sun::star::uno::Exception );&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module util {&lt;br /&gt;
&lt;br /&gt;
published interface XUpdatable: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** refreshes the data of the object from the connected data source. */&lt;br /&gt;
 void update();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//=============================================================================&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XStatusbarController : ::com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse button has been pressed. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse has been moved. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse button has been released. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if a command event is available for a controller.&lt;br /&gt;
&lt;br /&gt;
 @param aPos&lt;br /&gt;
 the current mouse position in pixel.&lt;br /&gt;
&lt;br /&gt;
 @param nCommand&lt;br /&gt;
 describes which command has been invoked.&lt;br /&gt;
&lt;br /&gt;
 @param bMouseEvent&lt;br /&gt;
 &amp;amp;lt;TRUE/&amp;amp;gt; if the command is based on a mouse event, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 @param aData&lt;br /&gt;
 for future use only.&lt;br /&gt;
 */&lt;br /&gt;
 void command( [in] ::com::sun::star::awt::Point aPos,&lt;br /&gt;
 [in] long nCommand,&lt;br /&gt;
 [in] boolean bMouseEvent,&lt;br /&gt;
 [in] any aData );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if a command event is available for a controller.&lt;br /&gt;
&lt;br /&gt;
 @param xGraphics&lt;br /&gt;
 the current graphics which should be used for painting.&lt;br /&gt;
&lt;br /&gt;
 @param rOutputRectangle&lt;br /&gt;
 the output rectangle for graphic operations.&lt;br /&gt;
&lt;br /&gt;
 @param nItemId&lt;br /&gt;
 the item id of the controller.&lt;br /&gt;
&lt;br /&gt;
 @param nStyle&lt;br /&gt;
 the style of the statusbar item. The controller should respect the provided&lt;br /&gt;
&lt;br /&gt;
style when paints.&lt;br /&gt;
 */&lt;br /&gt;
 void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&lt;br /&gt;
 [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&lt;br /&gt;
 [in] long nItemId,&lt;br /&gt;
 [in] long nStyle );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the user clicked with mouse into the &lt;br /&gt;
 field of the corresponding control.&lt;br /&gt;
 */&lt;br /&gt;
 void click();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the user double-clicked with mouse &lt;br /&gt;
 into the field of the corresponding control.&lt;br /&gt;
 */&lt;br /&gt;
 void doubleClick();&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBStatusType&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBStatusDBName&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:StatusbarLogo&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value/&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&lt;br /&gt;
{&lt;br /&gt;
 USHORT nSlotId;&lt;br /&gt;
 USHORT nId;&lt;br /&gt;
 StatusBar* pBar;&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 // new controller API&lt;br /&gt;
 // XInterface&lt;br /&gt;
 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL acquire() throw();&lt;br /&gt;
 virtual void SAL_CALL release() throw();&lt;br /&gt;
&lt;br /&gt;
 // XEventListener&lt;br /&gt;
 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XComponent&lt;br /&gt;
 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // XStatusListener&lt;br /&gt;
 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XStatusbarController&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp;amp; aPos, &lt;br /&gt;
 ::sal_Int32 nCommand, &lt;br /&gt;
 ::sal_Bool bMouseEvent, &lt;br /&gt;
 const ::com::sun::star::uno::Any&amp;amp;amp; aData ) &lt;br /&gt;
&lt;br /&gt;
throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XGraphics &amp;amp;gt;&amp;amp;amp; xGraphics, &lt;br /&gt;
 const ::com::sun::star::awt::Rectangle&amp;amp;amp; rOutputRectangle, &lt;br /&gt;
 ::sal_Int32 nItemId, &lt;br /&gt;
 ::sal_Int32 nStyle )&lt;br /&gt;
&lt;br /&gt;
throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // Old sfx2 interface&lt;br /&gt;
 virtual void StateChanged( USHORT nSID, SfxItemState eState,&lt;br /&gt;
 const SfxPoolItem* pState );&lt;br /&gt;
 virtual void Click();&lt;br /&gt;
 virtual void DoubleClick();&lt;br /&gt;
 virtual void Command( const CommandEvent&amp;amp;amp; rCEvt );&lt;br /&gt;
 virtual BOOL MouseButtonDown( const MouseEvent &amp;amp;amp; );&lt;br /&gt;
 virtual BOOL MouseMove( const MouseEvent &amp;amp;amp; );&lt;br /&gt;
 virtual BOOL MouseButtonUp( const MouseEvent &amp;amp;amp; );&lt;br /&gt;
 virtual void Paint( const UserDrawEvent &amp;amp;amp;rUDEvt );&lt;br /&gt;
&lt;br /&gt;
 static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp;amp; rBar );&lt;br /&gt;
 virtual ~SfxStatusBarControl();&lt;br /&gt;
&lt;br /&gt;
 USHORT GetSlotId() const { return nSlotId; }&lt;br /&gt;
 USHORT GetId() const { return nId; }&lt;br /&gt;
 StatusBar&amp;amp;amp; GetStatusBar() const { return *pBar; }&lt;br /&gt;
 void CaptureMouse();&lt;br /&gt;
 void ReleaseMouse();&lt;br /&gt;
&lt;br /&gt;
 static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&lt;br /&gt;
if ( bNotify &amp;amp;&amp;amp; pContnr )&lt;br /&gt;
{&lt;br /&gt;
  ::com::sun::star::uno::Any aState;&lt;br /&gt;
  if ( ( eState &amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;&amp;amp; pState &amp;amp;&amp;amp; !IsInvalidItem( pState ) &amp;amp;&amp;amp; !pState-&amp;gt;ISA(SfxVoidItem) )&lt;br /&gt;
  {&lt;br /&gt;
    // Retrieve metric from pool to have correct sub ID when calling QueryValue&lt;br /&gt;
    USHORT nSubId( 0 );&lt;br /&gt;
    SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&lt;br /&gt;
&lt;br /&gt;
    // retrieve the core metric&lt;br /&gt;
    // it&amp;#039;s enough to check the objectshell, the only shell that does not &lt;br /&gt;
    // use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&lt;br /&gt;
    if ( pSlotServ &amp;amp;&amp;amp; pDispatcher )&lt;br /&gt;
    {&lt;br /&gt;
      SfxShell* pShell = pDispatcher-&amp;gt;GetShell( pSlotServ-&amp;gt;GetShellLevel() );&lt;br /&gt;
      DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&lt;br /&gt;
      if ( pShell )&lt;br /&gt;
        eMapUnit = GetCoreMetric( pShell-&amp;gt;GetPool(), nSID );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if ( eMapUnit == SFX_MAPUNIT_TWIP )&lt;br /&gt;
      nSubId |= CONVERT_TWIPS;&lt;br /&gt;
    pState-&amp;gt;QueryValue( aState, (BYTE)nSubId );&lt;br /&gt;
  }&lt;br /&gt;
  else if ( eState == SFX_ITEM_DONTCARE )&lt;br /&gt;
  {&lt;br /&gt;
    // Use special uno struct to transport don&amp;#039;t care state&lt;br /&gt;
    ::com::sun::star::frame::status::ItemStatus aItemStatus;&lt;br /&gt;
    aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&lt;br /&gt;
    aState = makeAny( aItemStatus );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  ::com::sun::star::frame::FeatureStateEvent aEvent;&lt;br /&gt;
  aEvent.FeatureURL = aDispatchURL;&lt;br /&gt;
  aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&lt;br /&gt;
  aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&lt;br /&gt;
  aEvent.Requery = sal_False;&lt;br /&gt;
  aEvent.State = aState;&lt;br /&gt;
&lt;br /&gt;
  ::cppu::OInterfaceIteratorHelper aIt( *pContnr );&lt;br /&gt;
  while( aIt.hasMoreElements() )&lt;br /&gt;
  {&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
      ((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;gt;statusChanged( aEvent );&lt;br /&gt;
    }&lt;br /&gt;
    catch( ::com::sun::star::uno::RuntimeException&amp;amp; )&lt;br /&gt;
    {&lt;br /&gt;
      aIt.remove();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SVL_DLLPUBLIC SfxPoolItem&lt;br /&gt;
{&lt;br /&gt;
friend class SfxItemPool;&lt;br /&gt;
friend class SfxItemDesruptor_Impl;&lt;br /&gt;
friend class SfxItemPoolCache;&lt;br /&gt;
friend class SfxItemSet;&lt;br /&gt;
friend class SfxVoidItem;&lt;br /&gt;
&lt;br /&gt;
 ULONG nRefCount; // Referenzzaehler&lt;br /&gt;
 USHORT nWhich;&lt;br /&gt;
 USHORT nKind;&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
 inline void SetRefCount( ULONG n );&lt;br /&gt;
 inline void SetKind( USHORT n );&lt;br /&gt;
public:&lt;br /&gt;
 inline ULONG AddRef( ULONG n = 1 ) const;&lt;br /&gt;
private:&lt;br /&gt;
 inline ULONG ReleaseRef( ULONG n = 1 ) const;&lt;br /&gt;
 SVL_DLLPRIVATE long Delete_Impl(void*);&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 SfxPoolItem( USHORT nWhich = 0 );&lt;br /&gt;
 SfxPoolItem( const SfxPoolItem&amp;amp; );&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 TYPEINFO();&lt;br /&gt;
&lt;br /&gt;
 virtual ~SfxPoolItem();&lt;br /&gt;
 void SetWhich( USHORT nId ) &lt;br /&gt;
 { DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&lt;br /&gt;
 USHORT Which() const { DBG_CHKTHIS(SfxPoolItem, 0); return nWhich; }&lt;br /&gt;
 virtual int operator==( const SfxPoolItem&amp;amp; ) const = 0;&lt;br /&gt;
 int operator!=( const SfxPoolItem&amp;amp; rItem ) const&lt;br /&gt;
 { return !(*this == rItem); }&lt;br /&gt;
 virtual int Compare( const SfxPoolItem &amp;amp;rWith ) const;&lt;br /&gt;
 virtual int Compare( const SfxPoolItem &amp;amp;rWith, const IntlWrapper&amp;amp; rIntlWrapper ) const;&lt;br /&gt;
&lt;br /&gt;
 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&lt;br /&gt;
 SfxMapUnit eCoreMetric,&lt;br /&gt;
 SfxMapUnit ePresentationMetric,&lt;br /&gt;
 XubString &amp;amp;rText,&lt;br /&gt;
 const IntlWrapper * pIntlWrapper = 0 ) const;&lt;br /&gt;
&lt;br /&gt;
 virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;&lt;br /&gt;
 virtual int ScaleMetrics( long lMult, long lDiv );&lt;br /&gt;
 virtual int HasMetrics() const;&lt;br /&gt;
&lt;br /&gt;
 virtual BOOL QueryValue( com::sun::star::uno::Any&amp;amp; rVal, BYTE nMemberId = 0 ) const;&lt;br /&gt;
 virtual BOOL PutValue( const com::sun::star::uno::Any&amp;amp; rVal, BYTE nMemberId = 0 );&lt;br /&gt;
&lt;br /&gt;
 virtual SfxPoolItem* Create( SvStream &amp;amp;, USHORT nItemVersion ) const;&lt;br /&gt;
 virtual SvStream&amp;amp; Store( SvStream &amp;amp;, USHORT nItemVersion ) const;&lt;br /&gt;
 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;&lt;br /&gt;
&lt;br /&gt;
 ULONG GetRefCount() const { return nRefCount; }&lt;br /&gt;
 inline USHORT GetKind() const { return nKind; }&lt;br /&gt;
&lt;br /&gt;
 static bool readByteString(SvStream &amp;amp; rStream, UniString &amp;amp; rString);&lt;br /&gt;
 static void writeByteString(SvStream &amp;amp; rStream,UniString const &amp;amp; rString);&lt;br /&gt;
 static bool readUnicodeString(SvStream &amp;amp; rStream, UniString &amp;amp; rString, bool bUnicode);&lt;br /&gt;
 static void writeUnicodeString(SvStream &amp;amp; rStream, UniString const &amp;amp; rString);&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
 SfxPoolItem&amp;amp; operator=( const SfxPoolItem&amp;amp; ); // n.i.!!&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp; rVal, BYTE nMemberId ) const&lt;br /&gt;
{&lt;br /&gt;
  sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS);&lt;br /&gt;
  nMemberId &amp;amp;= ~CONVERT_TWIPS;&lt;br /&gt;
  switch( nMemberId )&lt;br /&gt;
  {&lt;br /&gt;
    // jetzt alles signed&lt;br /&gt;
    case 0:&lt;br /&gt;
    {&lt;br /&gt;
      ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&lt;br /&gt;
      aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&lt;br /&gt;
      aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&lt;br /&gt;
      aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&lt;br /&gt;
      aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&lt;br /&gt;
      rVal &amp;lt;&amp;lt;= aUpperLowerMarginScale;&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    case MID_UP_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); break;&lt;br /&gt;
    case MID_LO_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); break;&lt;br /&gt;
    case MID_UP_REL_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int16) nPropUpper; break;&lt;br /&gt;
    case MID_LO_REL_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int16) nPropLower; break;&lt;br /&gt;
  }&lt;br /&gt;
  return sal_True;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137255</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137255"/>
		<updated>2009-08-11T17:40:46Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: fix formatting of source code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&amp;lt;br/&amp;gt;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
 /** is called when the status of the feature changes.&lt;br /&gt;
&lt;br /&gt;
 @param State&lt;br /&gt;
 provides information about changes of the requested feature&lt;br /&gt;
 */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the URL of the feature. */&lt;br /&gt;
 com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
 string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
 boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
 boolean Requery;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
 any State;&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang { &lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{ &lt;br /&gt;
 // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
 /** initializes the object. &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&lt;br /&gt;
 */&lt;br /&gt;
 void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &lt;br /&gt;
 raises( com::sun::star::uno::Exception );&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module util {&lt;br /&gt;
&lt;br /&gt;
published interface XUpdatable: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** refreshes the data of the object from the connected data source. */&lt;br /&gt;
 void update();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//=============================================================================&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides a function to execute the command which is bound to the toolbar controller.&lt;br /&gt;
&lt;br /&gt;
 @param &lt;br /&gt;
 a combination of &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;KeyModifier&amp;amp;lt;/type&amp;amp;gt; value that represent the current state of the modifier keys.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void execute( [in] short KeyModifier );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a single click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void click();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a double click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void doubleClick();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create a popup window for additional functions.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createPopupWindow();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create an item window which can be added to the toolbar.&lt;br /&gt;
&lt;br /&gt;
 @param Parent&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which must be used as a parent for the requested item window.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XSubToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** if the controller features a sub-toolbar. &lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 &amp;amp;lt;TRUE/&amp;amp;gt; if the controller offers a sub toolbar, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Enables implementations to dynamically decide to support sub-toolbars&lt;br /&gt;
 or not.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 boolean opensSubToolbar();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides the resource URL of the sub-toolbar this controller opens.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 name of the sub-toolbar this controller offers. A empty string &lt;br /&gt;
 will be interpreted as if this controller offers no sub-toolbar.&lt;br /&gt;
 */&lt;br /&gt;
 string getSubToolbarName();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that a sub-toolbar function has been &lt;br /&gt;
 selected.&lt;br /&gt;
&lt;br /&gt;
 @param aCommand&lt;br /&gt;
 a string which identifies the function that has been selected by&lt;br /&gt;
 a user.&lt;br /&gt;
 */&lt;br /&gt;
 void functionSelected( [in] string aCommand );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that it should set an image which&lt;br /&gt;
 represents the current selected function.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Only the controller instance is able to set the correct image for the&lt;br /&gt;
 current function. A toolbar implementation will ask sub-toolbar &lt;br /&gt;
 controllers to update their image whenever it has to update the images&lt;br /&gt;
 of all its buttons.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void updateImage();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBNewForm&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:Refresh&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SFX2_DLLPUBLIC SfxToolBoxControl:&lt;br /&gt;
 public ::com::sun::star::awt::XDockableWindowListener,&lt;br /&gt;
 public ::com::sun::star::frame::XSubToolbarController,&lt;br /&gt;
 public svt::ToolboxController &lt;br /&gt;
{&lt;br /&gt;
friend class SfxToolbox;&lt;br /&gt;
friend class SfxToolBox_Impl;&lt;br /&gt;
friend class SfxToolboxCustomizer;&lt;br /&gt;
friend class SfxPopupWindow;&lt;br /&gt;
friend struct SfxTbxCtrlFactory;&lt;br /&gt;
&lt;br /&gt;
 SfxToolBoxControl_Impl* pImpl;&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 DECL_LINK( PopupModeEndHdl, void * );&lt;br /&gt;
 DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&lt;br /&gt;
&lt;br /&gt;
 // old SfxToolBoxControl methods&lt;br /&gt;
 virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&lt;br /&gt;
 virtual void Select( BOOL bMod1 = FALSE );&lt;br /&gt;
 virtual void Select( USHORT nModifier );&lt;br /&gt;
&lt;br /&gt;
 virtual void DoubleClick();&lt;br /&gt;
 virtual void Click();&lt;br /&gt;
 virtual SfxPopupWindowType GetPopupWindowType() const;&lt;br /&gt;
 virtual SfxPopupWindow* CreatePopupWindow();&lt;br /&gt;
 virtual SfxPopupWindow* CreatePopupWindowCascading();&lt;br /&gt;
 virtual Window* CreateItemWindow( Window *pParent );&lt;br /&gt;
&lt;br /&gt;
 // Must be called by subclass to set a new popup window instance&lt;br /&gt;
 void SetPopupWindow( SfxPopupWindow* pWindow );&lt;br /&gt;
&lt;br /&gt;
 // XInterface&lt;br /&gt;
 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL acquire() throw();&lt;br /&gt;
 virtual void SAL_CALL release() throw();&lt;br /&gt;
&lt;br /&gt;
 // XEventListener&lt;br /&gt;
 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XComponent&lt;br /&gt;
 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // new controller API&lt;br /&gt;
 // XStatusListener&lt;br /&gt;
 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XToolbarController&lt;br /&gt;
 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL click() &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL doubleClick() &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createPopupWindow() &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt;&amp;amp;amp; rParent ) &lt;br /&gt;
 throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // XSubToolbarController&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // XDockableWindowListener&lt;br /&gt;
 virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &lt;br /&gt;
 virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // helper methods&lt;br /&gt;
 void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&lt;br /&gt;
 ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XFrame &amp;amp;gt;&amp;amp;amp; xFrame, const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 SFX_DECL_TOOLBOX_CONTROL();&lt;br /&gt;
&lt;br /&gt;
 SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp;amp; rBox, BOOL bShowStrings = FALSE );&lt;br /&gt;
 virtual ~SfxToolBoxControl();&lt;br /&gt;
&lt;br /&gt;
 ToolBox&amp;amp;amp; GetToolBox() const;&lt;br /&gt;
 unsigned short GetId() const;&lt;br /&gt;
 unsigned short GetSlotId() const;&lt;br /&gt;
&lt;br /&gt;
 void Dispatch( &lt;br /&gt;
 const ::rtl::OUString&amp;amp;amp; aCommand, &lt;br /&gt;
 ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&lt;br /&gt;
 static void Dispatch( &lt;br /&gt;
const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;amp;gt;&amp;amp;amp; rDispatchProvider, const rtl::OUString&amp;amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&lt;br /&gt;
&lt;br /&gt;
 static SfxItemState GetItemState( const SfxPoolItem* pState );&lt;br /&gt;
 static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service StatusbarController&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** with this interface a component can receive events if a feature has &lt;br /&gt;
 changed.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 The statusbar controller implementation should register itself as a &lt;br /&gt;
 listener when its &amp;amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;amp;gt;XUpdatable&amp;amp;lt;/member&amp;amp;gt; &lt;br /&gt;
 interface has been called.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
 /** used to initialize a component with required arguments.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;b&amp;amp;gt;A statusbar controller needs at least three additional arguments &lt;br /&gt;
 provided as &amp;amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;amp;gt;PropertyValue&amp;amp;lt;/type&amp;amp;gt;:&lt;br /&gt;
 &amp;amp;lt;ul&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Frame&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &lt;br /&gt;
 &amp;amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;amp;gt;XFrame&amp;amp;lt;/type&amp;amp;gt; instance&lt;br /&gt;
 to which the toolbar controller belongs.&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;CommandURL&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a string which specifies the command a &lt;br /&gt;
 statusbar controller is bound.&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;ServiceManager&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;&lt;br /&gt;
 XMultiServiceFactory&amp;amp;lt;/type&amp;amp;gt; instance which can be used to &lt;br /&gt;
 create additional UNO services.&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
 /** used to notify an implementation that it needs to add its listener or &lt;br /&gt;
 remove and add them again.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 A status bar controller instance is ready for use after this call has &lt;br /&gt;
 been made the first time. The status bar implementation guarentees that &lt;br /&gt;
 the controller&amp;#039;s item window has been added to the status bar and its &lt;br /&gt;
 reference is held by it.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** used to notify changed features and requests for additional user &lt;br /&gt;
 interface items.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Mostly used by a status bar implementation to forward information to &lt;br /&gt;
 and request services from a status bar controller component. This &lt;br /&gt;
 interface must be useable after &lt;br /&gt;
 &amp;amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;XInitialitation::initialize&amp;amp;lt;/member&amp;amp;gt; &lt;br /&gt;
 has been called. The behavior of the interface is undefined if the &lt;br /&gt;
 controller component hasn&amp;#039;t been initialized.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 interface com::sun::star::frame::XStatusbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang { &lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{ &lt;br /&gt;
 // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
 /** initializes the object. &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&lt;br /&gt;
 */&lt;br /&gt;
 void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &lt;br /&gt;
 raises( com::sun::star::uno::Exception );&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module util {&lt;br /&gt;
&lt;br /&gt;
published interface XUpdatable: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** refreshes the data of the object from the connected data source. */&lt;br /&gt;
 void update();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//=============================================================================&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XStatusbarController : ::com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse button has been pressed. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse has been moved. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the mouse position is within the controller &lt;br /&gt;
 and a mouse button has been released. If the controller has captured the &lt;br /&gt;
 mouse input this function is also called when the mouse position is not &lt;br /&gt;
 within the controller.&lt;br /&gt;
&lt;br /&gt;
 @param aMouseEvent&lt;br /&gt;
 current information about the mouse pointer.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &lt;br /&gt;
 if the event should be processed by the status bar.&lt;br /&gt;
 */&lt;br /&gt;
 boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if a command event is available for a controller.&lt;br /&gt;
&lt;br /&gt;
 @param aPos&lt;br /&gt;
 the current mouse position in pixel.&lt;br /&gt;
&lt;br /&gt;
 @param nCommand&lt;br /&gt;
 describes which command has been invoked.&lt;br /&gt;
&lt;br /&gt;
 @param bMouseEvent&lt;br /&gt;
 &amp;amp;lt;TRUE/&amp;amp;gt; if the command is based on a mouse event, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 @param aData&lt;br /&gt;
 for future use only.&lt;br /&gt;
 */&lt;br /&gt;
 void command( [in] ::com::sun::star::awt::Point aPos,&lt;br /&gt;
 [in] long nCommand,&lt;br /&gt;
 [in] boolean bMouseEvent,&lt;br /&gt;
 [in] any aData );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if a command event is available for a controller.&lt;br /&gt;
&lt;br /&gt;
 @param xGraphics&lt;br /&gt;
 the current graphics which should be used for painting.&lt;br /&gt;
&lt;br /&gt;
 @param rOutputRectangle&lt;br /&gt;
 the output rectangle for graphic operations.&lt;br /&gt;
&lt;br /&gt;
 @param nItemId&lt;br /&gt;
 the item id of the controller.&lt;br /&gt;
&lt;br /&gt;
 @param nStyle&lt;br /&gt;
 the style of the statusbar item. The controller should respect the provided&lt;br /&gt;
&lt;br /&gt;
style when paints.&lt;br /&gt;
 */&lt;br /&gt;
 void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&lt;br /&gt;
 [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&lt;br /&gt;
 [in] long nItemId,&lt;br /&gt;
 [in] long nStyle );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the user clicked with mouse into the &lt;br /&gt;
 field of the corresponding control.&lt;br /&gt;
 */&lt;br /&gt;
 void click();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** is called by a status bar if the user double-clicked with mouse &lt;br /&gt;
 into the field of the corresponding control.&lt;br /&gt;
 */&lt;br /&gt;
 void doubleClick();&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBStatusType&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:DBStatusDBName&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;.uno:StatusbarLogo&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value/&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
  &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;value&amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/prop&amp;gt;&lt;br /&gt;
 &amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&lt;br /&gt;
{&lt;br /&gt;
 USHORT nSlotId;&lt;br /&gt;
 USHORT nId;&lt;br /&gt;
 StatusBar* pBar;&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 // new controller API&lt;br /&gt;
 // XInterface&lt;br /&gt;
 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL acquire() throw();&lt;br /&gt;
 virtual void SAL_CALL release() throw();&lt;br /&gt;
&lt;br /&gt;
 // XEventListener&lt;br /&gt;
 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XComponent&lt;br /&gt;
 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // XStatusListener&lt;br /&gt;
 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&lt;br /&gt;
&lt;br /&gt;
 // XStatusbarController&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp;amp; aPos, &lt;br /&gt;
 ::sal_Int32 nCommand, &lt;br /&gt;
 ::sal_Bool bMouseEvent, &lt;br /&gt;
 const ::com::sun::star::uno::Any&amp;amp;amp; aData ) &lt;br /&gt;
&lt;br /&gt;
throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XGraphics &amp;amp;gt;&amp;amp;amp; xGraphics, &lt;br /&gt;
 const ::com::sun::star::awt::Rectangle&amp;amp;amp; rOutputRectangle, &lt;br /&gt;
 ::sal_Int32 nItemId, &lt;br /&gt;
 ::sal_Int32 nStyle )&lt;br /&gt;
&lt;br /&gt;
throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
 virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&lt;br /&gt;
&lt;br /&gt;
 // Old sfx2 interface&lt;br /&gt;
 virtual void StateChanged( USHORT nSID, SfxItemState eState,&lt;br /&gt;
 const SfxPoolItem* pState );&lt;br /&gt;
 virtual void Click();&lt;br /&gt;
 virtual void DoubleClick();&lt;br /&gt;
 virtual void Command( const CommandEvent&amp;amp;amp; rCEvt );&lt;br /&gt;
 virtual BOOL MouseButtonDown( const MouseEvent &amp;amp;amp; );&lt;br /&gt;
 virtual BOOL MouseMove( const MouseEvent &amp;amp;amp; );&lt;br /&gt;
 virtual BOOL MouseButtonUp( const MouseEvent &amp;amp;amp; );&lt;br /&gt;
 virtual void Paint( const UserDrawEvent &amp;amp;amp;rUDEvt );&lt;br /&gt;
&lt;br /&gt;
 static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp;amp; rBar );&lt;br /&gt;
 virtual ~SfxStatusBarControl();&lt;br /&gt;
&lt;br /&gt;
 USHORT GetSlotId() const { return nSlotId; }&lt;br /&gt;
 USHORT GetId() const { return nId; }&lt;br /&gt;
 StatusBar&amp;amp;amp; GetStatusBar() const { return *pBar; }&lt;br /&gt;
 void CaptureMouse();&lt;br /&gt;
 void ReleaseMouse();&lt;br /&gt;
&lt;br /&gt;
 static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&lt;br /&gt;
if ( bNotify &amp;amp;&amp;amp; pContnr )&lt;br /&gt;
{&lt;br /&gt;
  ::com::sun::star::uno::Any aState;&lt;br /&gt;
  if ( ( eState &amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;&amp;amp; pState &amp;amp;&amp;amp; !IsInvalidItem( pState ) &amp;amp;&amp;amp; !pState-&amp;gt;ISA(SfxVoidItem) )&lt;br /&gt;
  {&lt;br /&gt;
    // Retrieve metric from pool to have correct sub ID when calling QueryValue&lt;br /&gt;
    USHORT nSubId( 0 );&lt;br /&gt;
    SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&lt;br /&gt;
&lt;br /&gt;
    // retrieve the core metric&lt;br /&gt;
    // it&amp;#039;s enough to check the objectshell, the only shell that does not &lt;br /&gt;
    // use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&lt;br /&gt;
    if ( pSlotServ &amp;amp;&amp;amp; pDispatcher )&lt;br /&gt;
    {&lt;br /&gt;
      SfxShell* pShell = pDispatcher-&amp;gt;GetShell( pSlotServ-&amp;gt;GetShellLevel() );&lt;br /&gt;
      DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&lt;br /&gt;
      if ( pShell )&lt;br /&gt;
        eMapUnit = GetCoreMetric( pShell-&amp;gt;GetPool(), nSID );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if ( eMapUnit == SFX_MAPUNIT_TWIP )&lt;br /&gt;
      nSubId |= CONVERT_TWIPS;&lt;br /&gt;
    pState-&amp;gt;QueryValue( aState, (BYTE)nSubId );&lt;br /&gt;
  }&lt;br /&gt;
  else if ( eState == SFX_ITEM_DONTCARE )&lt;br /&gt;
  {&lt;br /&gt;
    // Use special uno struct to transport don&amp;#039;t care state&lt;br /&gt;
    ::com::sun::star::frame::status::ItemStatus aItemStatus;&lt;br /&gt;
    aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&lt;br /&gt;
    aState = makeAny( aItemStatus );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  ::com::sun::star::frame::FeatureStateEvent aEvent;&lt;br /&gt;
  aEvent.FeatureURL = aDispatchURL;&lt;br /&gt;
  aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&lt;br /&gt;
  aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&lt;br /&gt;
  aEvent.Requery = sal_False;&lt;br /&gt;
  aEvent.State = aState;&lt;br /&gt;
&lt;br /&gt;
  ::cppu::OInterfaceIteratorHelper aIt( *pContnr );&lt;br /&gt;
  while( aIt.hasMoreElements() )&lt;br /&gt;
  {&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
      ((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;gt;statusChanged( aEvent );&lt;br /&gt;
    }&lt;br /&gt;
    catch( ::com::sun::star::uno::RuntimeException&amp;amp; )&lt;br /&gt;
    {&lt;br /&gt;
      aIt.remove();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SVL_DLLPUBLIC SfxPoolItem&lt;br /&gt;
{&lt;br /&gt;
friend class SfxItemPool;&lt;br /&gt;
friend class SfxItemDesruptor_Impl;&lt;br /&gt;
friend class SfxItemPoolCache;&lt;br /&gt;
friend class SfxItemSet;&lt;br /&gt;
friend class SfxVoidItem;&lt;br /&gt;
&lt;br /&gt;
 ULONG nRefCount; // Referenzzaehler&lt;br /&gt;
 USHORT nWhich;&lt;br /&gt;
 USHORT nKind;&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
 inline void SetRefCount( ULONG n );&lt;br /&gt;
 inline void SetKind( USHORT n );&lt;br /&gt;
public:&lt;br /&gt;
 inline ULONG AddRef( ULONG n = 1 ) const;&lt;br /&gt;
private:&lt;br /&gt;
 inline ULONG ReleaseRef( ULONG n = 1 ) const;&lt;br /&gt;
 SVL_DLLPRIVATE long Delete_Impl(void*);&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
 SfxPoolItem( USHORT nWhich = 0 );&lt;br /&gt;
 SfxPoolItem( const SfxPoolItem&amp;amp; );&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
 TYPEINFO();&lt;br /&gt;
&lt;br /&gt;
 virtual ~SfxPoolItem();&lt;br /&gt;
 void SetWhich( USHORT nId ) &lt;br /&gt;
 { DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&lt;br /&gt;
 USHORT Which() const { DBG_CHKTHIS(SfxPoolItem, 0); return nWhich; }&lt;br /&gt;
 virtual int operator==( const SfxPoolItem&amp;amp; ) const = 0;&lt;br /&gt;
 int operator!=( const SfxPoolItem&amp;amp; rItem ) const&lt;br /&gt;
 { return !(*this == rItem); }&lt;br /&gt;
 virtual int Compare( const SfxPoolItem &amp;amp;rWith ) const;&lt;br /&gt;
 virtual int Compare( const SfxPoolItem &amp;amp;rWith, const IntlWrapper&amp;amp; rIntlWrapper ) const;&lt;br /&gt;
&lt;br /&gt;
 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&lt;br /&gt;
 SfxMapUnit eCoreMetric,&lt;br /&gt;
 SfxMapUnit ePresentationMetric,&lt;br /&gt;
 XubString &amp;amp;rText,&lt;br /&gt;
 const IntlWrapper * pIntlWrapper = 0 ) const;&lt;br /&gt;
&lt;br /&gt;
 virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;&lt;br /&gt;
 virtual int ScaleMetrics( long lMult, long lDiv );&lt;br /&gt;
 virtual int HasMetrics() const;&lt;br /&gt;
&lt;br /&gt;
 virtual BOOL QueryValue( com::sun::star::uno::Any&amp;amp; rVal, BYTE nMemberId = 0 ) const;&lt;br /&gt;
 virtual BOOL PutValue( const com::sun::star::uno::Any&amp;amp; rVal, BYTE nMemberId = 0 );&lt;br /&gt;
&lt;br /&gt;
 virtual SfxPoolItem* Create( SvStream &amp;amp;, USHORT nItemVersion ) const;&lt;br /&gt;
 virtual SvStream&amp;amp; Store( SvStream &amp;amp;, USHORT nItemVersion ) const;&lt;br /&gt;
 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;&lt;br /&gt;
&lt;br /&gt;
 ULONG GetRefCount() const { return nRefCount; }&lt;br /&gt;
 inline USHORT GetKind() const { return nKind; }&lt;br /&gt;
&lt;br /&gt;
 static bool readByteString(SvStream &amp;amp; rStream, UniString &amp;amp; rString);&lt;br /&gt;
 static void writeByteString(SvStream &amp;amp; rStream,UniString const &amp;amp; rString);&lt;br /&gt;
 static bool readUnicodeString(SvStream &amp;amp; rStream, UniString &amp;amp; rString, bool bUnicode);&lt;br /&gt;
 static void writeUnicodeString(SvStream &amp;amp; rStream, UniString const &amp;amp; rString);&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
 SfxPoolItem&amp;amp; operator=( const SfxPoolItem&amp;amp; ); // n.i.!!&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp; rVal, BYTE nMemberId ) const&lt;br /&gt;
{&lt;br /&gt;
  sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS);&lt;br /&gt;
  nMemberId &amp;amp;= ~CONVERT_TWIPS;&lt;br /&gt;
  switch( nMemberId )&lt;br /&gt;
  {&lt;br /&gt;
    // jetzt alles signed&lt;br /&gt;
    case 0:&lt;br /&gt;
    {&lt;br /&gt;
      ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&lt;br /&gt;
      aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&lt;br /&gt;
      aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&lt;br /&gt;
      aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&lt;br /&gt;
      aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&lt;br /&gt;
      rVal &amp;lt;&amp;lt;= aUpperLowerMarginScale;&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    case MID_UP_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); break;&lt;br /&gt;
    case MID_LO_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); break;&lt;br /&gt;
    case MID_UP_REL_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int16) nPropUpper; break;&lt;br /&gt;
    case MID_LO_REL_MARGIN: rVal &amp;lt;&amp;lt;= (sal_Int16) nPropLower; break;&lt;br /&gt;
  }&lt;br /&gt;
  return sal_True;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137254</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137254"/>
		<updated>2009-08-11T17:18:05Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: fix formatting of source code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&amp;lt;br/&amp;gt;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
 /** is called when the status of the feature changes.&lt;br /&gt;
&lt;br /&gt;
 @param State&lt;br /&gt;
 provides information about changes of the requested feature&lt;br /&gt;
 */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame { &lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the URL of the feature. */&lt;br /&gt;
 com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
 string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
 boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
 boolean Requery;&lt;br /&gt;
&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
 any State;&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang { &lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{ &lt;br /&gt;
 // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
 /** initializes the object. &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&lt;br /&gt;
 */&lt;br /&gt;
 void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &lt;br /&gt;
 raises( com::sun::star::uno::Exception );&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module util {&lt;br /&gt;
&lt;br /&gt;
published interface XUpdatable: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //-------------------------------------------------------------------------&lt;br /&gt;
 /** refreshes the data of the object from the connected data source. */&lt;br /&gt;
 void update();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//=============================================================================&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides a function to execute the command which is bound to the toolbar controller.&lt;br /&gt;
&lt;br /&gt;
 @param &lt;br /&gt;
 a combination of &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;KeyModifier&amp;amp;lt;/type&amp;amp;gt; value that represent the current state of the modifier keys.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void execute( [in] short KeyModifier );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a single click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void click();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** notifies a component that a double click has been made on the toolbar item.&lt;br /&gt;
 */&lt;br /&gt;
 void doubleClick();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create a popup window for additional functions.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createPopupWindow();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** requests to create an item window which can be added to the toolbar.&lt;br /&gt;
&lt;br /&gt;
 @param Parent&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which must be used as a parent for the requested item window.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&lt;br /&gt;
 */&lt;br /&gt;
 com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XSubToolbarController : com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** if the controller features a sub-toolbar. &lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 &amp;amp;lt;TRUE/&amp;amp;gt; if the controller offers a sub toolbar, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Enables implementations to dynamically decide to support sub-toolbars&lt;br /&gt;
 or not.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 boolean opensSubToolbar();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** provides the resource URL of the sub-toolbar this controller opens.&lt;br /&gt;
&lt;br /&gt;
 @return&lt;br /&gt;
 name of the sub-toolbar this controller offers. A empty string &lt;br /&gt;
 will be interpreted as if this controller offers no sub-toolbar.&lt;br /&gt;
 */&lt;br /&gt;
 string getSubToolbarName();&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that a sub-toolbar function has been &lt;br /&gt;
 selected.&lt;br /&gt;
&lt;br /&gt;
 @param aCommand&lt;br /&gt;
 a string which identifies the function that has been selected by&lt;br /&gt;
 a user.&lt;br /&gt;
 */&lt;br /&gt;
 void functionSelected( [in] string aCommand );&lt;br /&gt;
&lt;br /&gt;
 //=============================================================================&lt;br /&gt;
 /** gets called to notify a controller that it should set an image which&lt;br /&gt;
 represents the current selected function.&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;p&amp;amp;gt;&lt;br /&gt;
 Only the controller instance is able to set the correct image for the&lt;br /&gt;
 current function. A toolbar implementation will ask sub-toolbar &lt;br /&gt;
 controllers to update their image whenever it has to update the images&lt;br /&gt;
 of all its buttons.&lt;br /&gt;
 &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
 void updateImage();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; }; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBNewForm&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:Refresh&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxToolBoxControl:&amp;lt;br /&amp;gt; public ::com::sun::star::awt::XDockableWindowListener,&amp;lt;br /&amp;gt; public ::com::sun::star::frame::XSubToolbarController,&amp;lt;br /&amp;gt; public svt::ToolboxController &amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt;friend class SfxToolbox;&amp;lt;br /&amp;gt;friend class SfxToolBox_Impl;&amp;lt;br /&amp;gt;friend class SfxToolboxCustomizer;&amp;lt;br /&amp;gt;friend class SfxPopupWindow;&amp;lt;br /&amp;gt;friend struct SfxTbxCtrlFactory;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl_Impl* pImpl;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; DECL_LINK( PopupModeEndHdl, void * );&amp;lt;br /&amp;gt; DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // old SfxToolBoxControl methods&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Select( BOOL bMod1 = FALSE );&amp;lt;br /&amp;gt; virtual void Select( USHORT nModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual SfxPopupWindowType GetPopupWindowType() const;&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindow();&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindowCascading();&amp;lt;br /&amp;gt; virtual Window* CreateItemWindow( Window *pParent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Must be called by subclass to set a new popup window instance&amp;lt;br /&amp;gt; void SetPopupWindow( SfxPopupWindow* pWindow );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XToolbarController&amp;lt;br /&amp;gt; virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createPopupWindow() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt;&amp;amp;amp; rParent ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XSubToolbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XDockableWindowListener&amp;lt;br /&amp;gt; virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &amp;lt;br /&amp;gt; virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // helper methods&amp;lt;br /&amp;gt; void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt; ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XFrame &amp;amp;gt;&amp;amp;amp; xFrame, const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SFX_DECL_TOOLBOX_CONTROL();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp;amp; rBox, BOOL bShowStrings = FALSE );&amp;lt;br /&amp;gt; virtual ~SfxToolBoxControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; ToolBox&amp;amp;amp; GetToolBox() const;&amp;lt;br /&amp;gt; unsigned short GetId() const;&amp;lt;br /&amp;gt; unsigned short GetSlotId() const;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; const ::rtl::OUString&amp;amp;amp; aCommand, &amp;lt;br /&amp;gt; ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt; static void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;amp;gt;&amp;amp;amp; rDispatchProvider, const rtl::OUString&amp;amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxItemState GetItemState( const SfxPoolItem* pState );&amp;lt;br /&amp;gt; static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;service StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** with this interface a component can receive events if a feature has &amp;lt;br /&amp;gt; changed.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; The statusbar controller implementation should register itself as a &amp;lt;br /&amp;gt; listener when its &amp;amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;amp;gt;XUpdatable&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; interface has been called.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusListener;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to initialize a component with required arguments.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;b&amp;amp;gt;A statusbar controller needs at least three additional arguments &amp;lt;br /&amp;gt; provided as &amp;amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;amp;gt;PropertyValue&amp;amp;lt;/type&amp;amp;gt;:&amp;lt;br /&amp;gt; &amp;amp;lt;ul&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Frame&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;lt;br /&amp;gt; &amp;amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;amp;gt;XFrame&amp;amp;lt;/type&amp;amp;gt; instance&amp;lt;br /&amp;gt; to which the toolbar controller belongs.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;CommandURL&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a string which specifies the command a &amp;lt;br /&amp;gt; statusbar controller is bound.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;ServiceManager&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; XMultiServiceFactory&amp;amp;lt;/type&amp;amp;gt; instance which can be used to &amp;lt;br /&amp;gt; create additional UNO services.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/ul&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::lang::XInitialization;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to notify an implementation that it needs to add its listener or &amp;lt;br /&amp;gt; remove and add them again.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; A status bar controller instance is ready for use after this call has &amp;lt;br /&amp;gt; been made the first time. The status bar implementation guarentees that &amp;lt;br /&amp;gt; the controller&amp;#039;s item window has been added to the status bar and its &amp;lt;br /&amp;gt; reference is held by it.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::util::XUpdatable;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** used to notify changed features and requests for additional user &amp;lt;br /&amp;gt; interface items.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Mostly used by a status bar implementation to forward information to &amp;lt;br /&amp;gt; and request services from a status bar controller component. This &amp;lt;br /&amp;gt; interface must be useable after &amp;lt;br /&amp;gt; &amp;amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;XInitialitation::initialize&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; has been called. The behavior of the interface is undefined if the &amp;lt;br /&amp;gt; controller component hasn&amp;#039;t been initialized.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusbarController;&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XStatusbarController : ::com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been pressed. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse has been moved. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been released. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aPos&amp;lt;br /&amp;gt; the current mouse position in pixel.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nCommand&amp;lt;br /&amp;gt; describes which command has been invoked.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param bMouseEvent&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the command is based on a mouse event, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aData&amp;lt;br /&amp;gt; for future use only.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void command( [in] ::com::sun::star::awt::Point aPos,&amp;lt;br /&amp;gt; [in] long nCommand,&amp;lt;br /&amp;gt; [in] boolean bMouseEvent,&amp;lt;br /&amp;gt; [in] any aData );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param xGraphics&amp;lt;br /&amp;gt; the current graphics which should be used for painting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param rOutputRectangle&amp;lt;br /&amp;gt; the output rectangle for graphic operations.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nItemId&amp;lt;br /&amp;gt; the item id of the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nStyle&amp;lt;br /&amp;gt; the style of the statusbar item. The controller should respect the provided&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;style when paints.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&amp;lt;br /&amp;gt; [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&amp;lt;br /&amp;gt; [in] long nItemId,&amp;lt;br /&amp;gt; [in] long nStyle );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user clicked with mouse into the &amp;lt;br /&amp;gt; field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user double-clicked with mouse &amp;lt;br /&amp;gt; into the field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusType&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusDBName&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:StatusbarLogo&amp;amp;lt;/value&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;value/&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; USHORT nSlotId;&amp;lt;br /&amp;gt; USHORT nId;&amp;lt;br /&amp;gt; StatusBar* pBar;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp;amp; aPos, &amp;lt;br /&amp;gt; ::sal_Int32 nCommand, &amp;lt;br /&amp;gt; ::sal_Bool bMouseEvent, &amp;lt;br /&amp;gt; const ::com::sun::star::uno::Any&amp;amp;amp; aData ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XGraphics &amp;amp;gt;&amp;amp;amp; xGraphics, &amp;lt;br /&amp;gt; const ::com::sun::star::awt::Rectangle&amp;amp;amp; rOutputRectangle, &amp;lt;br /&amp;gt; ::sal_Int32 nItemId, &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::sal_Int32 nStyle )&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Old sfx2 interface&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState,&amp;lt;br /&amp;gt; const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Command( const CommandEvent&amp;amp;amp; rCEvt );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonDown( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseMove( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonUp( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual void Paint( const UserDrawEvent &amp;amp;amp;rUDEvt );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp;amp; rBar );&amp;lt;br /&amp;gt; virtual ~SfxStatusBarControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; USHORT GetSlotId() const { return nSlotId; }&amp;lt;br /&amp;gt; USHORT GetId() const { return nId; }&amp;lt;br /&amp;gt; StatusBar&amp;amp;amp; GetStatusBar() const { return *pBar; }&amp;lt;br /&amp;gt; void CaptureMouse();&amp;lt;br /&amp;gt; void ReleaseMouse();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( bNotify &amp;amp;amp;&amp;amp;amp; pContnr )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::uno::Any aState;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( ( eState &amp;amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;amp;&amp;amp;amp; pState &amp;amp;amp;&amp;amp;amp; !IsInvalidItem( pState ) &amp;amp;amp;&amp;amp;amp; !pState-&amp;amp;gt;ISA(SfxVoidItem) )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Retrieve metric from pool to have correct sub ID when calling QueryValue&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;USHORT nSubId( 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// retrieve the core metric&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// it&amp;#039;s enough to check the objectshell, the only shell that does not &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt; &amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;// use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pSlotServ &amp;amp;amp;&amp;amp;amp; pDispatcher )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxShell* pShell = pDispatcher-&amp;amp;gt;GetShell( pSlotServ-&amp;amp;gt;GetShellLevel() );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pShell )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;eMapUnit = GetCoreMetric( pShell-&amp;amp;gt;GetPool(), nSID );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eMapUnit == SFX_MAPUNIT_TWIP )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nSubId |= CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;pState-&amp;amp;gt;QueryValue( aState, (BYTE)nSubId );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;else&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eState == SFX_ITEM_DONTCARE )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Use special uno struct to transport don&amp;#039;t care state&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::ItemStatus aItemStatus;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aState = makeAny( aItemStatus );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::FeatureStateEvent aEvent;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.FeatureURL = aDispatchURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Requery = sal_False;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.State = aState;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceIteratorHelper aIt( *pContnr );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;while&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( aIt.hasMoreElements() )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;try&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;amp;gt;statusChanged( aEvent );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;catch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( ::com::sun::star::uno::RuntimeException&amp;amp;amp; )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aIt.remove();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPUBLIC SfxPoolItem&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPool;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemDesruptor_Impl;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPoolCache;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemSet;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxVoidItem;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG nRefCount; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Referenzzaehler&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nWhich;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nKind;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;SetRefCount( ULONG n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetKind( USHORT n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG AddRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG ReleaseRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPRIVATE &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Delete_Impl(&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;*);&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;protected&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxPoolItem( USHORT nWhich = 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039; TYPEINFO();&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ~SfxPoolItem();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetWhich( USHORT nId ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT Which() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0);&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nWhich; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;==( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;!=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; rItem ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; !(*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;this&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; == rItem); }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper&amp;amp;amp; rIntlWrapper ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit eCoreMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit ePresentationMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; XubString &amp;amp;amp;rText,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper * pIntlWrapper = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetVersion( USHORT nFileFormatVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;ScaleMetrics( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lMult, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lDiv );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;HasMetrics() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL QueryValue( com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL PutValue( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 );&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Create( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SvStream&amp;amp;amp; Store( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG GetRefCount() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nRefCount; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetKind() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nKind; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readByteString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeByteString(SvStream &amp;amp;amp; rStream,UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString,&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; bUnicode);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// n.i.!!&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp;amp; rVal, BYTE nMemberId ) &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool bConvert = 0!=(nMemberId&amp;amp;amp;CONVERT_TWIPS);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nMemberId &amp;amp;amp;= ~CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;switch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( nMemberId )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// jetzt alles signed&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; 0:&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;rVal &amp;amp;lt;&amp;amp;lt;= aUpperLowerMarginScale;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropUpper; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropLower; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; sal_True;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137253</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137253"/>
		<updated>2009-08-11T17:13:00Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Toolbar item controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&amp;lt;br/&amp;gt;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published interface XStatusListener: com::sun::star::lang::XEventListener&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** is called when the status of the feature changes.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param State&amp;lt;br /&amp;gt; provides information about changes of the requested feature&amp;lt;br /&amp;gt; */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; [oneway] void statusChanged( [in] FeatureStateEvent State );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published struct FeatureStateEvent: com::sun::star::lang::EventObject&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the URL of the feature. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; com::sun::star::util::URL FeatureURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains a descriptor of the feature for the user interface.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; string FeatureDescriptor;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the feature is currently enabled or disabled. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean IsEnabled;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean Requery;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the state of the feature in this dispatch.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; any State;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides a function to execute the command which is bound to the toolbar controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param &amp;lt;br /&amp;gt; a combination of &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;KeyModifier&amp;amp;lt;/type&amp;amp;gt; value that represent the current state of the modifier keys.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void execute( [in] short KeyModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a single click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a double click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create a popup window for additional functions.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createPopupWindow();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create an item window which can be added to the toolbar.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param Parent&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which must be used as a parent for the requested item window.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XSubToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** if the controller features a sub-toolbar. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the controller offers a sub toolbar, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Enables implementations to dynamically decide to support sub-toolbars&amp;lt;br /&amp;gt; or not.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean opensSubToolbar();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides the resource URL of the sub-toolbar this controller opens.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; name of the sub-toolbar this controller offers. A empty string &amp;lt;br /&amp;gt; will be interpreted as if this controller offers no sub-toolbar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; string getSubToolbarName();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that a sub-toolbar function has been &amp;lt;br /&amp;gt; selected.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aCommand&amp;lt;br /&amp;gt; a string which identifies the function that has been selected by&amp;lt;br /&amp;gt; a user.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void functionSelected( [in] string aCommand );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that it should set an image which&amp;lt;br /&amp;gt; represents the current selected function.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Only the controller instance is able to set the correct image for the&amp;lt;br /&amp;gt; current function. A toolbar implementation will ask sub-toolbar &amp;lt;br /&amp;gt; controllers to update their image whenever it has to update the images&amp;lt;br /&amp;gt; of all its buttons.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void updateImage();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBNewForm&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:Refresh&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxToolBoxControl:&amp;lt;br /&amp;gt; public ::com::sun::star::awt::XDockableWindowListener,&amp;lt;br /&amp;gt; public ::com::sun::star::frame::XSubToolbarController,&amp;lt;br /&amp;gt; public svt::ToolboxController &amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt;friend class SfxToolbox;&amp;lt;br /&amp;gt;friend class SfxToolBox_Impl;&amp;lt;br /&amp;gt;friend class SfxToolboxCustomizer;&amp;lt;br /&amp;gt;friend class SfxPopupWindow;&amp;lt;br /&amp;gt;friend struct SfxTbxCtrlFactory;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl_Impl* pImpl;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; DECL_LINK( PopupModeEndHdl, void * );&amp;lt;br /&amp;gt; DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // old SfxToolBoxControl methods&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Select( BOOL bMod1 = FALSE );&amp;lt;br /&amp;gt; virtual void Select( USHORT nModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual SfxPopupWindowType GetPopupWindowType() const;&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindow();&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindowCascading();&amp;lt;br /&amp;gt; virtual Window* CreateItemWindow( Window *pParent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Must be called by subclass to set a new popup window instance&amp;lt;br /&amp;gt; void SetPopupWindow( SfxPopupWindow* pWindow );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XToolbarController&amp;lt;br /&amp;gt; virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createPopupWindow() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt;&amp;amp;amp; rParent ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XSubToolbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XDockableWindowListener&amp;lt;br /&amp;gt; virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &amp;lt;br /&amp;gt; virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // helper methods&amp;lt;br /&amp;gt; void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt; ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XFrame &amp;amp;gt;&amp;amp;amp; xFrame, const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SFX_DECL_TOOLBOX_CONTROL();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp;amp; rBox, BOOL bShowStrings = FALSE );&amp;lt;br /&amp;gt; virtual ~SfxToolBoxControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; ToolBox&amp;amp;amp; GetToolBox() const;&amp;lt;br /&amp;gt; unsigned short GetId() const;&amp;lt;br /&amp;gt; unsigned short GetSlotId() const;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; const ::rtl::OUString&amp;amp;amp; aCommand, &amp;lt;br /&amp;gt; ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt; static void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;amp;gt;&amp;amp;amp; rDispatchProvider, const rtl::OUString&amp;amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxItemState GetItemState( const SfxPoolItem* pState );&amp;lt;br /&amp;gt; static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;service StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** with this interface a component can receive events if a feature has &amp;lt;br /&amp;gt; changed.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; The statusbar controller implementation should register itself as a &amp;lt;br /&amp;gt; listener when its &amp;amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;amp;gt;XUpdatable&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; interface has been called.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusListener;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to initialize a component with required arguments.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;b&amp;amp;gt;A statusbar controller needs at least three additional arguments &amp;lt;br /&amp;gt; provided as &amp;amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;amp;gt;PropertyValue&amp;amp;lt;/type&amp;amp;gt;:&amp;lt;br /&amp;gt; &amp;amp;lt;ul&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Frame&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;lt;br /&amp;gt; &amp;amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;amp;gt;XFrame&amp;amp;lt;/type&amp;amp;gt; instance&amp;lt;br /&amp;gt; to which the toolbar controller belongs.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;CommandURL&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a string which specifies the command a &amp;lt;br /&amp;gt; statusbar controller is bound.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;ServiceManager&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; XMultiServiceFactory&amp;amp;lt;/type&amp;amp;gt; instance which can be used to &amp;lt;br /&amp;gt; create additional UNO services.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/ul&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::lang::XInitialization;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to notify an implementation that it needs to add its listener or &amp;lt;br /&amp;gt; remove and add them again.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; A status bar controller instance is ready for use after this call has &amp;lt;br /&amp;gt; been made the first time. The status bar implementation guarentees that &amp;lt;br /&amp;gt; the controller&amp;#039;s item window has been added to the status bar and its &amp;lt;br /&amp;gt; reference is held by it.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::util::XUpdatable;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** used to notify changed features and requests for additional user &amp;lt;br /&amp;gt; interface items.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Mostly used by a status bar implementation to forward information to &amp;lt;br /&amp;gt; and request services from a status bar controller component. This &amp;lt;br /&amp;gt; interface must be useable after &amp;lt;br /&amp;gt; &amp;amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;XInitialitation::initialize&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; has been called. The behavior of the interface is undefined if the &amp;lt;br /&amp;gt; controller component hasn&amp;#039;t been initialized.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusbarController;&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XStatusbarController : ::com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been pressed. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse has been moved. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been released. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aPos&amp;lt;br /&amp;gt; the current mouse position in pixel.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nCommand&amp;lt;br /&amp;gt; describes which command has been invoked.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param bMouseEvent&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the command is based on a mouse event, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aData&amp;lt;br /&amp;gt; for future use only.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void command( [in] ::com::sun::star::awt::Point aPos,&amp;lt;br /&amp;gt; [in] long nCommand,&amp;lt;br /&amp;gt; [in] boolean bMouseEvent,&amp;lt;br /&amp;gt; [in] any aData );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param xGraphics&amp;lt;br /&amp;gt; the current graphics which should be used for painting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param rOutputRectangle&amp;lt;br /&amp;gt; the output rectangle for graphic operations.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nItemId&amp;lt;br /&amp;gt; the item id of the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nStyle&amp;lt;br /&amp;gt; the style of the statusbar item. The controller should respect the provided&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;style when paints.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&amp;lt;br /&amp;gt; [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&amp;lt;br /&amp;gt; [in] long nItemId,&amp;lt;br /&amp;gt; [in] long nStyle );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user clicked with mouse into the &amp;lt;br /&amp;gt; field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user double-clicked with mouse &amp;lt;br /&amp;gt; into the field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusType&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusDBName&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:StatusbarLogo&amp;amp;lt;/value&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;value/&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; USHORT nSlotId;&amp;lt;br /&amp;gt; USHORT nId;&amp;lt;br /&amp;gt; StatusBar* pBar;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp;amp; aPos, &amp;lt;br /&amp;gt; ::sal_Int32 nCommand, &amp;lt;br /&amp;gt; ::sal_Bool bMouseEvent, &amp;lt;br /&amp;gt; const ::com::sun::star::uno::Any&amp;amp;amp; aData ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XGraphics &amp;amp;gt;&amp;amp;amp; xGraphics, &amp;lt;br /&amp;gt; const ::com::sun::star::awt::Rectangle&amp;amp;amp; rOutputRectangle, &amp;lt;br /&amp;gt; ::sal_Int32 nItemId, &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::sal_Int32 nStyle )&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Old sfx2 interface&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState,&amp;lt;br /&amp;gt; const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Command( const CommandEvent&amp;amp;amp; rCEvt );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonDown( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseMove( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonUp( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual void Paint( const UserDrawEvent &amp;amp;amp;rUDEvt );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp;amp; rBar );&amp;lt;br /&amp;gt; virtual ~SfxStatusBarControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; USHORT GetSlotId() const { return nSlotId; }&amp;lt;br /&amp;gt; USHORT GetId() const { return nId; }&amp;lt;br /&amp;gt; StatusBar&amp;amp;amp; GetStatusBar() const { return *pBar; }&amp;lt;br /&amp;gt; void CaptureMouse();&amp;lt;br /&amp;gt; void ReleaseMouse();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( bNotify &amp;amp;amp;&amp;amp;amp; pContnr )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::uno::Any aState;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( ( eState &amp;amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;amp;&amp;amp;amp; pState &amp;amp;amp;&amp;amp;amp; !IsInvalidItem( pState ) &amp;amp;amp;&amp;amp;amp; !pState-&amp;amp;gt;ISA(SfxVoidItem) )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Retrieve metric from pool to have correct sub ID when calling QueryValue&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;USHORT nSubId( 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// retrieve the core metric&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// it&amp;#039;s enough to check the objectshell, the only shell that does not &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt; &amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;// use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pSlotServ &amp;amp;amp;&amp;amp;amp; pDispatcher )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxShell* pShell = pDispatcher-&amp;amp;gt;GetShell( pSlotServ-&amp;amp;gt;GetShellLevel() );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pShell )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;eMapUnit = GetCoreMetric( pShell-&amp;amp;gt;GetPool(), nSID );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eMapUnit == SFX_MAPUNIT_TWIP )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nSubId |= CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;pState-&amp;amp;gt;QueryValue( aState, (BYTE)nSubId );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;else&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eState == SFX_ITEM_DONTCARE )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Use special uno struct to transport don&amp;#039;t care state&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::ItemStatus aItemStatus;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aState = makeAny( aItemStatus );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::FeatureStateEvent aEvent;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.FeatureURL = aDispatchURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Requery = sal_False;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.State = aState;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceIteratorHelper aIt( *pContnr );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;while&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( aIt.hasMoreElements() )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;try&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;amp;gt;statusChanged( aEvent );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;catch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( ::com::sun::star::uno::RuntimeException&amp;amp;amp; )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aIt.remove();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPUBLIC SfxPoolItem&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPool;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemDesruptor_Impl;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPoolCache;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemSet;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxVoidItem;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG nRefCount; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Referenzzaehler&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nWhich;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nKind;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;SetRefCount( ULONG n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetKind( USHORT n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG AddRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG ReleaseRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPRIVATE &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Delete_Impl(&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;*);&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;protected&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxPoolItem( USHORT nWhich = 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039; TYPEINFO();&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ~SfxPoolItem();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetWhich( USHORT nId ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT Which() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0);&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nWhich; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;==( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;!=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; rItem ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; !(*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;this&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; == rItem); }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper&amp;amp;amp; rIntlWrapper ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit eCoreMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit ePresentationMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; XubString &amp;amp;amp;rText,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper * pIntlWrapper = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetVersion( USHORT nFileFormatVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;ScaleMetrics( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lMult, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lDiv );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;HasMetrics() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL QueryValue( com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL PutValue( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 );&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Create( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SvStream&amp;amp;amp; Store( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG GetRefCount() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nRefCount; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetKind() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nKind; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readByteString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeByteString(SvStream &amp;amp;amp; rStream,UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString,&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; bUnicode);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// n.i.!!&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp;amp; rVal, BYTE nMemberId ) &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool bConvert = 0!=(nMemberId&amp;amp;amp;CONVERT_TWIPS);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nMemberId &amp;amp;amp;= ~CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;switch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( nMemberId )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// jetzt alles signed&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; 0:&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;rVal &amp;amp;lt;&amp;amp;lt;= aUpperLowerMarginScale;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropUpper; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropLower; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; sal_True;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137252</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137252"/>
		<updated>2009-08-11T17:10:40Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: fix formatting of example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&amp;lt;br/&amp;gt;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published interface XStatusListener: com::sun::star::lang::XEventListener&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** is called when the status of the feature changes.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param State&amp;lt;br /&amp;gt; provides information about changes of the requested feature&amp;lt;br /&amp;gt; */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; [oneway] void statusChanged( [in] FeatureStateEvent State );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published struct FeatureStateEvent: com::sun::star::lang::EventObject&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the URL of the feature. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; com::sun::star::util::URL FeatureURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains a descriptor of the feature for the user interface.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; string FeatureDescriptor;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the feature is currently enabled or disabled. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean IsEnabled;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean Requery;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the state of the feature in this dispatch.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; any State;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides a function to execute the command which is bound to the toolbar controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param &amp;lt;br /&amp;gt; a combination of &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;KeyModifier&amp;amp;lt;/type&amp;amp;gt; value that represent the current state of the modifier keys.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void execute( [in] short KeyModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a single click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a double click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create a popup window for additional functions.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createPopupWindow();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create an item window which can be added to the toolbar.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param Parent&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which must be used as a parent for the requested item window.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XSubToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** if the controller features a sub-toolbar. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the controller offers a sub toolbar, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Enables implementations to dynamically decide to support sub-toolbars&amp;lt;br /&amp;gt; or not.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean opensSubToolbar();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides the resource URL of the sub-toolbar this controller opens.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; name of the sub-toolbar this controller offers. A empty string &amp;lt;br /&amp;gt; will be interpreted as if this controller offers no sub-toolbar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; string getSubToolbarName();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that a sub-toolbar function has been &amp;lt;br /&amp;gt; selected.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aCommand&amp;lt;br /&amp;gt; a string which identifies the function that has been selected by&amp;lt;br /&amp;gt; a user.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void functionSelected( [in] string aCommand );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that it should set an image which&amp;lt;br /&amp;gt; represents the current selected function.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Only the controller instance is able to set the correct image for the&amp;lt;br /&amp;gt; current function. A toolbar implementation will ask sub-toolbar &amp;lt;br /&amp;gt; controllers to update their image whenever it has to update the images&amp;lt;br /&amp;gt; of all its buttons.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void updateImage();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBNewForm&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:Refresh&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxToolBoxControl:&amp;lt;br /&amp;gt; public ::com::sun::star::awt::XDockableWindowListener,&amp;lt;br /&amp;gt; public ::com::sun::star::frame::XSubToolbarController,&amp;lt;br /&amp;gt; public svt::ToolboxController &amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt;friend class SfxToolbox;&amp;lt;br /&amp;gt;friend class SfxToolBox_Impl;&amp;lt;br /&amp;gt;friend class SfxToolboxCustomizer;&amp;lt;br /&amp;gt;friend class SfxPopupWindow;&amp;lt;br /&amp;gt;friend struct SfxTbxCtrlFactory;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl_Impl* pImpl;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; DECL_LINK( PopupModeEndHdl, void * );&amp;lt;br /&amp;gt; DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // old SfxToolBoxControl methods&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Select( BOOL bMod1 = FALSE );&amp;lt;br /&amp;gt; virtual void Select( USHORT nModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual SfxPopupWindowType GetPopupWindowType() const;&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindow();&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindowCascading();&amp;lt;br /&amp;gt; virtual Window* CreateItemWindow( Window *pParent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Must be called by subclass to set a new popup window instance&amp;lt;br /&amp;gt; void SetPopupWindow( SfxPopupWindow* pWindow );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XToolbarController&amp;lt;br /&amp;gt; virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createPopupWindow() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt;&amp;amp;amp; rParent ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XSubToolbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XDockableWindowListener&amp;lt;br /&amp;gt; virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &amp;lt;br /&amp;gt; virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // helper methods&amp;lt;br /&amp;gt; void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt; ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XFrame &amp;amp;gt;&amp;amp;amp; xFrame, const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SFX_DECL_TOOLBOX_CONTROL();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp;amp; rBox, BOOL bShowStrings = FALSE );&amp;lt;br /&amp;gt; virtual ~SfxToolBoxControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; ToolBox&amp;amp;amp; GetToolBox() const;&amp;lt;br /&amp;gt; unsigned short GetId() const;&amp;lt;br /&amp;gt; unsigned short GetSlotId() const;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; const ::rtl::OUString&amp;amp;amp; aCommand, &amp;lt;br /&amp;gt; ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt; static void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;amp;gt;&amp;amp;amp; rDispatchProvider, const rtl::OUString&amp;amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxItemState GetItemState( const SfxPoolItem* pState );&amp;lt;br /&amp;gt; static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;service StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** with this interface a component can receive events if a feature has &amp;lt;br /&amp;gt; changed.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; The statusbar controller implementation should register itself as a &amp;lt;br /&amp;gt; listener when its &amp;amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;amp;gt;XUpdatable&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; interface has been called.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusListener;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to initialize a component with required arguments.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;b&amp;amp;gt;A statusbar controller needs at least three additional arguments &amp;lt;br /&amp;gt; provided as &amp;amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;amp;gt;PropertyValue&amp;amp;lt;/type&amp;amp;gt;:&amp;lt;br /&amp;gt; &amp;amp;lt;ul&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Frame&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;lt;br /&amp;gt; &amp;amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;amp;gt;XFrame&amp;amp;lt;/type&amp;amp;gt; instance&amp;lt;br /&amp;gt; to which the toolbar controller belongs.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;CommandURL&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a string which specifies the command a &amp;lt;br /&amp;gt; statusbar controller is bound.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;ServiceManager&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; XMultiServiceFactory&amp;amp;lt;/type&amp;amp;gt; instance which can be used to &amp;lt;br /&amp;gt; create additional UNO services.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/ul&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::lang::XInitialization;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to notify an implementation that it needs to add its listener or &amp;lt;br /&amp;gt; remove and add them again.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; A status bar controller instance is ready for use after this call has &amp;lt;br /&amp;gt; been made the first time. The status bar implementation guarentees that &amp;lt;br /&amp;gt; the controller&amp;#039;s item window has been added to the status bar and its &amp;lt;br /&amp;gt; reference is held by it.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::util::XUpdatable;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** used to notify changed features and requests for additional user &amp;lt;br /&amp;gt; interface items.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Mostly used by a status bar implementation to forward information to &amp;lt;br /&amp;gt; and request services from a status bar controller component. This &amp;lt;br /&amp;gt; interface must be useable after &amp;lt;br /&amp;gt; &amp;amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;XInitialitation::initialize&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; has been called. The behavior of the interface is undefined if the &amp;lt;br /&amp;gt; controller component hasn&amp;#039;t been initialized.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusbarController;&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XStatusbarController : ::com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been pressed. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse has been moved. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been released. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aPos&amp;lt;br /&amp;gt; the current mouse position in pixel.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nCommand&amp;lt;br /&amp;gt; describes which command has been invoked.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param bMouseEvent&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the command is based on a mouse event, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aData&amp;lt;br /&amp;gt; for future use only.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void command( [in] ::com::sun::star::awt::Point aPos,&amp;lt;br /&amp;gt; [in] long nCommand,&amp;lt;br /&amp;gt; [in] boolean bMouseEvent,&amp;lt;br /&amp;gt; [in] any aData );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param xGraphics&amp;lt;br /&amp;gt; the current graphics which should be used for painting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param rOutputRectangle&amp;lt;br /&amp;gt; the output rectangle for graphic operations.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nItemId&amp;lt;br /&amp;gt; the item id of the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nStyle&amp;lt;br /&amp;gt; the style of the statusbar item. The controller should respect the provided&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;style when paints.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&amp;lt;br /&amp;gt; [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&amp;lt;br /&amp;gt; [in] long nItemId,&amp;lt;br /&amp;gt; [in] long nStyle );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user clicked with mouse into the &amp;lt;br /&amp;gt; field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user double-clicked with mouse &amp;lt;br /&amp;gt; into the field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusType&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusDBName&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:StatusbarLogo&amp;amp;lt;/value&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;value/&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; USHORT nSlotId;&amp;lt;br /&amp;gt; USHORT nId;&amp;lt;br /&amp;gt; StatusBar* pBar;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp;amp; aPos, &amp;lt;br /&amp;gt; ::sal_Int32 nCommand, &amp;lt;br /&amp;gt; ::sal_Bool bMouseEvent, &amp;lt;br /&amp;gt; const ::com::sun::star::uno::Any&amp;amp;amp; aData ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XGraphics &amp;amp;gt;&amp;amp;amp; xGraphics, &amp;lt;br /&amp;gt; const ::com::sun::star::awt::Rectangle&amp;amp;amp; rOutputRectangle, &amp;lt;br /&amp;gt; ::sal_Int32 nItemId, &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::sal_Int32 nStyle )&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Old sfx2 interface&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState,&amp;lt;br /&amp;gt; const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Command( const CommandEvent&amp;amp;amp; rCEvt );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonDown( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseMove( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonUp( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual void Paint( const UserDrawEvent &amp;amp;amp;rUDEvt );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp;amp; rBar );&amp;lt;br /&amp;gt; virtual ~SfxStatusBarControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; USHORT GetSlotId() const { return nSlotId; }&amp;lt;br /&amp;gt; USHORT GetId() const { return nId; }&amp;lt;br /&amp;gt; StatusBar&amp;amp;amp; GetStatusBar() const { return *pBar; }&amp;lt;br /&amp;gt; void CaptureMouse();&amp;lt;br /&amp;gt; void ReleaseMouse();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( bNotify &amp;amp;amp;&amp;amp;amp; pContnr )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::uno::Any aState;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( ( eState &amp;amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;amp;&amp;amp;amp; pState &amp;amp;amp;&amp;amp;amp; !IsInvalidItem( pState ) &amp;amp;amp;&amp;amp;amp; !pState-&amp;amp;gt;ISA(SfxVoidItem) )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Retrieve metric from pool to have correct sub ID when calling QueryValue&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;USHORT nSubId( 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// retrieve the core metric&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// it&amp;#039;s enough to check the objectshell, the only shell that does not &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt; &amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;// use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pSlotServ &amp;amp;amp;&amp;amp;amp; pDispatcher )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxShell* pShell = pDispatcher-&amp;amp;gt;GetShell( pSlotServ-&amp;amp;gt;GetShellLevel() );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pShell )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;eMapUnit = GetCoreMetric( pShell-&amp;amp;gt;GetPool(), nSID );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eMapUnit == SFX_MAPUNIT_TWIP )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nSubId |= CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;pState-&amp;amp;gt;QueryValue( aState, (BYTE)nSubId );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;else&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eState == SFX_ITEM_DONTCARE )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Use special uno struct to transport don&amp;#039;t care state&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::ItemStatus aItemStatus;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aState = makeAny( aItemStatus );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::FeatureStateEvent aEvent;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.FeatureURL = aDispatchURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Requery = sal_False;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.State = aState;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceIteratorHelper aIt( *pContnr );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;while&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( aIt.hasMoreElements() )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;try&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;amp;gt;statusChanged( aEvent );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;catch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( ::com::sun::star::uno::RuntimeException&amp;amp;amp; )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aIt.remove();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPUBLIC SfxPoolItem&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPool;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemDesruptor_Impl;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPoolCache;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemSet;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxVoidItem;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG nRefCount; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Referenzzaehler&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nWhich;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nKind;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;SetRefCount( ULONG n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetKind( USHORT n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG AddRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG ReleaseRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPRIVATE &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Delete_Impl(&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;*);&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;protected&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxPoolItem( USHORT nWhich = 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039; TYPEINFO();&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ~SfxPoolItem();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetWhich( USHORT nId ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT Which() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0);&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nWhich; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;==( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;!=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; rItem ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; !(*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;this&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; == rItem); }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper&amp;amp;amp; rIntlWrapper ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit eCoreMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit ePresentationMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; XubString &amp;amp;amp;rText,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper * pIntlWrapper = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetVersion( USHORT nFileFormatVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;ScaleMetrics( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lMult, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lDiv );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;HasMetrics() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL QueryValue( com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL PutValue( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 );&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Create( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SvStream&amp;amp;amp; Store( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG GetRefCount() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nRefCount; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetKind() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nKind; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readByteString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeByteString(SvStream &amp;amp;amp; rStream,UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString,&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; bUnicode);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// n.i.!!&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp;amp; rVal, BYTE nMemberId ) &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool bConvert = 0!=(nMemberId&amp;amp;amp;CONVERT_TWIPS);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nMemberId &amp;amp;amp;= ~CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;switch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( nMemberId )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// jetzt alles signed&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; 0:&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;rVal &amp;amp;lt;&amp;amp;lt;= aUpperLowerMarginScale;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropUpper; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropLower; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; sal_True;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137251</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137251"/>
		<updated>2009-08-11T17:07:58Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Generic menu item controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&amp;lt;br/&amp;gt;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published interface XStatusListener: com::sun::star::lang::XEventListener&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** is called when the status of the feature changes.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param State&amp;lt;br /&amp;gt; provides information about changes of the requested feature&amp;lt;br /&amp;gt; */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; [oneway] void statusChanged( [in] FeatureStateEvent State );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published struct FeatureStateEvent: com::sun::star::lang::EventObject&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the URL of the feature. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; com::sun::star::util::URL FeatureURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains a descriptor of the feature for the user interface.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; string FeatureDescriptor;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the feature is currently enabled or disabled. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean IsEnabled;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean Requery;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the state of the feature in this dispatch.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; any State;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides a function to execute the command which is bound to the toolbar controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param &amp;lt;br /&amp;gt; a combination of &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;KeyModifier&amp;amp;lt;/type&amp;amp;gt; value that represent the current state of the modifier keys.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void execute( [in] short KeyModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a single click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a double click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create a popup window for additional functions.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createPopupWindow();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create an item window which can be added to the toolbar.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param Parent&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which must be used as a parent for the requested item window.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XSubToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** if the controller features a sub-toolbar. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the controller offers a sub toolbar, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Enables implementations to dynamically decide to support sub-toolbars&amp;lt;br /&amp;gt; or not.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean opensSubToolbar();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides the resource URL of the sub-toolbar this controller opens.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; name of the sub-toolbar this controller offers. A empty string &amp;lt;br /&amp;gt; will be interpreted as if this controller offers no sub-toolbar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; string getSubToolbarName();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that a sub-toolbar function has been &amp;lt;br /&amp;gt; selected.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aCommand&amp;lt;br /&amp;gt; a string which identifies the function that has been selected by&amp;lt;br /&amp;gt; a user.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void functionSelected( [in] string aCommand );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that it should set an image which&amp;lt;br /&amp;gt; represents the current selected function.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Only the controller instance is able to set the correct image for the&amp;lt;br /&amp;gt; current function. A toolbar implementation will ask sub-toolbar &amp;lt;br /&amp;gt; controllers to update their image whenever it has to update the images&amp;lt;br /&amp;gt; of all its buttons.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void updateImage();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBNewForm&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:Refresh&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxToolBoxControl:&amp;lt;br /&amp;gt; public ::com::sun::star::awt::XDockableWindowListener,&amp;lt;br /&amp;gt; public ::com::sun::star::frame::XSubToolbarController,&amp;lt;br /&amp;gt; public svt::ToolboxController &amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt;friend class SfxToolbox;&amp;lt;br /&amp;gt;friend class SfxToolBox_Impl;&amp;lt;br /&amp;gt;friend class SfxToolboxCustomizer;&amp;lt;br /&amp;gt;friend class SfxPopupWindow;&amp;lt;br /&amp;gt;friend struct SfxTbxCtrlFactory;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl_Impl* pImpl;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; DECL_LINK( PopupModeEndHdl, void * );&amp;lt;br /&amp;gt; DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // old SfxToolBoxControl methods&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Select( BOOL bMod1 = FALSE );&amp;lt;br /&amp;gt; virtual void Select( USHORT nModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual SfxPopupWindowType GetPopupWindowType() const;&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindow();&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindowCascading();&amp;lt;br /&amp;gt; virtual Window* CreateItemWindow( Window *pParent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Must be called by subclass to set a new popup window instance&amp;lt;br /&amp;gt; void SetPopupWindow( SfxPopupWindow* pWindow );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XToolbarController&amp;lt;br /&amp;gt; virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createPopupWindow() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt;&amp;amp;amp; rParent ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XSubToolbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XDockableWindowListener&amp;lt;br /&amp;gt; virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &amp;lt;br /&amp;gt; virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // helper methods&amp;lt;br /&amp;gt; void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt; ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XFrame &amp;amp;gt;&amp;amp;amp; xFrame, const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SFX_DECL_TOOLBOX_CONTROL();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp;amp; rBox, BOOL bShowStrings = FALSE );&amp;lt;br /&amp;gt; virtual ~SfxToolBoxControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; ToolBox&amp;amp;amp; GetToolBox() const;&amp;lt;br /&amp;gt; unsigned short GetId() const;&amp;lt;br /&amp;gt; unsigned short GetSlotId() const;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; const ::rtl::OUString&amp;amp;amp; aCommand, &amp;lt;br /&amp;gt; ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt; static void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;amp;gt;&amp;amp;amp; rDispatchProvider, const rtl::OUString&amp;amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxItemState GetItemState( const SfxPoolItem* pState );&amp;lt;br /&amp;gt; static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;service StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** with this interface a component can receive events if a feature has &amp;lt;br /&amp;gt; changed.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; The statusbar controller implementation should register itself as a &amp;lt;br /&amp;gt; listener when its &amp;amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;amp;gt;XUpdatable&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; interface has been called.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusListener;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to initialize a component with required arguments.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;b&amp;amp;gt;A statusbar controller needs at least three additional arguments &amp;lt;br /&amp;gt; provided as &amp;amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;amp;gt;PropertyValue&amp;amp;lt;/type&amp;amp;gt;:&amp;lt;br /&amp;gt; &amp;amp;lt;ul&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Frame&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;lt;br /&amp;gt; &amp;amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;amp;gt;XFrame&amp;amp;lt;/type&amp;amp;gt; instance&amp;lt;br /&amp;gt; to which the toolbar controller belongs.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;CommandURL&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a string which specifies the command a &amp;lt;br /&amp;gt; statusbar controller is bound.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;ServiceManager&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; XMultiServiceFactory&amp;amp;lt;/type&amp;amp;gt; instance which can be used to &amp;lt;br /&amp;gt; create additional UNO services.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/ul&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::lang::XInitialization;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to notify an implementation that it needs to add its listener or &amp;lt;br /&amp;gt; remove and add them again.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; A status bar controller instance is ready for use after this call has &amp;lt;br /&amp;gt; been made the first time. The status bar implementation guarentees that &amp;lt;br /&amp;gt; the controller&amp;#039;s item window has been added to the status bar and its &amp;lt;br /&amp;gt; reference is held by it.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::util::XUpdatable;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** used to notify changed features and requests for additional user &amp;lt;br /&amp;gt; interface items.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Mostly used by a status bar implementation to forward information to &amp;lt;br /&amp;gt; and request services from a status bar controller component. This &amp;lt;br /&amp;gt; interface must be useable after &amp;lt;br /&amp;gt; &amp;amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;XInitialitation::initialize&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; has been called. The behavior of the interface is undefined if the &amp;lt;br /&amp;gt; controller component hasn&amp;#039;t been initialized.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusbarController;&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XStatusbarController : ::com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been pressed. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse has been moved. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been released. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aPos&amp;lt;br /&amp;gt; the current mouse position in pixel.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nCommand&amp;lt;br /&amp;gt; describes which command has been invoked.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param bMouseEvent&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the command is based on a mouse event, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aData&amp;lt;br /&amp;gt; for future use only.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void command( [in] ::com::sun::star::awt::Point aPos,&amp;lt;br /&amp;gt; [in] long nCommand,&amp;lt;br /&amp;gt; [in] boolean bMouseEvent,&amp;lt;br /&amp;gt; [in] any aData );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param xGraphics&amp;lt;br /&amp;gt; the current graphics which should be used for painting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param rOutputRectangle&amp;lt;br /&amp;gt; the output rectangle for graphic operations.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nItemId&amp;lt;br /&amp;gt; the item id of the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nStyle&amp;lt;br /&amp;gt; the style of the statusbar item. The controller should respect the provided&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;style when paints.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&amp;lt;br /&amp;gt; [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&amp;lt;br /&amp;gt; [in] long nItemId,&amp;lt;br /&amp;gt; [in] long nStyle );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user clicked with mouse into the &amp;lt;br /&amp;gt; field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user double-clicked with mouse &amp;lt;br /&amp;gt; into the field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusType&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusDBName&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:StatusbarLogo&amp;amp;lt;/value&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;value/&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; USHORT nSlotId;&amp;lt;br /&amp;gt; USHORT nId;&amp;lt;br /&amp;gt; StatusBar* pBar;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp;amp; aPos, &amp;lt;br /&amp;gt; ::sal_Int32 nCommand, &amp;lt;br /&amp;gt; ::sal_Bool bMouseEvent, &amp;lt;br /&amp;gt; const ::com::sun::star::uno::Any&amp;amp;amp; aData ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XGraphics &amp;amp;gt;&amp;amp;amp; xGraphics, &amp;lt;br /&amp;gt; const ::com::sun::star::awt::Rectangle&amp;amp;amp; rOutputRectangle, &amp;lt;br /&amp;gt; ::sal_Int32 nItemId, &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::sal_Int32 nStyle )&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Old sfx2 interface&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState,&amp;lt;br /&amp;gt; const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Command( const CommandEvent&amp;amp;amp; rCEvt );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonDown( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseMove( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonUp( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual void Paint( const UserDrawEvent &amp;amp;amp;rUDEvt );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp;amp; rBar );&amp;lt;br /&amp;gt; virtual ~SfxStatusBarControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; USHORT GetSlotId() const { return nSlotId; }&amp;lt;br /&amp;gt; USHORT GetId() const { return nId; }&amp;lt;br /&amp;gt; StatusBar&amp;amp;amp; GetStatusBar() const { return *pBar; }&amp;lt;br /&amp;gt; void CaptureMouse();&amp;lt;br /&amp;gt; void ReleaseMouse();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( bNotify &amp;amp;amp;&amp;amp;amp; pContnr )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::uno::Any aState;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( ( eState &amp;amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;amp;&amp;amp;amp; pState &amp;amp;amp;&amp;amp;amp; !IsInvalidItem( pState ) &amp;amp;amp;&amp;amp;amp; !pState-&amp;amp;gt;ISA(SfxVoidItem) )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Retrieve metric from pool to have correct sub ID when calling QueryValue&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;USHORT nSubId( 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// retrieve the core metric&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// it&amp;#039;s enough to check the objectshell, the only shell that does not &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt; &amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;// use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pSlotServ &amp;amp;amp;&amp;amp;amp; pDispatcher )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxShell* pShell = pDispatcher-&amp;amp;gt;GetShell( pSlotServ-&amp;amp;gt;GetShellLevel() );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pShell )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;eMapUnit = GetCoreMetric( pShell-&amp;amp;gt;GetPool(), nSID );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eMapUnit == SFX_MAPUNIT_TWIP )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nSubId |= CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;pState-&amp;amp;gt;QueryValue( aState, (BYTE)nSubId );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;else&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eState == SFX_ITEM_DONTCARE )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Use special uno struct to transport don&amp;#039;t care state&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::ItemStatus aItemStatus;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aState = makeAny( aItemStatus );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::FeatureStateEvent aEvent;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.FeatureURL = aDispatchURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Requery = sal_False;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.State = aState;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceIteratorHelper aIt( *pContnr );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;while&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( aIt.hasMoreElements() )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;try&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;amp;gt;statusChanged( aEvent );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;catch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( ::com::sun::star::uno::RuntimeException&amp;amp;amp; )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aIt.remove();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPUBLIC SfxPoolItem&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPool;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemDesruptor_Impl;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPoolCache;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemSet;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxVoidItem;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG nRefCount; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Referenzzaehler&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nWhich;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nKind;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;SetRefCount( ULONG n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetKind( USHORT n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG AddRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG ReleaseRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPRIVATE &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Delete_Impl(&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;*);&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;protected&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxPoolItem( USHORT nWhich = 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039; TYPEINFO();&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ~SfxPoolItem();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetWhich( USHORT nId ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT Which() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0);&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nWhich; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;==( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;!=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; rItem ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; !(*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;this&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; == rItem); }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper&amp;amp;amp; rIntlWrapper ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit eCoreMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit ePresentationMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; XubString &amp;amp;amp;rText,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper * pIntlWrapper = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetVersion( USHORT nFileFormatVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;ScaleMetrics( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lMult, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lDiv );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;HasMetrics() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL QueryValue( com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL PutValue( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 );&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Create( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SvStream&amp;amp;amp; Store( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG GetRefCount() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nRefCount; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetKind() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nKind; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readByteString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeByteString(SvStream &amp;amp;amp; rStream,UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString,&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; bUnicode);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// n.i.!!&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp;amp; rVal, BYTE nMemberId ) &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool bConvert = 0!=(nMemberId&amp;amp;amp;CONVERT_TWIPS);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nMemberId &amp;amp;amp;= ~CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;switch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( nMemberId )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// jetzt alles signed&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; 0:&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;rVal &amp;amp;lt;&amp;amp;lt;= aUpperLowerMarginScale;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropUpper; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropLower; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; sal_True;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137250</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137250"/>
		<updated>2009-08-11T17:07:00Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: fix formatting of examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&amp;lt;br/&amp;gt;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published interface XStatusListener: com::sun::star::lang::XEventListener&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** is called when the status of the feature changes.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param State&amp;lt;br /&amp;gt; provides information about changes of the requested feature&amp;lt;br /&amp;gt; */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; [oneway] void statusChanged( [in] FeatureStateEvent State );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published struct FeatureStateEvent: com::sun::star::lang::EventObject&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the URL of the feature. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; com::sun::star::util::URL FeatureURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains a descriptor of the feature for the user interface.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; string FeatureDescriptor;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the feature is currently enabled or disabled. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean IsEnabled;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean Requery;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the state of the feature in this dispatch.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; any State;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides a function to execute the command which is bound to the toolbar controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param &amp;lt;br /&amp;gt; a combination of &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;KeyModifier&amp;amp;lt;/type&amp;amp;gt; value that represent the current state of the modifier keys.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void execute( [in] short KeyModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a single click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a double click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create a popup window for additional functions.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createPopupWindow();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create an item window which can be added to the toolbar.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param Parent&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which must be used as a parent for the requested item window.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XSubToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** if the controller features a sub-toolbar. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the controller offers a sub toolbar, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Enables implementations to dynamically decide to support sub-toolbars&amp;lt;br /&amp;gt; or not.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean opensSubToolbar();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides the resource URL of the sub-toolbar this controller opens.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; name of the sub-toolbar this controller offers. A empty string &amp;lt;br /&amp;gt; will be interpreted as if this controller offers no sub-toolbar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; string getSubToolbarName();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that a sub-toolbar function has been &amp;lt;br /&amp;gt; selected.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aCommand&amp;lt;br /&amp;gt; a string which identifies the function that has been selected by&amp;lt;br /&amp;gt; a user.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void functionSelected( [in] string aCommand );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that it should set an image which&amp;lt;br /&amp;gt; represents the current selected function.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Only the controller instance is able to set the correct image for the&amp;lt;br /&amp;gt; current function. A toolbar implementation will ask sub-toolbar &amp;lt;br /&amp;gt; controllers to update their image whenever it has to update the images&amp;lt;br /&amp;gt; of all its buttons.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void updateImage();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBNewForm&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:Refresh&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxToolBoxControl:&amp;lt;br /&amp;gt; public ::com::sun::star::awt::XDockableWindowListener,&amp;lt;br /&amp;gt; public ::com::sun::star::frame::XSubToolbarController,&amp;lt;br /&amp;gt; public svt::ToolboxController &amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt;friend class SfxToolbox;&amp;lt;br /&amp;gt;friend class SfxToolBox_Impl;&amp;lt;br /&amp;gt;friend class SfxToolboxCustomizer;&amp;lt;br /&amp;gt;friend class SfxPopupWindow;&amp;lt;br /&amp;gt;friend struct SfxTbxCtrlFactory;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl_Impl* pImpl;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; DECL_LINK( PopupModeEndHdl, void * );&amp;lt;br /&amp;gt; DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // old SfxToolBoxControl methods&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Select( BOOL bMod1 = FALSE );&amp;lt;br /&amp;gt; virtual void Select( USHORT nModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual SfxPopupWindowType GetPopupWindowType() const;&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindow();&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindowCascading();&amp;lt;br /&amp;gt; virtual Window* CreateItemWindow( Window *pParent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Must be called by subclass to set a new popup window instance&amp;lt;br /&amp;gt; void SetPopupWindow( SfxPopupWindow* pWindow );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XToolbarController&amp;lt;br /&amp;gt; virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createPopupWindow() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt;&amp;amp;amp; rParent ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XSubToolbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XDockableWindowListener&amp;lt;br /&amp;gt; virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &amp;lt;br /&amp;gt; virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // helper methods&amp;lt;br /&amp;gt; void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt; ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XFrame &amp;amp;gt;&amp;amp;amp; xFrame, const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SFX_DECL_TOOLBOX_CONTROL();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp;amp; rBox, BOOL bShowStrings = FALSE );&amp;lt;br /&amp;gt; virtual ~SfxToolBoxControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; ToolBox&amp;amp;amp; GetToolBox() const;&amp;lt;br /&amp;gt; unsigned short GetId() const;&amp;lt;br /&amp;gt; unsigned short GetSlotId() const;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; const ::rtl::OUString&amp;amp;amp; aCommand, &amp;lt;br /&amp;gt; ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt; static void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;amp;gt;&amp;amp;amp; rDispatchProvider, const rtl::OUString&amp;amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxItemState GetItemState( const SfxPoolItem* pState );&amp;lt;br /&amp;gt; static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;service StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** with this interface a component can receive events if a feature has &amp;lt;br /&amp;gt; changed.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; The statusbar controller implementation should register itself as a &amp;lt;br /&amp;gt; listener when its &amp;amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;amp;gt;XUpdatable&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; interface has been called.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusListener;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to initialize a component with required arguments.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;b&amp;amp;gt;A statusbar controller needs at least three additional arguments &amp;lt;br /&amp;gt; provided as &amp;amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;amp;gt;PropertyValue&amp;amp;lt;/type&amp;amp;gt;:&amp;lt;br /&amp;gt; &amp;amp;lt;ul&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Frame&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;lt;br /&amp;gt; &amp;amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;amp;gt;XFrame&amp;amp;lt;/type&amp;amp;gt; instance&amp;lt;br /&amp;gt; to which the toolbar controller belongs.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;CommandURL&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a string which specifies the command a &amp;lt;br /&amp;gt; statusbar controller is bound.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;ServiceManager&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; XMultiServiceFactory&amp;amp;lt;/type&amp;amp;gt; instance which can be used to &amp;lt;br /&amp;gt; create additional UNO services.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/ul&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::lang::XInitialization;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to notify an implementation that it needs to add its listener or &amp;lt;br /&amp;gt; remove and add them again.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; A status bar controller instance is ready for use after this call has &amp;lt;br /&amp;gt; been made the first time. The status bar implementation guarentees that &amp;lt;br /&amp;gt; the controller&amp;#039;s item window has been added to the status bar and its &amp;lt;br /&amp;gt; reference is held by it.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::util::XUpdatable;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** used to notify changed features and requests for additional user &amp;lt;br /&amp;gt; interface items.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Mostly used by a status bar implementation to forward information to &amp;lt;br /&amp;gt; and request services from a status bar controller component. This &amp;lt;br /&amp;gt; interface must be useable after &amp;lt;br /&amp;gt; &amp;amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;XInitialitation::initialize&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; has been called. The behavior of the interface is undefined if the &amp;lt;br /&amp;gt; controller component hasn&amp;#039;t been initialized.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusbarController;&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XStatusbarController : ::com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been pressed. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse has been moved. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been released. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aPos&amp;lt;br /&amp;gt; the current mouse position in pixel.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nCommand&amp;lt;br /&amp;gt; describes which command has been invoked.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param bMouseEvent&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the command is based on a mouse event, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aData&amp;lt;br /&amp;gt; for future use only.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void command( [in] ::com::sun::star::awt::Point aPos,&amp;lt;br /&amp;gt; [in] long nCommand,&amp;lt;br /&amp;gt; [in] boolean bMouseEvent,&amp;lt;br /&amp;gt; [in] any aData );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param xGraphics&amp;lt;br /&amp;gt; the current graphics which should be used for painting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param rOutputRectangle&amp;lt;br /&amp;gt; the output rectangle for graphic operations.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nItemId&amp;lt;br /&amp;gt; the item id of the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nStyle&amp;lt;br /&amp;gt; the style of the statusbar item. The controller should respect the provided&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;style when paints.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&amp;lt;br /&amp;gt; [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&amp;lt;br /&amp;gt; [in] long nItemId,&amp;lt;br /&amp;gt; [in] long nStyle );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user clicked with mouse into the &amp;lt;br /&amp;gt; field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user double-clicked with mouse &amp;lt;br /&amp;gt; into the field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusType&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusDBName&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:StatusbarLogo&amp;amp;lt;/value&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;value/&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; USHORT nSlotId;&amp;lt;br /&amp;gt; USHORT nId;&amp;lt;br /&amp;gt; StatusBar* pBar;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp;amp; aPos, &amp;lt;br /&amp;gt; ::sal_Int32 nCommand, &amp;lt;br /&amp;gt; ::sal_Bool bMouseEvent, &amp;lt;br /&amp;gt; const ::com::sun::star::uno::Any&amp;amp;amp; aData ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XGraphics &amp;amp;gt;&amp;amp;amp; xGraphics, &amp;lt;br /&amp;gt; const ::com::sun::star::awt::Rectangle&amp;amp;amp; rOutputRectangle, &amp;lt;br /&amp;gt; ::sal_Int32 nItemId, &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::sal_Int32 nStyle )&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Old sfx2 interface&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState,&amp;lt;br /&amp;gt; const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Command( const CommandEvent&amp;amp;amp; rCEvt );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonDown( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseMove( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonUp( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual void Paint( const UserDrawEvent &amp;amp;amp;rUDEvt );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp;amp; rBar );&amp;lt;br /&amp;gt; virtual ~SfxStatusBarControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; USHORT GetSlotId() const { return nSlotId; }&amp;lt;br /&amp;gt; USHORT GetId() const { return nId; }&amp;lt;br /&amp;gt; StatusBar&amp;amp;amp; GetStatusBar() const { return *pBar; }&amp;lt;br /&amp;gt; void CaptureMouse();&amp;lt;br /&amp;gt; void ReleaseMouse();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( bNotify &amp;amp;amp;&amp;amp;amp; pContnr )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::uno::Any aState;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( ( eState &amp;amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;amp;&amp;amp;amp; pState &amp;amp;amp;&amp;amp;amp; !IsInvalidItem( pState ) &amp;amp;amp;&amp;amp;amp; !pState-&amp;amp;gt;ISA(SfxVoidItem) )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Retrieve metric from pool to have correct sub ID when calling QueryValue&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;USHORT nSubId( 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// retrieve the core metric&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// it&amp;#039;s enough to check the objectshell, the only shell that does not &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt; &amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;// use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pSlotServ &amp;amp;amp;&amp;amp;amp; pDispatcher )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxShell* pShell = pDispatcher-&amp;amp;gt;GetShell( pSlotServ-&amp;amp;gt;GetShellLevel() );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pShell )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;eMapUnit = GetCoreMetric( pShell-&amp;amp;gt;GetPool(), nSID );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eMapUnit == SFX_MAPUNIT_TWIP )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nSubId |= CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;pState-&amp;amp;gt;QueryValue( aState, (BYTE)nSubId );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;else&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eState == SFX_ITEM_DONTCARE )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Use special uno struct to transport don&amp;#039;t care state&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::ItemStatus aItemStatus;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aState = makeAny( aItemStatus );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::FeatureStateEvent aEvent;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.FeatureURL = aDispatchURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Requery = sal_False;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.State = aState;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceIteratorHelper aIt( *pContnr );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;while&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( aIt.hasMoreElements() )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;try&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;amp;gt;statusChanged( aEvent );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;catch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( ::com::sun::star::uno::RuntimeException&amp;amp;amp; )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aIt.remove();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPUBLIC SfxPoolItem&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPool;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemDesruptor_Impl;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPoolCache;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemSet;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxVoidItem;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG nRefCount; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Referenzzaehler&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nWhich;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nKind;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;SetRefCount( ULONG n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetKind( USHORT n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG AddRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG ReleaseRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPRIVATE &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Delete_Impl(&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;*);&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;protected&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxPoolItem( USHORT nWhich = 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039; TYPEINFO();&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ~SfxPoolItem();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetWhich( USHORT nId ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT Which() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0);&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nWhich; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;==( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;!=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; rItem ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; !(*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;this&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; == rItem); }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper&amp;amp;amp; rIntlWrapper ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit eCoreMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit ePresentationMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; XubString &amp;amp;amp;rText,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper * pIntlWrapper = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetVersion( USHORT nFileFormatVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;ScaleMetrics( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lMult, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lDiv );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;HasMetrics() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL QueryValue( com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL PutValue( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 );&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Create( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SvStream&amp;amp;amp; Store( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG GetRefCount() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nRefCount; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetKind() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nKind; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readByteString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeByteString(SvStream &amp;amp;amp; rStream,UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString,&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; bUnicode);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// n.i.!!&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp;amp; rVal, BYTE nMemberId ) &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool bConvert = 0!=(nMemberId&amp;amp;amp;CONVERT_TWIPS);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nMemberId &amp;amp;amp;= ~CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;switch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( nMemberId )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// jetzt alles signed&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; 0:&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;rVal &amp;amp;lt;&amp;amp;lt;= aUpperLowerMarginScale;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropUpper; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropLower; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; sal_True;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137249</id>
		<title>Framework/Article/OpenOffice.org 2.0 User Interface Controller Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/OpenOffice.org_2.0_User_Interface_Controller_Internals&amp;diff=137249"/>
		<updated>2009-08-11T17:05:31Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: fix formatting of examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OpenOffice.org 2.0 User Interface Controller Internals =&lt;br /&gt;
&lt;br /&gt;
A typical OOo 2.0 document contains different user interface elements. They have to provide their functions to the user and display the current state of the document view.&lt;br /&gt;
&lt;br /&gt;
If you want to know about the different controller type then you should read the controller tutorials available in the [[Framework#Articles_.26_Tutorials|articles&amp;amp;tutorials chapter]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How and in which infrastructure do they work?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenOffice2UserInterfaceElements.png]]&lt;br /&gt;
&lt;br /&gt;
The user interface elements are using controllers for each of their elements to bind them to the dynamic state of the application module. It&amp;#039;s the responsibility of every user interface controller to call and to display the current state of its bound function.&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 uses the following user interface controllers:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
** Popup menu controller&lt;br /&gt;
** Generic menu item controller&lt;br /&gt;
** Internal menu controller&lt;br /&gt;
* Toolbar&lt;br /&gt;
** Generic toolbar item controller&lt;br /&gt;
** Specific toolbar item controller&lt;br /&gt;
* Statusbar&lt;br /&gt;
** Specific statusbar item controller&lt;br /&gt;
&lt;br /&gt;
== Menubar ==&lt;br /&gt;
&lt;br /&gt;
=== Generic menu item controller ===&lt;br /&gt;
&lt;br /&gt;
A normal menu item is controlled by a generic menu item controller. A menu bar of an application module uses for about 90% of its menu items generic item controllers. For example the Edit - Undo, Redo and Edit - Cut, Copy and Paste menu items are implemented using generic menu item controllers.&lt;br /&gt;
&lt;br /&gt;
A generic menu item controller supports the following interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
  /** is called when the status of the feature changes.&lt;br /&gt;
    @param State&lt;br /&gt;
  provides information about changes of the requested feature */&lt;br /&gt;
 [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the URL of the feature. */&lt;br /&gt;
  com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains a descriptor of the feature for the user interface.*/&lt;br /&gt;
  string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the feature is currently enabled or disabled. */&lt;br /&gt;
  boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&lt;br /&gt;
  boolean Requery;&lt;br /&gt;
&lt;br /&gt;
  //-------------------------------------------------------------------------&lt;br /&gt;
  /** contains the state of the feature in this dispatch.*/&lt;br /&gt;
  any State;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It supports the following generic functions by listing to status updates provided by function statusChanged.&amp;lt;br/&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item changes its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item checks or unchecks its menu item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item will be made visible or invisible, according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Menu item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Internal menu controller ===&lt;br /&gt;
&lt;br /&gt;
An Internal menu controllers is used for special menu items, like the window list (accessible via the Window popup menu). Internal menu controllers are completely responsible for their menu items. Currently there is no special menu controller which is implemented outside the framework library. There exists no UNO API to implement internal menu controllers.&lt;br /&gt;
&lt;br /&gt;
=== Popup menu controller ===&lt;br /&gt;
&lt;br /&gt;
A popup menu controller is a special menu controller which is responsible for a whole popup menu inside a menu bar. A popup menu controller must be a UNO service and registered in the configuration controller set, which can be found at org.openoffice.Office.UI.Controller/Registered/PopupMenu. The configuration set associates UNO service names implementing a popup menu controller with a command URL. The command URL is used by our XML based menu bar description. A popup menu controller is created by a popup menu controller factory which uses the configuration set to retrieve the correct service name and to initialize it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An abstract from the org.openoffice.Office.UI.Controller/Registered/PopupMenu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[xml]&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-data SYSTEM &amp;quot;../../../../../component-update.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;Controller&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;node oor:name=&amp;quot;Registered&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;PopupMenu&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;.uno:CharFontName&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value/&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;value&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/prop&amp;gt;&lt;br /&gt;
   &amp;lt;/node&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
A popup menu controller must support the following services / interfaces:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service PopupMenuController&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** supports functions to initialize and update a popup menu controller&lt;br /&gt;
    implementation.&lt;br /&gt;
&lt;br /&gt;
    A popup menu controller implementation gets initialized with a&lt;br /&gt;
    com::sun::star::awt::XPopupMenu object. This assures&lt;br /&gt;
    that a popup menu controller can be implemented with any UNO based&lt;br /&gt;
    language.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XPopupMenuController;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** provides functions to initialize a popup menu controller with&lt;br /&gt;
    specific data which are needed.&lt;br /&gt;
&lt;br /&gt;
    This interface should not directly used. A factory service is responsible to&lt;br /&gt;
    initialize every controller correctly.&lt;br /&gt;
    popup menu controller needs at least two additional arguments&lt;br /&gt;
    provided as com::sun::star::beans::PropertyValue.&lt;br /&gt;
&lt;br /&gt;
    Frame&lt;br /&gt;
    specifies the com::sun::star::frame::XFrame instance to which the &lt;br /&gt;
    popup menu controller belongs to.&lt;br /&gt;
&lt;br /&gt;
    CommandURL&lt;br /&gt;
    specifies which popup menu controller should be created.&lt;br /&gt;
&lt;br /&gt;
    @see PopupMenuControllerFactory&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------&lt;br /&gt;
/** used to brief the popup menu controller with new status information.&lt;br /&gt;
    A popup menu controller makes special functions available to users which &lt;br /&gt;
    normally depend on the state of other data. This interface is used to &lt;br /&gt;
    send this data to a controller implementation.&lt;br /&gt;
*/&lt;br /&gt;
interface com::sun::star::frame::XStatusListener;&amp;lt;br/&amp;gt;&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
interface XPopupMenuController : com::sun::star::uno::XInterface&lt;br /&gt;
&lt;br /&gt;
    /** provides a com::sun::star::awt::XPopupMenu to a popup menu &lt;br /&gt;
        controller implementation. The controller must fill this popup &lt;br /&gt;
        menu with its functions.&lt;br /&gt;
&lt;br /&gt;
        @param PopupMenu&lt;br /&gt;
        An empty popup menu that must be filled by the popup menu controller.&lt;br /&gt;
    */&lt;br /&gt;
    void setPopupMenu( [in] com::sun::star::awt::XPopupMenu PopupMenu );&lt;br /&gt;
&lt;br /&gt;
    /** briefs the popup menu controller to update the contents of &lt;br /&gt;
        the provided popup menu to reflect the current state. A &lt;br /&gt;
        controller should never update the popup menu structure &lt;br /&gt;
        on its own to prevent performance problems. A better way &lt;br /&gt;
        would be that a controller registers itself as status listener &lt;br /&gt;
        for a command URL and immediately deregister after that. &lt;br /&gt;
        Therefore status updates will not be send regularly for a &lt;br /&gt;
        non visible popup menu.&lt;br /&gt;
    */&lt;br /&gt;
    void updatePopupMenu();&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module lang {&lt;br /&gt;
&lt;br /&gt;
published interface XInitialization: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
    // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&lt;br /&gt;
    /** initializes the object. &lt;br /&gt;
        It should be called directly after the object has been created. &lt;br /&gt;
     */&lt;br /&gt;
    void initialize( [in] sequence&amp;lt; any &amp;gt; aArguments ) raises( com::sun::star::uno::Exception );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
        provides information about changes of the requested feature&lt;br /&gt;
     */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature.                                     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.         */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.      */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be re-queried.         */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.                  */&lt;br /&gt;
    any State;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework project provides a base class to implement popup menu controller easier. It can be found in &amp;#039;&amp;#039;framework/inc/helper/popupmenucontrollerbase.hxx&amp;#039;&amp;#039;. There are several implementations for popup menu controller in &amp;#039;&amp;#039;framework/source/uielement&amp;#039;&amp;#039; which uses the base class and can be used as templates.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently OOo 2.0 provides the following popup menu controllers:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
Command&lt;br /&gt;
! width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
Modules&lt;br /&gt;
! width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
Service&lt;br /&gt;
! width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
Purpose&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:CharFontName&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported fonts.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:FontHeight&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FontSizeMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported font sizes.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ObjectMenue&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ObjectMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all supported commands of an embedded object.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageHeader&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.HeaderMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert pages headers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:InsertPageFooter&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.FooterMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to insert page footers.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ChangeControlType&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ControlMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to change the control type of a selected form control.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AvailableToolbars&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.ToolBarsMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to show/hide toolbars.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:ScriptOrganizer&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.MacrosMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available scripting languages.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:RecentFileList&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.RecentFilesMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with recently opened files.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AddDirect&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu to create document for all available application modules.&amp;lt;/font&amp;gt;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;24%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;.uno:AutoPilotMenu&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;12%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;all&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;31%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;com.sun.star.comp.framework.NewMenuController&amp;lt;/font&amp;gt;&lt;br /&gt;
| width=&amp;quot;34%&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Provides a popup menu with all available wizards.&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The menu bar is completely controlled by an UNO implementations and is not based on any old sfx2 code. Therefor old sfx2 based and new non-sfx2 application modules are equally supported.&lt;br /&gt;
&lt;br /&gt;
== Toolbar ==&lt;br /&gt;
&lt;br /&gt;
=== Toolbar item controller ===&lt;br /&gt;
&lt;br /&gt;
Toolbar item controllers are responsible for a single toolbar button or toolbar item window (like a combobox, dropdown-box or an edit field). A toolbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
service ToolbarController&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** with this interface a component can receive events if a feature has &lt;br /&gt;
        changed. &lt;br /&gt;
        &lt;br /&gt;
        The toolbar controller implementation should register itself as a&lt;br /&gt;
        listener when its com::sun::star::util::XUpdatable interface has been called.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XStatusListener;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to initialize a component with required arguments.&lt;br /&gt;
        &lt;br /&gt;
        A toolbar controller needs at least three additional arguments provided as &lt;br /&gt;
        com::sun::star::beans::PropertyValue &lt;br /&gt;
&lt;br /&gt;
        Frame &lt;br /&gt;
        a com::sun::star::frame::XFrame instance to which the toolbar controller belongs.&lt;br /&gt;
&lt;br /&gt;
        CommandURL&lt;br /&gt;
        a string which specifies the command a toolbar controller is bound.&lt;br /&gt;
&lt;br /&gt;
        ServiceManager&lt;br /&gt;
        a com::sun::star::lang::XMultiServiceFactory instance which can be used to &lt;br /&gt;
        create additional UNO services.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::lang::XInitialization;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify an implementation that it needs to add its listener or remove &lt;br /&gt;
        and add them again.&lt;br /&gt;
&lt;br /&gt;
        A toolbar controller instance is ready for use after this call has been made &lt;br /&gt;
        the first time. The toolbar implementation guarantees that the controller&amp;#039;s &lt;br /&gt;
        item window has been added to the toolbar and its reference is held by it.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::util::XUpdatable;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify changed features and requests for additional user interface &lt;br /&gt;
        items.&lt;br /&gt;
&lt;br /&gt;
        Mostly used by a toolbar implementation to forward information to and request&lt;br /&gt;
        services from a toolbar controller component. This interface must be useable &lt;br /&gt;
        after com::sun::star::lang::XInitialitation::initialize has been called. The &lt;br /&gt;
        behavior of the interface is undefined if the controller component hasn&amp;#039;t been &lt;br /&gt;
        initialized.&lt;br /&gt;
    */&lt;br /&gt;
    interface com::sun::star::frame::XToolbarController;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** used to notify and retrieve information that are specific for sub-toolbar &lt;br /&gt;
        controllers.&lt;br /&gt;
&lt;br /&gt;
        Used by implementations that want to provide the toolbar button sub-toolbar &lt;br /&gt;
        function feature. A controller supporting this interface exchanges the &lt;br /&gt;
        function of its own toolbar button, that opened the sub-toolbar, with the &lt;br /&gt;
        one that has been selected on the sub-toolbar.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XSubToolbarController;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published interface XStatusListener: com::sun::star::lang::XEventListener&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** is called when the status of the feature changes.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param State&amp;lt;br /&amp;gt; provides information about changes of the requested feature&amp;lt;br /&amp;gt; */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; [oneway] void statusChanged( [in] FeatureStateEvent State );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;published struct FeatureStateEvent: com::sun::star::lang::EventObject&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the URL of the feature. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; com::sun::star::util::URL FeatureURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains a descriptor of the feature for the user interface.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; string FeatureDescriptor;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the feature is currently enabled or disabled. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean IsEnabled;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** specifies whether the &amp;amp;lt;type&amp;amp;gt;XDispatch&amp;amp;lt;/type&amp;amp;gt; has to be requeried. */&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; boolean Requery;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; //-------------------------------------------------------------------------&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; /** contains the state of the feature in this dispatch.*/&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; any State;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides a function to execute the command which is bound to the toolbar controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param &amp;lt;br /&amp;gt; a combination of &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;KeyModifier&amp;amp;lt;/type&amp;amp;gt; value that represent the current state of the modifier keys.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; This function is usally called by a toolbar implementation when a user clicked on a toolbar button or pressed enter on the keyboard when the item has the input focus.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void execute( [in] short KeyModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a single click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** notifies a component that a double click has been made on the toolbar item.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create a popup window for additional functions.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which provides additional functions to the user. The reference must be empty if component does not want to provide a separate window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createPopupWindow();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** requests to create an item window which can be added to the toolbar.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param Parent&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which must be used as a parent for the requested item window.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; a &amp;amp;lt;type scope=&amp;quot;com::sun::star::awt&amp;quot;&amp;amp;gt;XWindow&amp;amp;lt;/type&amp;amp;gt; which can be added to a toolbar. The reference must be empty if a component does not want to provide an item window.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; com::sun::star::awt::XWindow createItemWindow( [in] com::sun::star::awt::XWindow Parent );&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XSubToolbarController : com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** if the controller features a sub-toolbar. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the controller offers a sub toolbar, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Enables implementations to dynamically decide to support sub-toolbars&amp;lt;br /&amp;gt; or not.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean opensSubToolbar();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** provides the resource URL of the sub-toolbar this controller opens.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; name of the sub-toolbar this controller offers. A empty string &amp;lt;br /&amp;gt; will be interpreted as if this controller offers no sub-toolbar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; string getSubToolbarName();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that a sub-toolbar function has been &amp;lt;br /&amp;gt; selected.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aCommand&amp;lt;br /&amp;gt; a string which identifies the function that has been selected by&amp;lt;br /&amp;gt; a user.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void functionSelected( [in] string aCommand );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** gets called to notify a controller that it should set an image which&amp;lt;br /&amp;gt; represents the current selected function.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Only the controller instance is able to set the correct image for the&amp;lt;br /&amp;gt; current function. A toolbar implementation will ask sub-toolbar &amp;lt;br /&amp;gt; controllers to update their image whenever it has to update the images&amp;lt;br /&amp;gt; of all its buttons.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void updateImage();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Albany, serif&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;Generic toolbar item controller&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
A generic toolbar item controller is used by toolbar implementation for simple toolbar buttons. Normally most items of a toolbar consists of generic toolbar item controllers. They support the following generic functions by listening to status updates provided by the application module controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
String / SfxStringItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item changes its quick help and its label to the content of the provided string.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item, according to the boolean value.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item will be made visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is set to normal or tri-state according to the provided member ItemStatus.State (see &amp;lt;span style=&amp;quot;font-weight: medium&amp;quot;&amp;gt;&amp;#039;&amp;#039;dont_care&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; value in com.sun.star.frame.status.ItemState)&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item is enabled or disabled according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generic toolbar item controllers are not able to support the creation of sub-toolbars or floating windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specific toolbar item controllers ===&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers are much more flexible and can support the creation of sub-toolbars or floating windows. As they are much more powerful they have sole responsibility to react correctly on status updates received by the application module controller.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
! width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
Variable&lt;br /&gt;
! width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
UNO Type/Poolitem&lt;br /&gt;
! width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Action required&lt;br /&gt;
 |- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean / SfxBoolItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item checks or unchecks its item according to the boolean value, if this makes sense in the context.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.VisibilityItem / SfxVisibilityItem&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should make itself visible or invisible according to the provided state.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
State&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
com.sun.star.frame.status.ItemStatus ( Will be directly retrieved with Dispatcher-&amp;amp;gt;QueryState(...) or transported by SfxItemState ).&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item should set itself to normal or tri-state according to the provided member ItemStatus.State. It depends on the specific toolbar item if this makes sense.&lt;br /&gt;
|- valign=&amp;quot;TOP&amp;quot;&lt;br /&gt;
| width=&amp;quot;15%&amp;quot; |&lt;br /&gt;
IsEnabled&lt;br /&gt;
| width=&amp;quot;42%&amp;quot; |&lt;br /&gt;
Boolean&lt;br /&gt;
| width=&amp;quot;43%&amp;quot; |&lt;br /&gt;
Toolbar item must enabled or disabled itself according to the value of IsEnabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific toolbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Toolbar when they are implemented via an UNO service.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific toolbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;ToolBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBNewForm&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:Refresh&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationToolboxController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework provides a base class which makes it much easier to implement UNO based specific toolbar item controllers. It can be found in svtools/inc/toolboxcontroller.hxx.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific toolbar item controllers are registered by calling &amp;#039;&amp;#039;ToolbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special toolbar controller factory to create instances of sfx2 based specific toolbar item controllers. Sfx2 based specific toolbar controllers can use the known base class sfx2/inc/tbxctrl.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based toolbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxToolBoxControl:&amp;lt;br /&amp;gt; public ::com::sun::star::awt::XDockableWindowListener,&amp;lt;br /&amp;gt; public ::com::sun::star::frame::XSubToolbarController,&amp;lt;br /&amp;gt; public svt::ToolboxController &amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt;friend class SfxToolbox;&amp;lt;br /&amp;gt;friend class SfxToolBox_Impl;&amp;lt;br /&amp;gt;friend class SfxToolboxCustomizer;&amp;lt;br /&amp;gt;friend class SfxPopupWindow;&amp;lt;br /&amp;gt;friend struct SfxTbxCtrlFactory;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl_Impl* pImpl;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; DECL_LINK( PopupModeEndHdl, void * );&amp;lt;br /&amp;gt; DECL_LINK( ClosePopupWindow, SfxPopupWindow * );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // old SfxToolBoxControl methods&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Select( BOOL bMod1 = FALSE );&amp;lt;br /&amp;gt; virtual void Select( USHORT nModifier );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual SfxPopupWindowType GetPopupWindowType() const;&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindow();&amp;lt;br /&amp;gt; virtual SfxPopupWindow* CreatePopupWindowCascading();&amp;lt;br /&amp;gt; virtual Window* CreateItemWindow( Window *pParent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Must be called by subclass to set a new popup window instance&amp;lt;br /&amp;gt; void SetPopupWindow( SfxPopupWindow* pWindow );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XToolbarController&amp;lt;br /&amp;gt; virtual void SAL_CALL execute( sal_Int16 KeyModifier ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createPopupWindow() &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt; SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XWindow &amp;amp;gt;&amp;amp;amp; rParent ) &amp;lt;br /&amp;gt; throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XSubToolbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL functionSelected( const ::rtl::OUString&amp;amp;amp; aCommand ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XDockableWindowListener&amp;lt;br /&amp;gt; virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException); &amp;lt;br /&amp;gt; virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent&amp;amp;amp; e ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // helper methods&amp;lt;br /&amp;gt; void createAndPositionSubToolBar( const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt; ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XFrame &amp;amp;gt;&amp;amp;amp; xFrame, const ::rtl::OUString&amp;amp;amp; rSubToolBarResName );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SFX_DECL_TOOLBOX_CONTROL();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; SfxToolBoxControl( USHORT nSlotID, USHORT nId, ToolBox&amp;amp;amp; rBox, BOOL bShowStrings = FALSE );&amp;lt;br /&amp;gt; virtual ~SfxToolBoxControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; ToolBox&amp;amp;amp; GetToolBox() const;&amp;lt;br /&amp;gt; unsigned short GetId() const;&amp;lt;br /&amp;gt; unsigned short GetSlotId() const;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; const ::rtl::OUString&amp;amp;amp; aCommand, &amp;lt;br /&amp;gt; ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt; static void Dispatch( &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::frame::XDispatchProvider &amp;amp;gt;&amp;amp;amp; rDispatchProvider, const rtl::OUString&amp;amp;amp; rCommand, ::com::sun::star::uno::Sequence&amp;amp;lt; ::com::sun::star::beans::PropertyValue &amp;amp;gt;&amp;amp;amp; aArgs );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxItemState GetItemState( const SfxPoolItem* pState );&amp;lt;br /&amp;gt; static SfxToolBoxControl* CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule *pMod );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Statusbar ==&lt;br /&gt;
&lt;br /&gt;
=== Specific statusbar item controller ===&lt;br /&gt;
&lt;br /&gt;
The statusbar implementation only supports specific statusbar item controllers. There are no generic statusbar item controllers which could provide generic functions.&lt;br /&gt;
&lt;br /&gt;
A statusbar item controller must support the following services and interfaces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;service StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** with this interface a component can receive events if a feature has &amp;lt;br /&amp;gt; changed.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; The statusbar controller implementation should register itself as a &amp;lt;br /&amp;gt; listener when its &amp;amp;lt;member scope=&amp;quot;com::sun::star::util&amp;quot;&amp;amp;gt;XUpdatable&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; interface has been called.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusListener;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to initialize a component with required arguments.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;b&amp;amp;gt;A statusbar controller needs at least three additional arguments &amp;lt;br /&amp;gt; provided as &amp;amp;lt;type scope=&amp;quot;com::sun::star::beans&amp;quot;&amp;amp;gt;PropertyValue&amp;amp;lt;/type&amp;amp;gt;:&amp;lt;br /&amp;gt; &amp;amp;lt;ul&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Frame&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;lt;br /&amp;gt; &amp;amp;lt;type scope=&amp;quot;com::sun::star::frame&amp;quot;&amp;amp;gt;XFrame&amp;amp;lt;/type&amp;amp;gt; instance&amp;lt;br /&amp;gt; to which the toolbar controller belongs.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;CommandURL&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a string which specifies the command a &amp;lt;br /&amp;gt; statusbar controller is bound.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;li&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;ServiceManager&amp;amp;lt;/b&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;a &amp;amp;lt;type scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; XMultiServiceFactory&amp;amp;lt;/type&amp;amp;gt; instance which can be used to &amp;lt;br /&amp;gt; create additional UNO services.&amp;amp;lt;/li&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/ul&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::lang::XInitialization;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; /** used to notify an implementation that it needs to add its listener or &amp;lt;br /&amp;gt; remove and add them again.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; A status bar controller instance is ready for use after this call has &amp;lt;br /&amp;gt; been made the first time. The status bar implementation guarentees that &amp;lt;br /&amp;gt; the controller&amp;#039;s item window has been added to the status bar and its &amp;lt;br /&amp;gt; reference is held by it.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::util::XUpdatable;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** used to notify changed features and requests for additional user &amp;lt;br /&amp;gt; interface items.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;&amp;lt;br /&amp;gt; Mostly used by a status bar implementation to forward information to &amp;lt;br /&amp;gt; and request services from a status bar controller component. This &amp;lt;br /&amp;gt; interface must be useable after &amp;lt;br /&amp;gt; &amp;amp;lt;member scope=&amp;quot;com::sun::star::lang&amp;quot;&amp;amp;gt;XInitialitation::initialize&amp;amp;lt;/member&amp;amp;gt; &amp;lt;br /&amp;gt; has been called. The behavior of the interface is undefined if the &amp;lt;br /&amp;gt; controller component hasn&amp;#039;t been initialized.&amp;lt;br /&amp;gt; &amp;amp;lt;/p&amp;amp;gt;&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; interface com::sun::star::frame::XStatusbarController;&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; }; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame { &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
published interface XStatusListener: com::sun::star::lang::XEventListener&lt;br /&gt;
{&lt;br /&gt;
    /** is called when the status of the feature changes.&lt;br /&gt;
        &lt;br /&gt;
        @param State&lt;br /&gt;
         provides information about changes of the requested feature&lt;br /&gt;
    */&lt;br /&gt;
    [oneway] void statusChanged( [in] FeatureStateEvent State );&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
published struct FeatureStateEvent: com::sun::star::lang::EventObject&lt;br /&gt;
{&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the URL of the feature. &lt;br /&gt;
     */&lt;br /&gt;
    com::sun::star::util::URL FeatureURL;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains a descriptor of the feature for the user interface.&lt;br /&gt;
     */&lt;br /&gt;
    string FeatureDescriptor;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the feature is currently enabled or disabled.&lt;br /&gt;
    */&lt;br /&gt;
    boolean IsEnabled;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** specifies whether the XDispatch object has to be requeried.&lt;br /&gt;
     */&lt;br /&gt;
    boolean Requery;&lt;br /&gt;
&lt;br /&gt;
    //-------------------------------------------------------------------------&lt;br /&gt;
    /** contains the state of the feature in this dispatch.&lt;br /&gt;
     */&lt;br /&gt;
    any State;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module lang { &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XInitialization: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{ &amp;lt;br /&amp;gt; // DocMerge from xml: method com::sun::star::lang::XInitialization::initialize&amp;lt;br /&amp;gt; /** initializes the object. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;p&amp;amp;gt;It should be called directly after the object is created.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void initialize( [in] sequence&amp;amp;lt;any&amp;amp;gt; aArguments ) &amp;lt;br /&amp;gt; raises( com::sun::star::uno::Exception );&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//============================================================================= &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module util {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;published interface XUpdatable: com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //-------------------------------------------------------------------------&amp;lt;br /&amp;gt; /** refreshes the data of the object from the connected data source. */&amp;lt;br /&amp;gt; void update();&amp;lt;br /&amp;gt;};&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;//=============================================================================&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;module com { module sun { module star { module frame {&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;interface XStatusbarController : ::com::sun::star::uno::XInterface&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been pressed. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonDown( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse has been moved. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseMove( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the mouse position is within the controller &amp;lt;br /&amp;gt; and a mouse button has been released. If the controller has captured the &amp;lt;br /&amp;gt; mouse input this function is also called when the mouse position is not &amp;lt;br /&amp;gt; within the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aMouseEvent&amp;lt;br /&amp;gt; current information about the mouse pointer.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @return&amp;lt;br /&amp;gt; return &amp;amp;lt;TRUE/&amp;amp;gt; if the event should not be processed and &amp;amp;lt;FALSE/&amp;amp;gt; &amp;lt;br /&amp;gt; if the event should be processed by the status bar.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; boolean mouseButtonUp( [in] ::com::sun::star::awt::MouseEvent aMouseEvent );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aPos&amp;lt;br /&amp;gt; the current mouse position in pixel.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nCommand&amp;lt;br /&amp;gt; describes which command has been invoked.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param bMouseEvent&amp;lt;br /&amp;gt; &amp;amp;lt;TRUE/&amp;amp;gt; if the command is based on a mouse event, otherwise &amp;amp;lt;FALSE/&amp;amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param aData&amp;lt;br /&amp;gt; for future use only.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void command( [in] ::com::sun::star::awt::Point aPos,&amp;lt;br /&amp;gt; [in] long nCommand,&amp;lt;br /&amp;gt; [in] boolean bMouseEvent,&amp;lt;br /&amp;gt; [in] any aData );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if a command event is available for a controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param xGraphics&amp;lt;br /&amp;gt; the current graphics which should be used for painting.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param rOutputRectangle&amp;lt;br /&amp;gt; the output rectangle for graphic operations.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nItemId&amp;lt;br /&amp;gt; the item id of the controller.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; @param nStyle&amp;lt;br /&amp;gt; the style of the statusbar item. The controller should respect the provided&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;style when paints.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void paint( [in] ::com::sun::star::awt::XGraphics xGraphics,&amp;lt;br /&amp;gt; [in] ::com::sun::star::awt::Rectangle rOutputRectangle,&amp;lt;br /&amp;gt; [in] long nItemId,&amp;lt;br /&amp;gt; [in] long nStyle );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user clicked with mouse into the &amp;lt;br /&amp;gt; field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void click();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; //=============================================================================&amp;lt;br /&amp;gt; /** is called by a status bar if the user double-clicked with mouse &amp;lt;br /&amp;gt; into the field of the corresponding control.&amp;lt;br /&amp;gt; */&amp;lt;br /&amp;gt; void doubleClick();&amp;lt;br /&amp;gt;}; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;}; }; }; };&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OOo 2.0 supports two kind of specific statusbar item controllers. UNO based specific statusbar item controllers must be registered in the configuration set org.openoffice.Office.UI.Controller/Registered/Statusbar.&lt;br /&gt;
&lt;br /&gt;
An abstract from the Controller.xcu with registered specific statusbar item controllers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;node oor:name=&amp;quot;StatusBar&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c1&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusType&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c2&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:DBStatusDBName&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.OfficeDatabaseDocument&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.sdb.ApplicationStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;node oor:name=&amp;quot;c5&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Command&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;.uno:StatusbarLogo&amp;amp;lt;/value&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Module&amp;quot;&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;lt;value/&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;prop oor:name=&amp;quot;Controller&amp;quot;&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;value&amp;amp;gt;com.sun.star.comp.framework.LogoImageStatusbarController&amp;amp;lt;/value&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/prop&amp;amp;gt;&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt; ...&amp;lt;br /&amp;gt; &amp;amp;lt;/node&amp;amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The framework library provides a base class in svtools/inc/statusbarcontroller.hxx which makes it simpler to implement a UNO based specific status bar controller.&lt;br /&gt;
&lt;br /&gt;
The sfx2 based specific statusbar item controllers are registered by calling &amp;#039;&amp;#039;StatusbarControllerClass&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;::RegisterControl(SlotID, SfxModule* ). The framework implementation uses a special statusbar controller factory to create instances of sfx2 based specific statusbar item controllers. Sfx2 based specific statusbar controllers can use the known base class sfx2/inc/stbitem.hxx. It&amp;#039;s a special wrapper which converts calls to the its UNO interfaces to the needs of sfx2 based statusbar controllers.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt; USHORT nSlotId;&amp;lt;br /&amp;gt; USHORT nId;&amp;lt;br /&amp;gt; StatusBar* pBar;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;protected:&amp;lt;br /&amp;gt; // new controller API&amp;lt;br /&amp;gt; // XInterface&amp;lt;br /&amp;gt; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type &amp;amp;amp; rType ) throw(::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL acquire() throw();&amp;lt;br /&amp;gt; virtual void SAL_CALL release() throw();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XEventListener&amp;lt;br /&amp;gt; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject&amp;amp;amp; aEvent ) throw( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XComponent&amp;lt;br /&amp;gt; virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusListener&amp;lt;br /&amp;gt; virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent&amp;amp;amp; Event ) throw ( ::com::sun::star::uno::RuntimeException );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // XStatusbarController&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent&amp;amp;amp; aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL command( const ::com::sun::star::awt::Point&amp;amp;amp; aPos, &amp;lt;br /&amp;gt; ::sal_Int32 nCommand, &amp;lt;br /&amp;gt; ::sal_Bool bMouseEvent, &amp;lt;br /&amp;gt; const ::com::sun::star::uno::Any&amp;amp;amp; aData ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference&amp;amp;lt; ::com::sun::star::awt::XGraphics &amp;amp;gt;&amp;amp;amp; xGraphics, &amp;lt;br /&amp;gt; const ::com::sun::star::awt::Rectangle&amp;amp;amp; rOutputRectangle, &amp;lt;br /&amp;gt; ::sal_Int32 nItemId, &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::sal_Int32 nStyle )&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 9pt&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt; virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; // Old sfx2 interface&amp;lt;br /&amp;gt; virtual void StateChanged( USHORT nSID, SfxItemState eState,&amp;lt;br /&amp;gt; const SfxPoolItem* pState );&amp;lt;br /&amp;gt; virtual void Click();&amp;lt;br /&amp;gt; virtual void DoubleClick();&amp;lt;br /&amp;gt; virtual void Command( const CommandEvent&amp;amp;amp; rCEvt );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonDown( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseMove( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual BOOL MouseButtonUp( const MouseEvent &amp;amp;amp; );&amp;lt;br /&amp;gt; virtual void Paint( const UserDrawEvent &amp;amp;amp;rUDEvt );&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static USHORT convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons ); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;public:&amp;lt;br /&amp;gt; SfxStatusBarControl( USHORT nSlotID, USHORT nId, StatusBar&amp;amp;amp; rBar );&amp;lt;br /&amp;gt; virtual ~SfxStatusBarControl();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; USHORT GetSlotId() const { return nSlotId; }&amp;lt;br /&amp;gt; USHORT GetId() const { return nId; }&amp;lt;br /&amp;gt; StatusBar&amp;amp;amp; GetStatusBar() const { return *pBar; }&amp;lt;br /&amp;gt; void CaptureMouse();&amp;lt;br /&amp;gt; void ReleaseMouse();&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; static SfxStatusBarControl* CreateControl( USHORT nSlotID, USHORT nId, StatusBar *pBar, SfxModule* );&amp;lt;br /&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User interface controllers in the mixed sfx2/uno environment=&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in a pure UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentPureUnoUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
==How user interface controllers work in our mixed sfx2/UNO based environment?==&lt;br /&gt;
&lt;br /&gt;
[[Image:EnvironmentUserInterfaceController.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s see what happens in more detail, especially when we switch from one layer to another one.&lt;br /&gt;
&lt;br /&gt;
# A shell wants to invalidate a slot and calls SfxShell::Invalidate( SlotID ).&lt;br /&gt;
# The bindings updates the SfxStateCache for the provided slot ID normally through a update timer or directly.&lt;br /&gt;
# The SfxStateCache calls StateChanged with the new state on a SfxDispatchController_Impl object.&lt;br /&gt;
# The SfxDispatchController_Impl now maps the sfx2 state information based on SfxPoolItem to UNO information and sends them to UNO based toolbar controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceContainerHelper* pContnr = pDispatch-&amp;amp;gt;GetListeners().getContainer( aDispatchURL.Complete );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( bNotify &amp;amp;amp;&amp;amp;amp; pContnr )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::uno::Any aState;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( ( eState &amp;amp;gt;= SFX_ITEM_AVAILABLE ) &amp;amp;amp;&amp;amp;amp; pState &amp;amp;amp;&amp;amp;amp; !IsInvalidItem( pState ) &amp;amp;amp;&amp;amp;amp; !pState-&amp;amp;gt;ISA(SfxVoidItem) )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Retrieve metric from pool to have correct sub ID when calling QueryValue&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;USHORT nSubId( 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxMapUnit eMapUnit( SFX_MAPUNIT_100TH_MM );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// retrieve the core metric&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// it&amp;#039;s enough to check the objectshell, the only shell that does not &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt; &amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;// use the pool of the document is SfxViewFrame, but it hasn&amp;#039;t any metric parameters&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pSlotServ &amp;amp;amp;&amp;amp;amp; pDispatcher )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;SfxShell* pShell = pDispatcher-&amp;amp;gt;GetShell( pSlotServ-&amp;amp;gt;GetShellLevel() );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;DBG_ASSERT( pShell, &amp;quot;Can&amp;#039;t get core metric without shell!&amp;quot; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( pShell )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;eMapUnit = GetCoreMetric( pShell-&amp;amp;gt;GetPool(), nSID );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eMapUnit == SFX_MAPUNIT_TWIP )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nSubId |= CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;pState-&amp;amp;gt;QueryValue( aState, (BYTE)nSubId );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;else&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ( eState == SFX_ITEM_DONTCARE )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Use special uno struct to transport don&amp;#039;t care state&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::ItemStatus aItemStatus;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aItemStatus.State = ::com::sun::star::frame::status::ItemState::dont_care;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aState = makeAny( aItemStatus );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::FeatureStateEvent aEvent;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.FeatureURL = aDispatchURL;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.Requery = sal_False;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aEvent.State = aState;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::cppu::OInterfaceIteratorHelper aIt( *pContnr );&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;while&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( aIt.hasMoreElements() )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;try&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;((::com::sun::star::frame::XStatusListener *)aIt.next())-&amp;amp;gt;statusChanged( aEvent );&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;catch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( ::com::sun::star::uno::RuntimeException&amp;amp;amp; )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aIt.remove();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How does QueryValue work and convert an item to UNO com::sun::star::uno::any?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the base class of any pool item in &amp;#039;&amp;#039;svtools/inc/poolitem.hxx&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPUBLIC SfxPoolItem&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPool;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemDesruptor_Impl;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPoolCache;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemSet;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;friend&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxVoidItem;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG nRefCount; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// Referenzzaehler&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nWhich;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; USHORT nKind;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;SetRefCount( ULONG n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetKind( USHORT n );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG AddRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG ReleaseRef( ULONG n = 1 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SVL_DLLPRIVATE &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Delete_Impl(&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;*);&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;protected&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxPoolItem( USHORT nWhich = 0 );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;public&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039; TYPEINFO();&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ~SfxPoolItem();&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SetWhich( USHORT nId ) &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT Which() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;DBG_CHKTHIS(SfxPoolItem, 0);&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nWhich; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;==( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;!=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; rItem ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; !(*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;this&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; == rItem); }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;Compare( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem &amp;amp;amp;rWith, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper&amp;amp;amp; rIntlWrapper ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit eCoreMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; SfxMapUnit ePresentationMetric,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt; XubString &amp;amp;amp;rText,&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; IntlWrapper * pIntlWrapper = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetVersion( USHORT nFileFormatVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;ScaleMetrics( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lMult, &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;long&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; lDiv );&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;int &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;HasMetrics() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL QueryValue( com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; BOOL PutValue( &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; com::sun::star::uno::Any&amp;amp;amp; rVal, BYTE nMemberId = 0 );&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Create( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SvStream&amp;amp;amp; Store( SvStream &amp;amp;amp;, USHORT nItemVersion ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;virtual&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; = 0;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; ULONG GetRefCount() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nRefCount; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;inline&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; USHORT GetKind() &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; { &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; nKind; }&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readByteString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeByteString(SvStream &amp;amp;amp; rStream,UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; readUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;amp;amp; rString,&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;bool&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; bUnicode);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;static&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;void&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; writeUnicodeString(SvStream &amp;amp;amp; rStream, UniString &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;amp;amp; rString);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;private&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;operator&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;=( &amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; SfxPoolItem&amp;amp;amp; ); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// n.i.!!&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;};&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A example how to implement QueryValue can be found in the implementation of the SvxULSpaceItem (located in svx/source/items/frmitems.cxx).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool SvxULSpaceItem::QueryValue( uno::Any&amp;amp;amp; rVal, BYTE nMemberId ) &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;const&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;sal_Bool bConvert = 0!=(nMemberId&amp;amp;amp;CONVERT_TWIPS);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;nMemberId &amp;amp;amp;= ~CONVERT_TWIPS;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;switch&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;( nMemberId )&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;// jetzt alles signed&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; 0:&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nPropUpper);&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;rVal &amp;amp;lt;&amp;amp;lt;= aUpperLowerMarginScale;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nUpper) : nUpper); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLower) : nLower); &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_UP_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropUpper; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;case&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; MID_LO_REL_MARGIN: rVal &amp;amp;lt;&amp;amp;lt;= (sal_Int16) nPropLower; &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;break&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; &amp;lt;/font&amp;gt;&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#000000&amp;quot;&amp;gt; sal_True;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&amp;quot;Courier New, monospace&amp;quot;&amp;gt;&amp;lt;font style=&amp;quot;font-size: 8pt&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# The UNO based toolbar controller now has to convert the state information (com::sun::star::uno::Any) again to provide it in a format that the sfx2 based toolbar controller implementation knows (SfxPoolItem).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
// XStatusListener &lt;br /&gt;
&lt;br /&gt;
void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent&amp;amp; rEvent ) &lt;br /&gt;
throw ( ::com::sun::star::uno::RuntimeException ) &lt;br /&gt;
{ &lt;br /&gt;
    SfxViewFrame* pViewFrame = NULL; &lt;br /&gt;
    Reference &amp;lt; XController &amp;gt; xController; &lt;br /&gt;
&lt;br /&gt;
    ::vos::OGuard aGuard( Application::GetSolarMutex() ); &lt;br /&gt;
    if ( getFrameInterface().is() ) &lt;br /&gt;
        xController = getFrameInterface()-&amp;gt;getController(); &lt;br /&gt;
&lt;br /&gt;
    Reference &amp;lt; XDispatchProvider &amp;gt; xProvider( xController, UNO_QUERY ); &lt;br /&gt;
    if ( xProvider.is() ) &lt;br /&gt;
    { &lt;br /&gt;
        Reference &amp;lt; XDispatch &amp;gt; xDisp = xProvider-&amp;gt;queryDispatch( &lt;br /&gt;
            rEvent.FeatureURL, ::rtl::OUString(), 0 ); &lt;br /&gt;
        if ( xDisp.is() ) &lt;br /&gt;
        { &lt;br /&gt;
            Reference&amp;lt; XUnoTunnel &amp;gt; xTunnel( xDisp, UNO_QUERY ); &lt;br /&gt;
            SfxOfficeDispatch* pDisp = NULL; &lt;br /&gt;
            if ( xTunnel.is() ) &lt;br /&gt;
            { &lt;br /&gt;
                sal_Int64 nImplementation = xTunnel&amp;gt;getSomething &lt;br /&gt;
                SfxOfficeDispatch::impl_getStaticIdentifier() ); &lt;br /&gt;
                pDisp = (SfxOfficeDispatch*)(nImplementation); &lt;br /&gt;
            } &lt;br /&gt;
&lt;br /&gt;
            if ( pDisp ) &lt;br /&gt;
                pViewFrame = pDisp-&amp;gt;GetDispatcher_Impl()-&amp;gt;GetFrame(); &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
    USHORT nSlotId = 0; &lt;br /&gt;
    SfxSlotPool&amp;amp; rPool = SFX_APP()-&amp;gt;GetSlotPool( pViewFrame ); &lt;br /&gt;
    const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path ); &lt;br /&gt;
    if ( pSlot ) &lt;br /&gt;
        nSlotId = pSlot-&amp;gt;GetSlotId(); &lt;br /&gt;
&lt;br /&gt;
    if ( nSlotId &amp;gt; 0 ) &lt;br /&gt;
    { &lt;br /&gt;
        if ( rEvent.Requery ) &lt;br /&gt;
            svt::ToolboxController::statusChanged( rEvent ); &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            SfxItemState eState = SFX_ITEM_DISABLED; &lt;br /&gt;
            SfxPoolItem* pItem = NULL; &lt;br /&gt;
            &lt;br /&gt;
            if ( rEvent.IsEnabled ) &lt;br /&gt;
            { &lt;br /&gt;
                eState = SFX_ITEM_AVAILABLE; &lt;br /&gt;
                ::com::sun::star::uno::Type pType = rEvent.State.getValueType(); &lt;br /&gt;
&lt;br /&gt;
                if ( pType == ::getVoidCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                    eState = SFX_ITEM_UNKNOWN; &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getBooleanCppuType() ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_Bool bTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= bTemp ; &lt;br /&gt;
                    pItem = new SfxBoolItem( nSlotId, bTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt16*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt16 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt16Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const sal_uInt32*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    sal_uInt32 nTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= nTemp ; &lt;br /&gt;
                    pItem = new SfxUInt32Item( nSlotId, nTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType((const ::rtl::OUString*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ::rtl::OUString sTemp ; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= sTemp ; &lt;br /&gt;
                    pItem = new SfxStringItem( nSlotId, sTemp ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::ItemStatus* )0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    ItemStatus aItemStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aItemStatus; &lt;br /&gt;
                    eState = aItemStatus.State; &lt;br /&gt;
                    pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
                else if ( pType == ::getCppuType(( const &lt;br /&gt;
                    ::com::sun::star::frame::status::Visibility*)0) ) &lt;br /&gt;
                { &lt;br /&gt;
                    Visibility aVisibilityStatus; &lt;br /&gt;
                    rEvent.State &amp;gt;&amp;gt;= aVisibilityStatus; &lt;br /&gt;
                    pItem = new SfxVisibilityItem( nSlotId, aVisibilityStatus.bVisible ); &lt;br /&gt;
                } &lt;br /&gt;
                else &lt;br /&gt;
                { &lt;br /&gt;
                    if ( pSlot ) &lt;br /&gt;
                        pItem = pSlot-&amp;gt;GetType()-&amp;gt;CreateItem(); &lt;br /&gt;
                    if ( pItem ) &lt;br /&gt;
                    { &lt;br /&gt;
                        pItem-&amp;gt;SetWhich( nSlotId ); &lt;br /&gt;
                        pItem-&amp;gt;PutValue( rEvent.State ); &lt;br /&gt;
                    } &lt;br /&gt;
                    else &lt;br /&gt;
                        pItem = new SfxVoidItem( nSlotId ); &lt;br /&gt;
                } &lt;br /&gt;
           } &lt;br /&gt;
&lt;br /&gt;
           StateChanged( nSlotId, eState, pItem ); &lt;br /&gt;
           delete pItem; &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the implementation retrieves the type of the slot and creates an empty item of that type. Now it has to use PutValue to convert the UNO com::sun::star::uno::Any back to an item. Let&amp;#039;s see how the SvxULSpaceItem implements PutValue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
sal_Bool SvxULSpaceItem::PutValue( const uno::Any&amp;amp; rVal, BYTE nMemberId ) &lt;br /&gt;
{ &lt;br /&gt;
    sal_Bool bConvert = 0!=(nMemberId&amp;amp;CONVERT_TWIPS); &lt;br /&gt;
    nMemberId &amp;amp;= ~CONVERT_TWIPS; &lt;br /&gt;
    &lt;br /&gt;
    sal_Int32 nVal; &lt;br /&gt;
    switch( nMemberId ) &lt;br /&gt;
    { &lt;br /&gt;
        case 0: &lt;br /&gt;
        { &lt;br /&gt;
            ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; &lt;br /&gt;
            if ( !(rVal &amp;gt;&amp;gt;= aUpperLowerMarginScale )) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            else &lt;br /&gt;
            { &lt;br /&gt;
                SetUpper((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper)); &lt;br /&gt;
                SetLower((sal_uInt16)(bConvert ? &lt;br /&gt;
                    MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower)); &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleUpper &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleUpper; &lt;br /&gt;
                if( aUpperLowerMarginScale.ScaleLower &amp;gt; 1 ) &lt;br /&gt;
                    nPropUpper = aUpperLowerMarginScale.ScaleLower; &lt;br /&gt;
            } &lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        case MID_UP_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetUpper((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_LO_MARGIN : &lt;br /&gt;
            if(!(rVal &amp;gt;&amp;gt;= nVal) || nVal &amp;lt; 0) &lt;br /&gt;
                return sal_False; &lt;br /&gt;
            SetLower((sal_uInt16)bConvert ? MM100_TO_TWIP(nVal) : nVal); &lt;br /&gt;
            break; &lt;br /&gt;
&lt;br /&gt;
         case MID_UP_REL_MARGIN: &lt;br /&gt;
         case MID_LO_REL_MARGIN: &lt;br /&gt;
         { &lt;br /&gt;
             sal_Int32 nRel; &lt;br /&gt;
             if((rVal &amp;gt;&amp;gt;= nRel) &amp;amp;&amp;amp; nRel &amp;gt; 1 ) &lt;br /&gt;
             { &lt;br /&gt;
                 if(MID_UP_REL_MARGIN == nMemberId) &lt;br /&gt;
                     nPropUpper = nRel; &lt;br /&gt;
                 else &lt;br /&gt;
                     nPropLower = nRel; &lt;br /&gt;
             } &lt;br /&gt;
             else &lt;br /&gt;
                 return FALSE; &lt;br /&gt;
         } &lt;br /&gt;
         break; &lt;br /&gt;
&lt;br /&gt;
         default: &lt;br /&gt;
             DBG_ERROR(&amp;quot;unknown MemberId&amp;quot;); &lt;br /&gt;
             return sal_False; &lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   return sal_True; &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;We should now see some very important rules that this conversion can work correctly.&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Never use the value 0 of the nMemberID to convert the &amp;#039;&amp;#039;default part&amp;#039;&amp;#039; of an item. This will immediately break our user interface updates.&lt;br /&gt;
* If you want to add a new slot that can be used by the user interface, your MUST support Query- and PutValue. At least the default value 0 must be implemented.&lt;br /&gt;
* Never use other arguments to call a slot than the ones that are declared in your SDI file. The conversion methods in sfx2 use the type description of the slot to map UNO types to items and cannot do this for unknown arguments.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137248</id>
		<title>Framework/Article/Implementation of the Dispatch API In SFX2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137248"/>
		<updated>2009-08-11T17:01:14Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Items and UNO structs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementation of the Dispatch API in SFX2 ==&lt;br /&gt;
&lt;br /&gt;
The Dispatch API as described in chapter 7.1.6 of the Developer&amp;#039;s Guide is the backbone of our communication between &amp;quot;generic&amp;quot; UI elements and the document core implementations.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Traditionally SFX based components implemented this communication with a much older framework based on the so called &amp;#039;&amp;#039;slots&amp;#039;&amp;#039; and their organization into &amp;#039;&amp;#039;shells&amp;#039;&amp;#039;. While up to OpenOffice.org 1.1 our generic UI elements (menus, toolbars, etc.) still used the SFX based API directly to a large degree in OpenOffice.org 2.0 we changed this to using the Dispatch API exclusively, thus enabling us to share the UI components with other, not SFX based components. This paper describes how the old SFX implementation is matched to the &amp;#039;&amp;#039;DispatchProvider&amp;#039;&amp;#039; implementation that the component provides to the outside to make this happen.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The basic entity in the dispatch API is a command, and it&amp;#039;s represented by a &amp;#039;&amp;#039;CommandURL&amp;#039;&amp;#039;. For simplifications we suppose that this CommandURL is a string (though the API transport it as a pre-parsed struct). All commands supported by our components have the form &amp;#039;&amp;#039;.uno:xxxxx&amp;#039;&amp;#039; for historical reasons, where &amp;#039;&amp;#039;xxxxx&amp;#039;&amp;#039; represents an internal command name. Examples are “.uno:Print” or “.uno:Paste”. The functionality provided by the Dispatch API is support to execute such commands and getting status information for them (enabled/disabled or explicit information if the commands represents something type, a boolean, a string etc.).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As explained in the Developer&amp;#039;s Guide the Dispatch API builds on the idea that such commands can be passed along a chain of Dispatch Provider objects. Every object in this chain is free to decide whether it will handle a command or wants to pass it to the next chain member. Each document window and the Frame object managing it has such a chain of Dispatch providers and at least one object in this chain belongs to the document model/view pair bound to this window. It&amp;#039;s the so called Controller object that amongst other interfaces supports the XDispatchProvider interface. &lt;br /&gt;
&lt;br /&gt;
=== Controller objects in SFX2 ===&lt;br /&gt;
&lt;br /&gt;
SFX2 based components share a common base class for their Controller object implementation, SfxBaseController. It has a queryDispatch() implementation of the XDispatchProvider interface where the received CommandURLs are compared with the CommandURLs in the set of commands the particular component supports. It uses some comparable functionality in the old SFX2 framework that also is able to execute commands and give status information about them. The main difference between the old SFX2 base framework and the UNO framework is that the latter defines commands by strings (CommandURLs) and the former does it by integer values (SlotID, see below). So the main job of the queryDispatch() implementation in the SfxBaseController is to match a commandURL to the corresponding SlotID and then proceed using the internal old SFX2 implementation.&lt;br /&gt;
&lt;br /&gt;
SFX2 organizes functionality in contexts that can be merged together and exposed to the outside world by a single point of contact. This contact point is an SfxDispatcher object that every SfxBaseController owns. [Remark: this ownership is indirect as the real owner of the SfxDispatcher is an SfxViewFrame; but there is always a 1:1 relationship between an SfxViewFrame and an SfxBaseController.]&lt;br /&gt;
The SfxDispatcher internally maintains a stack of objects, each representing a context. Examples for these contexts are “document”, “view”, “text”, “table”, “cell” etc. All these objects are derived from a common base class “SfxShell”. The complete stack of all contextual objects available in a particular situation, the “merged context”, represents the function set applicable to the current selection or cursor position in a document. Context changes inside the document&amp;#039;s editing window cause pushing and popping of shell objects to and from the stack. &lt;br /&gt;
&lt;br /&gt;
This is how a typical stack in Writer looks when the cursor is in a normal text paragraph:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The same stack when the cursor is in a text paragraph in a table:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* Table&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
Another stack when a graphic is selected:&lt;br /&gt;
&lt;br /&gt;
* Graphic&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Frame&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Application&amp;#039;&amp;#039; contexts are there for historical reasons, we are still in the process of moving their functionality to the framework where other &amp;#039;&amp;#039;DispatchProviders&amp;#039;&amp;#039; outside of the component take over. I omitted the &amp;quot;Form&amp;quot; context here because it&amp;#039;s somewhat confusing.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slots and Interfaces ==&lt;br /&gt;
&lt;br /&gt;
Each SfxShell class has a static member called SfxInterface. It is an object containing an array of SfxSlot structs. Each “slot” represents a command supported by the context (shell) it is assigned to. So the complete SfxInterface defines the functionality an instance of the particular SfxShell class using this interface provides.&lt;br /&gt;
&lt;br /&gt;
=== The SfxSlot struct ===&lt;br /&gt;
&lt;br /&gt;
The “slot” struct contains all necessary information that the SfxDispatcher needs to work together with the Shell object containing the slot. The slot contains function pointers that the dispatcher can call to either execute the command represented by the slot or get status information about it. Thus the dispatcher doesn&amp;#039;t need to know the concrete implementation classes of the shells, it can work with them through their base class (SfxShell) interface.&lt;br /&gt;
&lt;br /&gt;
Other important parts of the SfxSlot struct are the “name” of the slot and the numerical ID of it, its so called SlotID. Slot names have been chosen so that they match the part after the colon in “.uno:...” CommandURLs. Mapping between CommandURLs and SlotIDs to then need a simple lookup in all SfxInterfaces of the SfxShells on the shell stack of the SfxDispatcher. More about slots can be found below. &lt;br /&gt;
&lt;br /&gt;
When the SfxDispatcher is asked for support of a particular command it searches for a slot with the given internal command name starting with the top most shell on the stack and then proceeding with the next one until success. This way “higher prioritized” contexts can overrule functionality from “lower prioritized” contexts. As an example, the “document” context has a generic implementation of the “Print” command, but each particular “view” context can overrule the generic behavior and define a specific way of printing. &lt;br /&gt;
&lt;br /&gt;
=== The SfxInterface class ===&lt;br /&gt;
&lt;br /&gt;
The slot arrays aka SfxInterfaces are static to each shell class and so each interface is a part of the data segment of the library that contains the shell code assigned to this interface. The data for these arrays needs to be predefined in source files. Writing huge arrays into C++ source files is a very tedious work and so we use a different kind of source file that is easier to edit and have a compiler (“svidl”) that takes these files and compiles them into a generated header file containing the definition of the arrays. These idl files are located in the sdi sub folders of each SFX based project and have the extension “sdi”. The generated header file contains the definitions (not only declarations) of all “interfaces” of the library and some “#define” magic allows to have each interface generated only once. More about this process below.&lt;br /&gt;
&lt;br /&gt;
=== Slots, interfaces, shells, dispatchers ===&lt;br /&gt;
&lt;br /&gt;
In OOo1.x the SfxBaseController utilized its SfxDispatcher and its stack to provide a generic Dispatch object for every supported command. It gets the CommandURL in the queryDispatch call, looks for a slot on the dispatcher stack with a suitable internal command name and in case of success creates a dispatch object and returns it. There is a drawback in this approach: if the context changes (means: shells are pushed or popped) slots might appear or disappear from the stack so commands that had been supported aren&amp;#039;t any longer or the other way around. This forces the DispatchProvider to request a complete refetching of all dispatch objects and so can be time consuming.&lt;br /&gt;
&lt;br /&gt;
In OOo2.x we utilize the “slot pool” of the SFX based modules. This is the entirety of all “interfaces” (slot arrays) the module supports. On startup all interfaces register at the module class (SfxModule base class) so it is easy to iterate through its interfaces. Now a Dispatch Object is returned when the slot is found anywhere in the slot pool, even if the interface is not on the stack, but in this case the Dispatch Object reports its slots as disabled everytime it is used. This can be determined dynamically so context changes don&amp;#039;t need external updates, it&amp;#039;s enough to update the internal status of the already created Dispatch Objects. This approach also enables some future optimizations for the representation of slot arrays that will be discussed later.&lt;br /&gt;
&lt;br /&gt;
== Slot Processing ==&lt;br /&gt;
&lt;br /&gt;
In former (Pre-UNO) time the slots where not only used for command dispatching but also for the implementation of our Basic API (up to StarOffice 5.2), so the slot arrays where &amp;quot;real&amp;quot; &amp;#039;&amp;#039;interfaces&amp;#039;&amp;#039;. There are a lot residues of the in the sdi files (see below), but they aren&amp;#039;t used anymore.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slot definitions ===&lt;br /&gt;
&lt;br /&gt;
The use case explains why there are two different kinds of slots, property slots and method slots, and the difference between them can be spotted easily from the definition of a slot in the sdi file. Here are two examples, the first one describing a method slot and the second one describing a property slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem About SID_ABOUT&lt;br /&gt;
()&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxBoolItem DesignerDialog SID_STYLE_DESIGNER&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = TRUE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = TRUE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    Readyonly = FALSE,&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_FORMAT;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each slot is a block in rectangular bracket filled with attributes that is preceded by two lines that identify the slot and define its nature. The exact meaning of all the attributes is explained below, the most notable difference is seen in the second line of each block: the paranthesis of the &amp;quot;About&amp;quot; slot classify it as a method while the other one (without paranthesis) is a property. As explained above, this classification goes back to the old Basic API but besides that it&amp;#039;s important for the implementation of macro recording that is also based on the Dispatch API (and for SFX component it&amp;#039;s implemented using slots). &amp;quot;Method&amp;quot; and &amp;quot;property&amp;quot; slots are recorded differently.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The name in the middle of each first line of a block was used as the name of the property or method in the Basic API and today this name is the internal command name that is matched to any &amp;quot;.uno:xxx&amp;quot; CommandURLs of the Dispatch API. As an example, the slot named &amp;quot;Undo&amp;quot; is assigned to the &amp;quot;.uno:Undo&amp;quot; command. This matching requires that the internal command names have to be unique in the complete module. This uniqueness is verified by the svidl compiler that breaks in case if name clashes in a module.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last part of each first line is the so called SlotID that in former times was the real identifier (not as today the internal command name) and it was also used inside the GUI element configuration files where today CommandURLs are used. So this SlotID had to be unique for the module at least, currently it&amp;#039;s even globally unique but at least theoretically it is now obsolete. Inside the slot processing only the textual representation of the SlotID is relevant , not its numerical value.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Property slots have a type specified by the first part of the first line. The same data in a method slot specifies the return value of the associated method. Method slots also can gave parameters (non empty paranthesis) and a return value that could be used in the old Basic API of StarOffice, but also in internal methods of the SfxDispatcher. Strictly speaking the latter is still possible but we try to get rid of this. Here are two examples for slots with arguments, with and without return value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem Undo SID_UNDO&lt;br /&gt;
( SfxUInt16Item Undo SID_UNDO )&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Volatile,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* status */&lt;br /&gt;
    SlotType = SfxStringItem&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_EDIT;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxObjectItem Open SID_OPENDOC&lt;br /&gt;
(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, SfxStringItem OpenFlags SID_OPTIONS,&lt;br /&gt;
SfxStringItem Password SID_PASSWORD, SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS, SfxInt16Item Version SID_VERSION,&lt;br /&gt;
SfxStringItem Referer SID_REFERER)&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = TRUE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Asynchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As shown in the examples, property types and return values are given as &amp;#039;&amp;#039;Items&amp;#039;&amp;#039;, the whole slot &amp;quot;API&amp;quot; is based on SfxPoolItems, each identified by its ID. These IDs must be unique only in the context of the method.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Slots are used to bind their functionality to UI elements. In former times this was done by writing the SlotIDs into the UI element configuration files, today we use CommandURLs. Binding slots to UI elements (today indirectly through the &amp;#039;&amp;#039;Dispatch Object&amp;#039;&amp;#039;) means that the binding client wants to get status information from it and/or possibly wants to execute it, in most cases (means: the standard controllers) without any parameters.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The type of the status update information is given by the &amp;#039;&amp;#039;SlotType&amp;#039;&amp;#039; attribute. For property slots like &amp;quot;DesignerDialog&amp;quot; this is identical with its property type (and so this attribute is not explictly assigned in the block), for method slots it must be specified like shown in the &amp;quot;Undo&amp;quot; example. If a method slot doesn&amp;#039;t specify a SlotType it has no status (except &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; or &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;). So in the examples &amp;quot;Undo&amp;quot; is of type String, &amp;quot;DesignerDialog&amp;quot; of type Boolean while the other slots don&amp;#039;t have a status.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A menu controller will reflect this by showing status of the &amp;quot;Undo&amp;quot; entry as its title and setting or unsetting a check mark in front of the &amp;quot;DesignerDialof&amp;quot; entry reflecting its boolean status, a toolbar controller reflects the latter one in a pressed/unpressed state, the former in different button titles (or quick help texts that replace the button title if it&amp;#039;s switched off). Other types of status information need speccialized controller that know how to deal with this kind of information.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All the other attributes inside the block of a slot are &amp;#039;&amp;#039;flags&amp;#039;&amp;#039; that define the behavior of the slot at runtime. Some of the attributes are contradicting (like synchron or asynchron) and so of course only one of them can be set. The table below sums them up in one line.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;80%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!width=&amp;quot;40%&amp;quot;|Attribute&lt;br /&gt;
!width=&amp;quot;60%&amp;quot;|Meaning&lt;br /&gt;
|-&lt;br /&gt;
||Cachable (Volatile)|| Slot status is cached, sending a new status to controllers need an &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call that forces SFX to fetch a new status. Volatile slots are not cached and SFX permanently asks for status information based on a timer.&lt;br /&gt;
|-&lt;br /&gt;
|AutoUpdate || TRUE: After execution of the slot SFX automatically fetches the new status, no &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call necessary&lt;br /&gt;
|-&lt;br /&gt;
|FastCall || TRUE: SFX doesn&amp;#039;t check &amp;quot;enable&amp;quot; status before executing a slot&lt;br /&gt;
|-&lt;br /&gt;
|Toggle || Execute without parameters automatically toggles the current status. Works for property slots with boolean or enum type.&lt;br /&gt;
|-&lt;br /&gt;
|HasCoreId || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|HasDialog || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|ReadOnlyDoc || FALSE: SFX automatically disables this slot if the document is read only&lt;br /&gt;
|-&lt;br /&gt;
|Container || TRUE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the object.&amp;lt;br/&amp;gt;FALSE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the container.&lt;br /&gt;
|-&lt;br /&gt;
|RecordAbsolute || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|RecordPerSet (RecordPerItem, NoRecord) || See explanation for Recording.&lt;br /&gt;
|-&lt;br /&gt;
|Synchron (Asynchron) || Asynchron: SFX execute the slot by posting a user event instead of directly calling the execute function of the slot&lt;br /&gt;
|-&lt;br /&gt;
|Readonly || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|AccelConfig || Slot may be offered in the configuration dialog for keyboard shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|MenuConfig || Slot may be offered in the configuration dialog for menus&lt;br /&gt;
|-&lt;br /&gt;
|StatusBarConfig || Slot may be offered in the configuration dialog for status bar&lt;br /&gt;
|-&lt;br /&gt;
|ToolboxConfig || Slot may be offered in the configuration dialog for toolbars&lt;br /&gt;
|-&lt;br /&gt;
|GroupId || Assign the slot to a function group in the configuration dialogs (module is free to define categories)&lt;br /&gt;
|-&lt;br /&gt;
|ImageRotation || Toolbar images are rotated in case of writing direction from right to left&lt;br /&gt;
|-&lt;br /&gt;
|ImageReflection || Toolbar images are rotated in case of vertical text orientation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interface definitions ===&lt;br /&gt;
&lt;br /&gt;
As already mentioned, slots are bundled to interfaces and interfaces are used by shells. SDI files know both terms. Here&amp;#039;s an example how this looks. For clarity only a few slots are shown, the read file contains much more of them.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
interface Document : Object&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE ;&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_CLOSEDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface OfficeDocument : Document&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_DOC_MODIFIED&lt;br /&gt;
    [&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    SID_PRINTDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = PrintExec_Impl ;&lt;br /&gt;
        StateMethod = NoState ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
shell SfxObjectShell&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    import OfficeDocument [AUTOMATION];&lt;br /&gt;
&lt;br /&gt;
    SID_DOCINFO&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The interface term is used slightly different in the sdi files that it is used by SFX, so now we use the name &amp;quot;slot arrays&amp;quot; for what the SFX itself calls &amp;quot;interfaces&amp;quot; to avoid confusion.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As a residue of the old Basic API sdi files define interfaces and shells separately, thus differentiating between slots for both Basic and UI usage and slots only used for UI purposes. This is obsolete today, but still used. Additionally sdi files define base and derived interfaces and shells in a granularity we don&amp;#039;t need anymore, but this is also a residue of the StarBasic support. This might change in the near future. Some interfaces even contained real basic properties that are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; represented by slots at all (like the &amp;quot;object&amp;quot; interface referenced in the example) but they are not used anymore.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;shell&amp;quot; defined in the file references a C++ implementation class SfxObjectShell. This part of the sdi file defines the complete slot interface of this class. The &amp;quot;import&amp;quot; statement tells the svidl compiler that it should add all slots of the interface &amp;quot;OfficeDocument&amp;quot; here (and of course all slots of its &amp;quot;base class&amp;quot; interfaces).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;Automation&amp;quot; attribute that is assigned to both interfaces and shells tells the svidl compiler whether it should generate a slot array definition for this interface/shell or not. We only generate arrays for shell, not for interfaces (because we don&amp;#039;t need them anymore). In former times we also generated arrays for interfaces, and the &amp;quot;Automation&amp;quot; attribute allowed us to prevent svidl from generating them for base class interfaces also. The &amp;quot;Automation&amp;quot; attribute will become obsolete pretty soon.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the interface/shell definition block slots are referenced by their SlotID. Svidl will get all attributes of the slot it needs to generate the array definition from the slot definition (that of course needs to be included and processed before svidl gets to the shell definition). In the block below this identifier (again with rectangular brackets) two additional attributes are specified: the names of one or two methods can be defined that SFX calls to get status information or execute the slot. These methods have a prescribed signature:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Class::StateMethod( SfxItemSet&amp;amp; );&lt;br /&gt;
void Class::ExecMethod( SfxRequest&amp;amp; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The ItemSet is used to collect the status information, the SfxRequest contains everything necessary for the execution of a slot.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The svidl compiler takes the shell class name and the method name and generates an inline stub function that calls the C++ member. A pointer to each stub is generated into the slot definitions. The stubs are generated into the same header file that contains the generated arrays. Here is an example for the first slot of the interface &amp;quot;Document&amp;quot; shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_EXEC_STUB( SfxObjectShell, ExecFile_Impl )&lt;br /&gt;
SFX_STATE_STUB( SfxObjectShell, GetState_Impl )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We use function stubs here because pointer to member functions don&amp;#039;t have a fixed size and so we can&amp;#039;t store them inside a struct like SfxSlot. A pointer to a C function always has the same size as normal pointer on the machine.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The slots in our example show that both pointers can be set or only one of them. A slot without an &amp;quot;Exec&amp;quot; function is a slot that only has a status, execution is done by another slot. A slot without a &amp;quot;GetState&amp;quot; function is always enabled and has no status. SFX automatically generates empty stub in these cases.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the block defining the functions theoretically all slot attributes of the referenced slot can be overwritten and sometimes this can be found. This should be seen as exceptional cases and it might happen in the near future that this overwriting will become forbidden for more and more attributes. The benefit of this is very limited but the risk of dangerous inconsistencies is high.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Here&amp;#039;s an exerpt of the generated header file that belongs to the SID_CLOSEDOC slot shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_SLOTMAP_ARG(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
// Slot Nr. 0 : 5502&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_SAVEASDOC,SID_SAVEASDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[1] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                0/*Offset*/, 9/*Count*/,&amp;quot;.SaveAs&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;SaveAs&amp;quot; ),&lt;br /&gt;
// Slot Nr.1 : 5503&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_CLOSEDOC,SID_CLOSEDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[3] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                9/*Offset*/, 2/*Count*/,&amp;quot;.CloseDoc&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;CloseDoc&amp;quot; ),&lt;br /&gt;
// Slot Nr.2 : 5504&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_PRINTDOC,SID_PRINTDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[2] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR_NONE,&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                11/*Offset*/, 10/*Count*/,&amp;quot;.Print&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;Print&amp;quot; ),&lt;br /&gt;
&lt;br /&gt;
         // ... to be continued ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The SFX_NEW_SLOT_ARG macro initializes a complete slot. Most of it should be pretty obvious from what was described already, please note the macros for the generated stubs (and especially SFX_STUB_PTR_STATE_NONE for the empty stub).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An interesting addition is the second line of each block, it contains an &amp;quot;Offset Next&amp;quot;. It is a pointer that points to the next slot in this shell that uses the same &amp;quot;GetState&amp;quot; method as the current slot. This enables SFX to collects status information for several slots at once when a complete update is requested. In general the shell code allows to group slots together in Exec/GetState methods and have more than one per shell for clarity reasons.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The last line in each block also contains an offset and a count. These attributes point to the arguments of the slot (of course only for methods). All possible arguments of all slots inside a shell are grouped into a single array, arguments that belong to the same slot of course beneath each other. The offset points to the first argument of a slot:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_ARGUMENTMAP(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_NAME,&amp;quot;URL&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILTER_NAME,&amp;quot;FilterName&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_PASSWORD,&amp;quot;Password&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,&amp;quot;FilterOptions&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_COMMENTS,&amp;quot;VersionComment&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_AUTHOR,&amp;quot;VersionAuthor&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_OVERWRITE,&amp;quot;Overwrite&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_UNPACK,&amp;quot;Unpacked&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_SAVETO,&amp;quot;SaveTo&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_SAVE,&amp;quot;SaveChanges&amp;quot;,SfxBoolItem),    // &amp;lt;---- here args for SID_CLOSEDOC start&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_FILENAME,&amp;quot;FileName&amp;quot;,SfxStringItem), // &amp;quot;count&amp;quot; is 2, so this is the second one&lt;br /&gt;
&lt;br /&gt;
    // ... to be continued ...&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In each module one header file containing all shells is created. It must be included in the source file of each shell class that contains the SFX_IMPL_INTERFACE macro. To avoid multiple definitions of the slot arrays by this multiple inclusion each code block assigned to a particular shell is framed by an &amp;quot;#ifdef ClassName&amp;quot; block, so in the source file the typical code sequence is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define SfxObjectShell&lt;br /&gt;
#include &amp;quot;sfxslots.hxx&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Other parts of the header file are framed by &amp;quot;#ifdef SFX_TYPEMAP&amp;quot; and this part mustbe activated only once also so each module contains one file that includes the generated header file and defined SFX_TYPEMAP before. This can be on e of the shell files that also defines its shell interface or it can be a different one. The part of the generated header file that is activated here is not necessary for the SFX core (the slot dispatching), but was necessary in former times for the type information of the old Basic API and for macro recording. Today it is used for the wrapper that mediates between SFX dispatching and the Dispatch API and thus also for macro recording because the current macro recorder also uses the Dispatch API.&lt;br /&gt;
&lt;br /&gt;
=== Items and UNO structs ===&lt;br /&gt;
&lt;br /&gt;
The old SFX based Basic API was made up by the property and method slot defined in the sdi files. All types are specified as SfxPoolItems and this was fine for StarBasic because internally these types are used also (for Sbx classes). For recording purposes it was necessary to know the &amp;quot;real&amp;quot; types behind a particular SfxPoolItem type and especially structured items needed to be split up into basic types because StarBasic doesn&amp;#039;t support structs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The mapping from a SfxPoolItem to an atomic or structured type is done by using a mapping table in another sdi file. Here&amp;#039;s an example for atomic types from the SFX module:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item void     SfxVoidItem&lt;br /&gt;
item BOOL     SfxBoolItem&lt;br /&gt;
item INT32    SfxUInt16Item&lt;br /&gt;
item INT16    SfxInt16Item&lt;br /&gt;
item INT32    SfxUInt32Item&lt;br /&gt;
item INT32    SfxInt32Item&lt;br /&gt;
item String   SfxStringItem&lt;br /&gt;
item BYTE     SfxByteItem&lt;br /&gt;
item INT16    SfxEnumItem&lt;br /&gt;
item INT16    SfxAllEnumItem&lt;br /&gt;
item INT16    SbxImageItem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It&amp;#039;s pretty straightforward: &amp;quot;item&amp;quot; declares the type to be atomic and it is followed by the Basic (or better: UNO) type and the Item representing it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Structured types are a little bit more complicated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
struct Point&lt;br /&gt;
{&lt;br /&gt;
    INT32    X    MID_X;&lt;br /&gt;
    INT32    Y    MID_Y;&lt;br /&gt;
};&lt;br /&gt;
item Point SfxPointItem;&lt;br /&gt;
&lt;br /&gt;
struct Rectangle&lt;br /&gt;
{&lt;br /&gt;
    INT32    Left    MID_RECT_LEFT;&lt;br /&gt;
    INT32    Top     MID_RECT_TOP;&lt;br /&gt;
    INT32    Width   MID_WIDTH;&lt;br /&gt;
    INT32    Height  MID_HEIGHT;&lt;br /&gt;
};&lt;br /&gt;
item Rectangle SfxRectangleItem;&lt;br /&gt;
&lt;br /&gt;
struct DocInfo&lt;br /&gt;
{&lt;br /&gt;
    BOOL    UseUserData    MID_DOCINFO_USEUSERDATA;&lt;br /&gt;
    BOOL    DeleteUserData MID_DOCINFO_DELETEUSERDATA;&lt;br /&gt;
    String  Title          MID_DOCINFO_TITLE;&lt;br /&gt;
    String  Subject        MID_DOCINFO_SUBJECT;&lt;br /&gt;
    String  KeyWords       MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    String  Description    MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    BOOL    AutoReload     MID_DOCINFO_AUTOLOADENABLED;&lt;br /&gt;
};&lt;br /&gt;
item DocInfo SfxDocumentInfoItem;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The examples show simple structs like a Point or more complex structs like a DocInfo. Structs can be nested, a DocInfo could contain a Point also. In the old StarBasic and also in todays macro recording each member of a struct was represented by an individual item (so an ID was needed that is unique in the complete argument set) and the names of these arguments were assembled from the name of the struct parameter name and the member name in the obvious from ArgName.MemberName.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For some items that are used only internally in SFX based code (but not for recording purposes) no mapping was necessary and for syntactical completeness they are mapped to an atomic type, but this mapping is never used:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item String    SbxItem;                //! Dummy&lt;br /&gt;
item String    SfxObjectItem;          //! Dummy&lt;br /&gt;
item String    SfxTemplateItem;        //! Dummy&lt;br /&gt;
item String    SfxMacroInfoItem;       //! Dummy&lt;br /&gt;
item String    SfxImageItem;           //! Dummy&lt;br /&gt;
item String    SfxFrameItem;           //! Dummy&lt;br /&gt;
item String    SfxObjectShellItem;     //! Dummy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The svidl compiler creates the type mappings into the following form:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// example for an atomic type&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType0 aSfxStringItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxStringItem), 0&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
// example for a struct with 4 members&lt;br /&gt;
extern SfxType4 aSfxRectangleItem_Impl;&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType4 aSfxRectangleItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxRectangleItem}, 4, { {MID_RECT_LEFT,&amp;quot;Left&amp;quot;}, {MID_RECT_TOP,&amp;quot;Top&amp;quot;}, {MID_WIDTH,&amp;quot;Width&amp;quot;},&lt;br /&gt;
{MID_HEIGHT,&amp;quot;Height&amp;quot;} }&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It utilizes the TOOLS based RTTI that allows to offer a static factory method by using one of the TYPEINIT_AUTOFACTORY macros. This factory that can be used to create an item of the particular class. This is very important for the conversion routines that match items to UNO structs and vice versa. An item that does not offer a factory can&amp;#039;t be converted properly and so macro recording and Dispatch API are broken for this item.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The conversion between an item and a UNO type uses the virtual PutValue and QueryValue methods of the items. In the case of macro recording (where only atomic types are allowed) the &amp;quot;MemberID&amp;quot; parameter of these calls is used always in case of structured items and so it is important that the MIDs in the sdi file match the MIDs used in the implementation of the item. As an example, an SfxRectangleItem is recorded as two integer values.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The matching we use for the Dispatch API in our controllers on the other hand always converts to complete structs, not to atomic members, so the SfxRectangleItem is converted to a com.sun.star.awt.Rectangle. The rect Put/QueryValue in this case is called with MID=0. It&amp;#039;s vital for this process that &amp;#039;&amp;#039;&amp;#039;&amp;quot;0&amp;quot; is an invalid MID&amp;#039;&amp;#039;&amp;#039; that must not be used for any member.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Article]]&lt;br /&gt;
[[Category:Framework]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137247</id>
		<title>Framework/Article/Implementation of the Dispatch API In SFX2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137247"/>
		<updated>2009-08-11T16:59:27Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Items and UNO structs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementation of the Dispatch API in SFX2 ==&lt;br /&gt;
&lt;br /&gt;
The Dispatch API as described in chapter 7.1.6 of the Developer&amp;#039;s Guide is the backbone of our communication between &amp;quot;generic&amp;quot; UI elements and the document core implementations.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Traditionally SFX based components implemented this communication with a much older framework based on the so called &amp;#039;&amp;#039;slots&amp;#039;&amp;#039; and their organization into &amp;#039;&amp;#039;shells&amp;#039;&amp;#039;. While up to OpenOffice.org 1.1 our generic UI elements (menus, toolbars, etc.) still used the SFX based API directly to a large degree in OpenOffice.org 2.0 we changed this to using the Dispatch API exclusively, thus enabling us to share the UI components with other, not SFX based components. This paper describes how the old SFX implementation is matched to the &amp;#039;&amp;#039;DispatchProvider&amp;#039;&amp;#039; implementation that the component provides to the outside to make this happen.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The basic entity in the dispatch API is a command, and it&amp;#039;s represented by a &amp;#039;&amp;#039;CommandURL&amp;#039;&amp;#039;. For simplifications we suppose that this CommandURL is a string (though the API transport it as a pre-parsed struct). All commands supported by our components have the form &amp;#039;&amp;#039;.uno:xxxxx&amp;#039;&amp;#039; for historical reasons, where &amp;#039;&amp;#039;xxxxx&amp;#039;&amp;#039; represents an internal command name. Examples are “.uno:Print” or “.uno:Paste”. The functionality provided by the Dispatch API is support to execute such commands and getting status information for them (enabled/disabled or explicit information if the commands represents something type, a boolean, a string etc.).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As explained in the Developer&amp;#039;s Guide the Dispatch API builds on the idea that such commands can be passed along a chain of Dispatch Provider objects. Every object in this chain is free to decide whether it will handle a command or wants to pass it to the next chain member. Each document window and the Frame object managing it has such a chain of Dispatch providers and at least one object in this chain belongs to the document model/view pair bound to this window. It&amp;#039;s the so called Controller object that amongst other interfaces supports the XDispatchProvider interface. &lt;br /&gt;
&lt;br /&gt;
=== Controller objects in SFX2 ===&lt;br /&gt;
&lt;br /&gt;
SFX2 based components share a common base class for their Controller object implementation, SfxBaseController. It has a queryDispatch() implementation of the XDispatchProvider interface where the received CommandURLs are compared with the CommandURLs in the set of commands the particular component supports. It uses some comparable functionality in the old SFX2 framework that also is able to execute commands and give status information about them. The main difference between the old SFX2 base framework and the UNO framework is that the latter defines commands by strings (CommandURLs) and the former does it by integer values (SlotID, see below). So the main job of the queryDispatch() implementation in the SfxBaseController is to match a commandURL to the corresponding SlotID and then proceed using the internal old SFX2 implementation.&lt;br /&gt;
&lt;br /&gt;
SFX2 organizes functionality in contexts that can be merged together and exposed to the outside world by a single point of contact. This contact point is an SfxDispatcher object that every SfxBaseController owns. [Remark: this ownership is indirect as the real owner of the SfxDispatcher is an SfxViewFrame; but there is always a 1:1 relationship between an SfxViewFrame and an SfxBaseController.]&lt;br /&gt;
The SfxDispatcher internally maintains a stack of objects, each representing a context. Examples for these contexts are “document”, “view”, “text”, “table”, “cell” etc. All these objects are derived from a common base class “SfxShell”. The complete stack of all contextual objects available in a particular situation, the “merged context”, represents the function set applicable to the current selection or cursor position in a document. Context changes inside the document&amp;#039;s editing window cause pushing and popping of shell objects to and from the stack. &lt;br /&gt;
&lt;br /&gt;
This is how a typical stack in Writer looks when the cursor is in a normal text paragraph:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The same stack when the cursor is in a text paragraph in a table:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* Table&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
Another stack when a graphic is selected:&lt;br /&gt;
&lt;br /&gt;
* Graphic&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Frame&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Application&amp;#039;&amp;#039; contexts are there for historical reasons, we are still in the process of moving their functionality to the framework where other &amp;#039;&amp;#039;DispatchProviders&amp;#039;&amp;#039; outside of the component take over. I omitted the &amp;quot;Form&amp;quot; context here because it&amp;#039;s somewhat confusing.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slots and Interfaces ==&lt;br /&gt;
&lt;br /&gt;
Each SfxShell class has a static member called SfxInterface. It is an object containing an array of SfxSlot structs. Each “slot” represents a command supported by the context (shell) it is assigned to. So the complete SfxInterface defines the functionality an instance of the particular SfxShell class using this interface provides.&lt;br /&gt;
&lt;br /&gt;
=== The SfxSlot struct ===&lt;br /&gt;
&lt;br /&gt;
The “slot” struct contains all necessary information that the SfxDispatcher needs to work together with the Shell object containing the slot. The slot contains function pointers that the dispatcher can call to either execute the command represented by the slot or get status information about it. Thus the dispatcher doesn&amp;#039;t need to know the concrete implementation classes of the shells, it can work with them through their base class (SfxShell) interface.&lt;br /&gt;
&lt;br /&gt;
Other important parts of the SfxSlot struct are the “name” of the slot and the numerical ID of it, its so called SlotID. Slot names have been chosen so that they match the part after the colon in “.uno:...” CommandURLs. Mapping between CommandURLs and SlotIDs to then need a simple lookup in all SfxInterfaces of the SfxShells on the shell stack of the SfxDispatcher. More about slots can be found below. &lt;br /&gt;
&lt;br /&gt;
When the SfxDispatcher is asked for support of a particular command it searches for a slot with the given internal command name starting with the top most shell on the stack and then proceeding with the next one until success. This way “higher prioritized” contexts can overrule functionality from “lower prioritized” contexts. As an example, the “document” context has a generic implementation of the “Print” command, but each particular “view” context can overrule the generic behavior and define a specific way of printing. &lt;br /&gt;
&lt;br /&gt;
=== The SfxInterface class ===&lt;br /&gt;
&lt;br /&gt;
The slot arrays aka SfxInterfaces are static to each shell class and so each interface is a part of the data segment of the library that contains the shell code assigned to this interface. The data for these arrays needs to be predefined in source files. Writing huge arrays into C++ source files is a very tedious work and so we use a different kind of source file that is easier to edit and have a compiler (“svidl”) that takes these files and compiles them into a generated header file containing the definition of the arrays. These idl files are located in the sdi sub folders of each SFX based project and have the extension “sdi”. The generated header file contains the definitions (not only declarations) of all “interfaces” of the library and some “#define” magic allows to have each interface generated only once. More about this process below.&lt;br /&gt;
&lt;br /&gt;
=== Slots, interfaces, shells, dispatchers ===&lt;br /&gt;
&lt;br /&gt;
In OOo1.x the SfxBaseController utilized its SfxDispatcher and its stack to provide a generic Dispatch object for every supported command. It gets the CommandURL in the queryDispatch call, looks for a slot on the dispatcher stack with a suitable internal command name and in case of success creates a dispatch object and returns it. There is a drawback in this approach: if the context changes (means: shells are pushed or popped) slots might appear or disappear from the stack so commands that had been supported aren&amp;#039;t any longer or the other way around. This forces the DispatchProvider to request a complete refetching of all dispatch objects and so can be time consuming.&lt;br /&gt;
&lt;br /&gt;
In OOo2.x we utilize the “slot pool” of the SFX based modules. This is the entirety of all “interfaces” (slot arrays) the module supports. On startup all interfaces register at the module class (SfxModule base class) so it is easy to iterate through its interfaces. Now a Dispatch Object is returned when the slot is found anywhere in the slot pool, even if the interface is not on the stack, but in this case the Dispatch Object reports its slots as disabled everytime it is used. This can be determined dynamically so context changes don&amp;#039;t need external updates, it&amp;#039;s enough to update the internal status of the already created Dispatch Objects. This approach also enables some future optimizations for the representation of slot arrays that will be discussed later.&lt;br /&gt;
&lt;br /&gt;
== Slot Processing ==&lt;br /&gt;
&lt;br /&gt;
In former (Pre-UNO) time the slots where not only used for command dispatching but also for the implementation of our Basic API (up to StarOffice 5.2), so the slot arrays where &amp;quot;real&amp;quot; &amp;#039;&amp;#039;interfaces&amp;#039;&amp;#039;. There are a lot residues of the in the sdi files (see below), but they aren&amp;#039;t used anymore.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slot definitions ===&lt;br /&gt;
&lt;br /&gt;
The use case explains why there are two different kinds of slots, property slots and method slots, and the difference between them can be spotted easily from the definition of a slot in the sdi file. Here are two examples, the first one describing a method slot and the second one describing a property slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem About SID_ABOUT&lt;br /&gt;
()&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxBoolItem DesignerDialog SID_STYLE_DESIGNER&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = TRUE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = TRUE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    Readyonly = FALSE,&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_FORMAT;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each slot is a block in rectangular bracket filled with attributes that is preceded by two lines that identify the slot and define its nature. The exact meaning of all the attributes is explained below, the most notable difference is seen in the second line of each block: the paranthesis of the &amp;quot;About&amp;quot; slot classify it as a method while the other one (without paranthesis) is a property. As explained above, this classification goes back to the old Basic API but besides that it&amp;#039;s important for the implementation of macro recording that is also based on the Dispatch API (and for SFX component it&amp;#039;s implemented using slots). &amp;quot;Method&amp;quot; and &amp;quot;property&amp;quot; slots are recorded differently.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The name in the middle of each first line of a block was used as the name of the property or method in the Basic API and today this name is the internal command name that is matched to any &amp;quot;.uno:xxx&amp;quot; CommandURLs of the Dispatch API. As an example, the slot named &amp;quot;Undo&amp;quot; is assigned to the &amp;quot;.uno:Undo&amp;quot; command. This matching requires that the internal command names have to be unique in the complete module. This uniqueness is verified by the svidl compiler that breaks in case if name clashes in a module.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last part of each first line is the so called SlotID that in former times was the real identifier (not as today the internal command name) and it was also used inside the GUI element configuration files where today CommandURLs are used. So this SlotID had to be unique for the module at least, currently it&amp;#039;s even globally unique but at least theoretically it is now obsolete. Inside the slot processing only the textual representation of the SlotID is relevant , not its numerical value.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Property slots have a type specified by the first part of the first line. The same data in a method slot specifies the return value of the associated method. Method slots also can gave parameters (non empty paranthesis) and a return value that could be used in the old Basic API of StarOffice, but also in internal methods of the SfxDispatcher. Strictly speaking the latter is still possible but we try to get rid of this. Here are two examples for slots with arguments, with and without return value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem Undo SID_UNDO&lt;br /&gt;
( SfxUInt16Item Undo SID_UNDO )&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Volatile,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* status */&lt;br /&gt;
    SlotType = SfxStringItem&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_EDIT;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxObjectItem Open SID_OPENDOC&lt;br /&gt;
(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, SfxStringItem OpenFlags SID_OPTIONS,&lt;br /&gt;
SfxStringItem Password SID_PASSWORD, SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS, SfxInt16Item Version SID_VERSION,&lt;br /&gt;
SfxStringItem Referer SID_REFERER)&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = TRUE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Asynchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As shown in the examples, property types and return values are given as &amp;#039;&amp;#039;Items&amp;#039;&amp;#039;, the whole slot &amp;quot;API&amp;quot; is based on SfxPoolItems, each identified by its ID. These IDs must be unique only in the context of the method.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Slots are used to bind their functionality to UI elements. In former times this was done by writing the SlotIDs into the UI element configuration files, today we use CommandURLs. Binding slots to UI elements (today indirectly through the &amp;#039;&amp;#039;Dispatch Object&amp;#039;&amp;#039;) means that the binding client wants to get status information from it and/or possibly wants to execute it, in most cases (means: the standard controllers) without any parameters.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The type of the status update information is given by the &amp;#039;&amp;#039;SlotType&amp;#039;&amp;#039; attribute. For property slots like &amp;quot;DesignerDialog&amp;quot; this is identical with its property type (and so this attribute is not explictly assigned in the block), for method slots it must be specified like shown in the &amp;quot;Undo&amp;quot; example. If a method slot doesn&amp;#039;t specify a SlotType it has no status (except &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; or &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;). So in the examples &amp;quot;Undo&amp;quot; is of type String, &amp;quot;DesignerDialog&amp;quot; of type Boolean while the other slots don&amp;#039;t have a status.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A menu controller will reflect this by showing status of the &amp;quot;Undo&amp;quot; entry as its title and setting or unsetting a check mark in front of the &amp;quot;DesignerDialof&amp;quot; entry reflecting its boolean status, a toolbar controller reflects the latter one in a pressed/unpressed state, the former in different button titles (or quick help texts that replace the button title if it&amp;#039;s switched off). Other types of status information need speccialized controller that know how to deal with this kind of information.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All the other attributes inside the block of a slot are &amp;#039;&amp;#039;flags&amp;#039;&amp;#039; that define the behavior of the slot at runtime. Some of the attributes are contradicting (like synchron or asynchron) and so of course only one of them can be set. The table below sums them up in one line.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;80%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!width=&amp;quot;40%&amp;quot;|Attribute&lt;br /&gt;
!width=&amp;quot;60%&amp;quot;|Meaning&lt;br /&gt;
|-&lt;br /&gt;
||Cachable (Volatile)|| Slot status is cached, sending a new status to controllers need an &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call that forces SFX to fetch a new status. Volatile slots are not cached and SFX permanently asks for status information based on a timer.&lt;br /&gt;
|-&lt;br /&gt;
|AutoUpdate || TRUE: After execution of the slot SFX automatically fetches the new status, no &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call necessary&lt;br /&gt;
|-&lt;br /&gt;
|FastCall || TRUE: SFX doesn&amp;#039;t check &amp;quot;enable&amp;quot; status before executing a slot&lt;br /&gt;
|-&lt;br /&gt;
|Toggle || Execute without parameters automatically toggles the current status. Works for property slots with boolean or enum type.&lt;br /&gt;
|-&lt;br /&gt;
|HasCoreId || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|HasDialog || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|ReadOnlyDoc || FALSE: SFX automatically disables this slot if the document is read only&lt;br /&gt;
|-&lt;br /&gt;
|Container || TRUE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the object.&amp;lt;br/&amp;gt;FALSE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the container.&lt;br /&gt;
|-&lt;br /&gt;
|RecordAbsolute || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|RecordPerSet (RecordPerItem, NoRecord) || See explanation for Recording.&lt;br /&gt;
|-&lt;br /&gt;
|Synchron (Asynchron) || Asynchron: SFX execute the slot by posting a user event instead of directly calling the execute function of the slot&lt;br /&gt;
|-&lt;br /&gt;
|Readonly || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|AccelConfig || Slot may be offered in the configuration dialog for keyboard shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|MenuConfig || Slot may be offered in the configuration dialog for menus&lt;br /&gt;
|-&lt;br /&gt;
|StatusBarConfig || Slot may be offered in the configuration dialog for status bar&lt;br /&gt;
|-&lt;br /&gt;
|ToolboxConfig || Slot may be offered in the configuration dialog for toolbars&lt;br /&gt;
|-&lt;br /&gt;
|GroupId || Assign the slot to a function group in the configuration dialogs (module is free to define categories)&lt;br /&gt;
|-&lt;br /&gt;
|ImageRotation || Toolbar images are rotated in case of writing direction from right to left&lt;br /&gt;
|-&lt;br /&gt;
|ImageReflection || Toolbar images are rotated in case of vertical text orientation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interface definitions ===&lt;br /&gt;
&lt;br /&gt;
As already mentioned, slots are bundled to interfaces and interfaces are used by shells. SDI files know both terms. Here&amp;#039;s an example how this looks. For clarity only a few slots are shown, the read file contains much more of them.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
interface Document : Object&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE ;&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_CLOSEDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface OfficeDocument : Document&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_DOC_MODIFIED&lt;br /&gt;
    [&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    SID_PRINTDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = PrintExec_Impl ;&lt;br /&gt;
        StateMethod = NoState ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
shell SfxObjectShell&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    import OfficeDocument [AUTOMATION];&lt;br /&gt;
&lt;br /&gt;
    SID_DOCINFO&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The interface term is used slightly different in the sdi files that it is used by SFX, so now we use the name &amp;quot;slot arrays&amp;quot; for what the SFX itself calls &amp;quot;interfaces&amp;quot; to avoid confusion.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As a residue of the old Basic API sdi files define interfaces and shells separately, thus differentiating between slots for both Basic and UI usage and slots only used for UI purposes. This is obsolete today, but still used. Additionally sdi files define base and derived interfaces and shells in a granularity we don&amp;#039;t need anymore, but this is also a residue of the StarBasic support. This might change in the near future. Some interfaces even contained real basic properties that are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; represented by slots at all (like the &amp;quot;object&amp;quot; interface referenced in the example) but they are not used anymore.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;shell&amp;quot; defined in the file references a C++ implementation class SfxObjectShell. This part of the sdi file defines the complete slot interface of this class. The &amp;quot;import&amp;quot; statement tells the svidl compiler that it should add all slots of the interface &amp;quot;OfficeDocument&amp;quot; here (and of course all slots of its &amp;quot;base class&amp;quot; interfaces).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;Automation&amp;quot; attribute that is assigned to both interfaces and shells tells the svidl compiler whether it should generate a slot array definition for this interface/shell or not. We only generate arrays for shell, not for interfaces (because we don&amp;#039;t need them anymore). In former times we also generated arrays for interfaces, and the &amp;quot;Automation&amp;quot; attribute allowed us to prevent svidl from generating them for base class interfaces also. The &amp;quot;Automation&amp;quot; attribute will become obsolete pretty soon.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the interface/shell definition block slots are referenced by their SlotID. Svidl will get all attributes of the slot it needs to generate the array definition from the slot definition (that of course needs to be included and processed before svidl gets to the shell definition). In the block below this identifier (again with rectangular brackets) two additional attributes are specified: the names of one or two methods can be defined that SFX calls to get status information or execute the slot. These methods have a prescribed signature:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Class::StateMethod( SfxItemSet&amp;amp; );&lt;br /&gt;
void Class::ExecMethod( SfxRequest&amp;amp; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The ItemSet is used to collect the status information, the SfxRequest contains everything necessary for the execution of a slot.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The svidl compiler takes the shell class name and the method name and generates an inline stub function that calls the C++ member. A pointer to each stub is generated into the slot definitions. The stubs are generated into the same header file that contains the generated arrays. Here is an example for the first slot of the interface &amp;quot;Document&amp;quot; shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_EXEC_STUB( SfxObjectShell, ExecFile_Impl )&lt;br /&gt;
SFX_STATE_STUB( SfxObjectShell, GetState_Impl )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We use function stubs here because pointer to member functions don&amp;#039;t have a fixed size and so we can&amp;#039;t store them inside a struct like SfxSlot. A pointer to a C function always has the same size as normal pointer on the machine.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The slots in our example show that both pointers can be set or only one of them. A slot without an &amp;quot;Exec&amp;quot; function is a slot that only has a status, execution is done by another slot. A slot without a &amp;quot;GetState&amp;quot; function is always enabled and has no status. SFX automatically generates empty stub in these cases.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the block defining the functions theoretically all slot attributes of the referenced slot can be overwritten and sometimes this can be found. This should be seen as exceptional cases and it might happen in the near future that this overwriting will become forbidden for more and more attributes. The benefit of this is very limited but the risk of dangerous inconsistencies is high.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Here&amp;#039;s an exerpt of the generated header file that belongs to the SID_CLOSEDOC slot shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_SLOTMAP_ARG(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
// Slot Nr. 0 : 5502&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_SAVEASDOC,SID_SAVEASDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[1] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                0/*Offset*/, 9/*Count*/,&amp;quot;.SaveAs&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;SaveAs&amp;quot; ),&lt;br /&gt;
// Slot Nr.1 : 5503&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_CLOSEDOC,SID_CLOSEDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[3] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                9/*Offset*/, 2/*Count*/,&amp;quot;.CloseDoc&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;CloseDoc&amp;quot; ),&lt;br /&gt;
// Slot Nr.2 : 5504&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_PRINTDOC,SID_PRINTDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[2] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR_NONE,&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                11/*Offset*/, 10/*Count*/,&amp;quot;.Print&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;Print&amp;quot; ),&lt;br /&gt;
&lt;br /&gt;
         // ... to be continued ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The SFX_NEW_SLOT_ARG macro initializes a complete slot. Most of it should be pretty obvious from what was described already, please note the macros for the generated stubs (and especially SFX_STUB_PTR_STATE_NONE for the empty stub).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An interesting addition is the second line of each block, it contains an &amp;quot;Offset Next&amp;quot;. It is a pointer that points to the next slot in this shell that uses the same &amp;quot;GetState&amp;quot; method as the current slot. This enables SFX to collects status information for several slots at once when a complete update is requested. In general the shell code allows to group slots together in Exec/GetState methods and have more than one per shell for clarity reasons.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The last line in each block also contains an offset and a count. These attributes point to the arguments of the slot (of course only for methods). All possible arguments of all slots inside a shell are grouped into a single array, arguments that belong to the same slot of course beneath each other. The offset points to the first argument of a slot:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_ARGUMENTMAP(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_NAME,&amp;quot;URL&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILTER_NAME,&amp;quot;FilterName&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_PASSWORD,&amp;quot;Password&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,&amp;quot;FilterOptions&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_COMMENTS,&amp;quot;VersionComment&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_AUTHOR,&amp;quot;VersionAuthor&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_OVERWRITE,&amp;quot;Overwrite&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_UNPACK,&amp;quot;Unpacked&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_SAVETO,&amp;quot;SaveTo&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_SAVE,&amp;quot;SaveChanges&amp;quot;,SfxBoolItem),    // &amp;lt;---- here args for SID_CLOSEDOC start&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_FILENAME,&amp;quot;FileName&amp;quot;,SfxStringItem), // &amp;quot;count&amp;quot; is 2, so this is the second one&lt;br /&gt;
&lt;br /&gt;
    // ... to be continued ...&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In each module one header file containing all shells is created. It must be included in the source file of each shell class that contains the SFX_IMPL_INTERFACE macro. To avoid multiple definitions of the slot arrays by this multiple inclusion each code block assigned to a particular shell is framed by an &amp;quot;#ifdef ClassName&amp;quot; block, so in the source file the typical code sequence is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define SfxObjectShell&lt;br /&gt;
#include &amp;quot;sfxslots.hxx&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Other parts of the header file are framed by &amp;quot;#ifdef SFX_TYPEMAP&amp;quot; and this part mustbe activated only once also so each module contains one file that includes the generated header file and defined SFX_TYPEMAP before. This can be on e of the shell files that also defines its shell interface or it can be a different one. The part of the generated header file that is activated here is not necessary for the SFX core (the slot dispatching), but was necessary in former times for the type information of the old Basic API and for macro recording. Today it is used for the wrapper that mediates between SFX dispatching and the Dispatch API and thus also for macro recording because the current macro recorder also uses the Dispatch API.&lt;br /&gt;
&lt;br /&gt;
=== Items and UNO structs ===&lt;br /&gt;
&lt;br /&gt;
The old SFX based Basic API was made up by the property and method slot defined in the sdi files. All types are specified as SfxPoolItems and this was fine for StarBasic because internally these types are used also (for Sbx classes). For recording purposes it was necessary to know the &amp;quot;real&amp;quot; types behind a particular SfxPoolItem type and especially structured items needed to be split up into basic types because StarBasic doesn&amp;#039;t support structs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The mapping from a SfxPoolItem to an atomic or structured type is done by using a mapping table in another sdi file. Here&amp;#039;s an example for atomic types from the SFX module:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item void     SfxVoidItem&lt;br /&gt;
item BOOL     SfxBoolItem&lt;br /&gt;
item INT32    SfxUInt16Item&lt;br /&gt;
item INT16    SfxInt16Item&lt;br /&gt;
item INT32    SfxUInt32Item&lt;br /&gt;
item INT32    SfxInt32Item&lt;br /&gt;
item String   SfxStringItem&lt;br /&gt;
item BYTE     SfxByteItem&lt;br /&gt;
item INT16    SfxEnumItem&lt;br /&gt;
item INT16    SfxAllEnumItem&lt;br /&gt;
item INT16    SbxImageItem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It&amp;#039;s pretty straightforward: &amp;quot;item&amp;quot; declares the type to be atomic and it is followed by the Basic (or better: UNO) type and the Item representing it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Structured types are a little bit more complicated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
struct Point&lt;br /&gt;
{&lt;br /&gt;
    INT32    X    MID_X;&lt;br /&gt;
    INT32    Y    MID_Y;&lt;br /&gt;
};&lt;br /&gt;
item Point SfxPointItem;&lt;br /&gt;
&lt;br /&gt;
struct Rectangle&lt;br /&gt;
{&lt;br /&gt;
    INT32    Left    MID_RECT_LEFT;&lt;br /&gt;
    INT32    Top     MID_RECT_TOP;&lt;br /&gt;
    INT32    Width   MID_WIDTH;&lt;br /&gt;
    INT32    Height  MID_HEIGHT;&lt;br /&gt;
};&lt;br /&gt;
item Rectangle SfxRectangleItem;&lt;br /&gt;
&lt;br /&gt;
struct DocInfo&lt;br /&gt;
{&lt;br /&gt;
    BOOL    UseUserData    MID_DOCINFO_USEUSERDATA;&lt;br /&gt;
    BOOL    DeleteUserData MID_DOCINFO_DELETEUSERDATA;&lt;br /&gt;
    String  Title          MID_DOCINFO_TITLE;&lt;br /&gt;
    String  Subject        MID_DOCINFO_SUBJECT;&lt;br /&gt;
    String  KeyWords       MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    String  Description    MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    BOOL    AutoReload     MID_DOCINFO_AUTOLOADENABLED;&lt;br /&gt;
};&lt;br /&gt;
item DocInfo SfxDocumentInfoItem;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The examples show simple structs like a Point or more complex structs like a DocInfo. Structs can be nested, a DocInfo could contain a Point also. In the old StarBasic and also in todays macro recording each member of a struct was represented by an individual item (so an ID was needed that is unique in the complete argument set) and the names of these arguments were assembled from the name of the struct parameter name and the member name in the obvious from ArgName.MemberName.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For some items that are used only internally SFX based code (but not for recording purposes) no mapping was necessary and for syntactical completeness they are mapped to any atomic type, but his mapping is never used:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item String    SbxItem;                //! Dummy&lt;br /&gt;
item String    SfxObjectItem;          //! Dummy&lt;br /&gt;
item String    SfxTemplateItem;        //! Dummy&lt;br /&gt;
item String    SfxMacroInfoItem;       //! Dummy&lt;br /&gt;
item String    SfxImageItem;           //! Dummy&lt;br /&gt;
item String    SfxFrameItem;           //! Dummy&lt;br /&gt;
item String    SfxObjectShellItem;     //! Dummy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The svidl compiler creates the type mappings into the following form:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// example for an atomic type&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType0 aSfxStringItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxStringItem), 0&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
// example for a struct with 4 members&lt;br /&gt;
extern SfxType4 aSfxRectangleItem_Impl;&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType4 aSfxRectangleItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxRectangleItem}, 4, { {MID_RECT_LEFT,&amp;quot;Left&amp;quot;}, {MID_RECT_TOP,&amp;quot;Top&amp;quot;}, {MID_WIDTH,&amp;quot;Width&amp;quot;},&lt;br /&gt;
{MID_HEIGHT,&amp;quot;Height&amp;quot;} }&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It utilizes the TOOLS based RTTI that allows to offer a static factory method by using one of the TYPEINIT_AUTOFACTORY macros. This factory that can be used to create an item of the particular class. This is very important for the conversion routines that match items to UNO structs and vice versa. An item that does not offer a factory can&amp;#039;t be converted properly and so macro recording and Dispatch API are broken for this item.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The conversion between an item and a UNO type uses the virtual PutValue and QueryValue methods of the items. In the case of macro recording (where only atomic types are allowed) the &amp;quot;MemberID&amp;quot; parameter of these calls is used always in case of structured items and so it is important that the MIDs in the sdi file match the MIDs used in the implementation of the item. As an example, an SfxRectangleItem is recorded as two integer values.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The matching we use for the Dispatch API in our controllers on the other hand always converts to complete structs, not to atomic members, so the SfxRectangleItem is converted to a com.sun.star.awt.Rectangle. The rect Put/QueryValue in this case is called with MID=0. It&amp;#039;s vital for this process that &amp;#039;&amp;#039;&amp;#039;&amp;quot;0&amp;quot; is an invalid MID&amp;#039;&amp;#039;&amp;#039; that must not be used for any member.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Article]]&lt;br /&gt;
[[Category:Framework]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137246</id>
		<title>Framework/Article/Implementation of the Dispatch API In SFX2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137246"/>
		<updated>2009-08-11T16:56:57Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Items and UNO structs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementation of the Dispatch API in SFX2 ==&lt;br /&gt;
&lt;br /&gt;
The Dispatch API as described in chapter 7.1.6 of the Developer&amp;#039;s Guide is the backbone of our communication between &amp;quot;generic&amp;quot; UI elements and the document core implementations.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Traditionally SFX based components implemented this communication with a much older framework based on the so called &amp;#039;&amp;#039;slots&amp;#039;&amp;#039; and their organization into &amp;#039;&amp;#039;shells&amp;#039;&amp;#039;. While up to OpenOffice.org 1.1 our generic UI elements (menus, toolbars, etc.) still used the SFX based API directly to a large degree in OpenOffice.org 2.0 we changed this to using the Dispatch API exclusively, thus enabling us to share the UI components with other, not SFX based components. This paper describes how the old SFX implementation is matched to the &amp;#039;&amp;#039;DispatchProvider&amp;#039;&amp;#039; implementation that the component provides to the outside to make this happen.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The basic entity in the dispatch API is a command, and it&amp;#039;s represented by a &amp;#039;&amp;#039;CommandURL&amp;#039;&amp;#039;. For simplifications we suppose that this CommandURL is a string (though the API transport it as a pre-parsed struct). All commands supported by our components have the form &amp;#039;&amp;#039;.uno:xxxxx&amp;#039;&amp;#039; for historical reasons, where &amp;#039;&amp;#039;xxxxx&amp;#039;&amp;#039; represents an internal command name. Examples are “.uno:Print” or “.uno:Paste”. The functionality provided by the Dispatch API is support to execute such commands and getting status information for them (enabled/disabled or explicit information if the commands represents something type, a boolean, a string etc.).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As explained in the Developer&amp;#039;s Guide the Dispatch API builds on the idea that such commands can be passed along a chain of Dispatch Provider objects. Every object in this chain is free to decide whether it will handle a command or wants to pass it to the next chain member. Each document window and the Frame object managing it has such a chain of Dispatch providers and at least one object in this chain belongs to the document model/view pair bound to this window. It&amp;#039;s the so called Controller object that amongst other interfaces supports the XDispatchProvider interface. &lt;br /&gt;
&lt;br /&gt;
=== Controller objects in SFX2 ===&lt;br /&gt;
&lt;br /&gt;
SFX2 based components share a common base class for their Controller object implementation, SfxBaseController. It has a queryDispatch() implementation of the XDispatchProvider interface where the received CommandURLs are compared with the CommandURLs in the set of commands the particular component supports. It uses some comparable functionality in the old SFX2 framework that also is able to execute commands and give status information about them. The main difference between the old SFX2 base framework and the UNO framework is that the latter defines commands by strings (CommandURLs) and the former does it by integer values (SlotID, see below). So the main job of the queryDispatch() implementation in the SfxBaseController is to match a commandURL to the corresponding SlotID and then proceed using the internal old SFX2 implementation.&lt;br /&gt;
&lt;br /&gt;
SFX2 organizes functionality in contexts that can be merged together and exposed to the outside world by a single point of contact. This contact point is an SfxDispatcher object that every SfxBaseController owns. [Remark: this ownership is indirect as the real owner of the SfxDispatcher is an SfxViewFrame; but there is always a 1:1 relationship between an SfxViewFrame and an SfxBaseController.]&lt;br /&gt;
The SfxDispatcher internally maintains a stack of objects, each representing a context. Examples for these contexts are “document”, “view”, “text”, “table”, “cell” etc. All these objects are derived from a common base class “SfxShell”. The complete stack of all contextual objects available in a particular situation, the “merged context”, represents the function set applicable to the current selection or cursor position in a document. Context changes inside the document&amp;#039;s editing window cause pushing and popping of shell objects to and from the stack. &lt;br /&gt;
&lt;br /&gt;
This is how a typical stack in Writer looks when the cursor is in a normal text paragraph:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The same stack when the cursor is in a text paragraph in a table:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* Table&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
Another stack when a graphic is selected:&lt;br /&gt;
&lt;br /&gt;
* Graphic&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Frame&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Application&amp;#039;&amp;#039; contexts are there for historical reasons, we are still in the process of moving their functionality to the framework where other &amp;#039;&amp;#039;DispatchProviders&amp;#039;&amp;#039; outside of the component take over. I omitted the &amp;quot;Form&amp;quot; context here because it&amp;#039;s somewhat confusing.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slots and Interfaces ==&lt;br /&gt;
&lt;br /&gt;
Each SfxShell class has a static member called SfxInterface. It is an object containing an array of SfxSlot structs. Each “slot” represents a command supported by the context (shell) it is assigned to. So the complete SfxInterface defines the functionality an instance of the particular SfxShell class using this interface provides.&lt;br /&gt;
&lt;br /&gt;
=== The SfxSlot struct ===&lt;br /&gt;
&lt;br /&gt;
The “slot” struct contains all necessary information that the SfxDispatcher needs to work together with the Shell object containing the slot. The slot contains function pointers that the dispatcher can call to either execute the command represented by the slot or get status information about it. Thus the dispatcher doesn&amp;#039;t need to know the concrete implementation classes of the shells, it can work with them through their base class (SfxShell) interface.&lt;br /&gt;
&lt;br /&gt;
Other important parts of the SfxSlot struct are the “name” of the slot and the numerical ID of it, its so called SlotID. Slot names have been chosen so that they match the part after the colon in “.uno:...” CommandURLs. Mapping between CommandURLs and SlotIDs to then need a simple lookup in all SfxInterfaces of the SfxShells on the shell stack of the SfxDispatcher. More about slots can be found below. &lt;br /&gt;
&lt;br /&gt;
When the SfxDispatcher is asked for support of a particular command it searches for a slot with the given internal command name starting with the top most shell on the stack and then proceeding with the next one until success. This way “higher prioritized” contexts can overrule functionality from “lower prioritized” contexts. As an example, the “document” context has a generic implementation of the “Print” command, but each particular “view” context can overrule the generic behavior and define a specific way of printing. &lt;br /&gt;
&lt;br /&gt;
=== The SfxInterface class ===&lt;br /&gt;
&lt;br /&gt;
The slot arrays aka SfxInterfaces are static to each shell class and so each interface is a part of the data segment of the library that contains the shell code assigned to this interface. The data for these arrays needs to be predefined in source files. Writing huge arrays into C++ source files is a very tedious work and so we use a different kind of source file that is easier to edit and have a compiler (“svidl”) that takes these files and compiles them into a generated header file containing the definition of the arrays. These idl files are located in the sdi sub folders of each SFX based project and have the extension “sdi”. The generated header file contains the definitions (not only declarations) of all “interfaces” of the library and some “#define” magic allows to have each interface generated only once. More about this process below.&lt;br /&gt;
&lt;br /&gt;
=== Slots, interfaces, shells, dispatchers ===&lt;br /&gt;
&lt;br /&gt;
In OOo1.x the SfxBaseController utilized its SfxDispatcher and its stack to provide a generic Dispatch object for every supported command. It gets the CommandURL in the queryDispatch call, looks for a slot on the dispatcher stack with a suitable internal command name and in case of success creates a dispatch object and returns it. There is a drawback in this approach: if the context changes (means: shells are pushed or popped) slots might appear or disappear from the stack so commands that had been supported aren&amp;#039;t any longer or the other way around. This forces the DispatchProvider to request a complete refetching of all dispatch objects and so can be time consuming.&lt;br /&gt;
&lt;br /&gt;
In OOo2.x we utilize the “slot pool” of the SFX based modules. This is the entirety of all “interfaces” (slot arrays) the module supports. On startup all interfaces register at the module class (SfxModule base class) so it is easy to iterate through its interfaces. Now a Dispatch Object is returned when the slot is found anywhere in the slot pool, even if the interface is not on the stack, but in this case the Dispatch Object reports its slots as disabled everytime it is used. This can be determined dynamically so context changes don&amp;#039;t need external updates, it&amp;#039;s enough to update the internal status of the already created Dispatch Objects. This approach also enables some future optimizations for the representation of slot arrays that will be discussed later.&lt;br /&gt;
&lt;br /&gt;
== Slot Processing ==&lt;br /&gt;
&lt;br /&gt;
In former (Pre-UNO) time the slots where not only used for command dispatching but also for the implementation of our Basic API (up to StarOffice 5.2), so the slot arrays where &amp;quot;real&amp;quot; &amp;#039;&amp;#039;interfaces&amp;#039;&amp;#039;. There are a lot residues of the in the sdi files (see below), but they aren&amp;#039;t used anymore.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slot definitions ===&lt;br /&gt;
&lt;br /&gt;
The use case explains why there are two different kinds of slots, property slots and method slots, and the difference between them can be spotted easily from the definition of a slot in the sdi file. Here are two examples, the first one describing a method slot and the second one describing a property slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem About SID_ABOUT&lt;br /&gt;
()&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxBoolItem DesignerDialog SID_STYLE_DESIGNER&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = TRUE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = TRUE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    Readyonly = FALSE,&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_FORMAT;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each slot is a block in rectangular bracket filled with attributes that is preceded by two lines that identify the slot and define its nature. The exact meaning of all the attributes is explained below, the most notable difference is seen in the second line of each block: the paranthesis of the &amp;quot;About&amp;quot; slot classify it as a method while the other one (without paranthesis) is a property. As explained above, this classification goes back to the old Basic API but besides that it&amp;#039;s important for the implementation of macro recording that is also based on the Dispatch API (and for SFX component it&amp;#039;s implemented using slots). &amp;quot;Method&amp;quot; and &amp;quot;property&amp;quot; slots are recorded differently.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The name in the middle of each first line of a block was used as the name of the property or method in the Basic API and today this name is the internal command name that is matched to any &amp;quot;.uno:xxx&amp;quot; CommandURLs of the Dispatch API. As an example, the slot named &amp;quot;Undo&amp;quot; is assigned to the &amp;quot;.uno:Undo&amp;quot; command. This matching requires that the internal command names have to be unique in the complete module. This uniqueness is verified by the svidl compiler that breaks in case if name clashes in a module.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last part of each first line is the so called SlotID that in former times was the real identifier (not as today the internal command name) and it was also used inside the GUI element configuration files where today CommandURLs are used. So this SlotID had to be unique for the module at least, currently it&amp;#039;s even globally unique but at least theoretically it is now obsolete. Inside the slot processing only the textual representation of the SlotID is relevant , not its numerical value.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Property slots have a type specified by the first part of the first line. The same data in a method slot specifies the return value of the associated method. Method slots also can gave parameters (non empty paranthesis) and a return value that could be used in the old Basic API of StarOffice, but also in internal methods of the SfxDispatcher. Strictly speaking the latter is still possible but we try to get rid of this. Here are two examples for slots with arguments, with and without return value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem Undo SID_UNDO&lt;br /&gt;
( SfxUInt16Item Undo SID_UNDO )&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Volatile,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* status */&lt;br /&gt;
    SlotType = SfxStringItem&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_EDIT;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxObjectItem Open SID_OPENDOC&lt;br /&gt;
(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, SfxStringItem OpenFlags SID_OPTIONS,&lt;br /&gt;
SfxStringItem Password SID_PASSWORD, SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS, SfxInt16Item Version SID_VERSION,&lt;br /&gt;
SfxStringItem Referer SID_REFERER)&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = TRUE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Asynchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As shown in the examples, property types and return values are given as &amp;#039;&amp;#039;Items&amp;#039;&amp;#039;, the whole slot &amp;quot;API&amp;quot; is based on SfxPoolItems, each identified by its ID. These IDs must be unique only in the context of the method.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Slots are used to bind their functionality to UI elements. In former times this was done by writing the SlotIDs into the UI element configuration files, today we use CommandURLs. Binding slots to UI elements (today indirectly through the &amp;#039;&amp;#039;Dispatch Object&amp;#039;&amp;#039;) means that the binding client wants to get status information from it and/or possibly wants to execute it, in most cases (means: the standard controllers) without any parameters.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The type of the status update information is given by the &amp;#039;&amp;#039;SlotType&amp;#039;&amp;#039; attribute. For property slots like &amp;quot;DesignerDialog&amp;quot; this is identical with its property type (and so this attribute is not explictly assigned in the block), for method slots it must be specified like shown in the &amp;quot;Undo&amp;quot; example. If a method slot doesn&amp;#039;t specify a SlotType it has no status (except &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; or &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;). So in the examples &amp;quot;Undo&amp;quot; is of type String, &amp;quot;DesignerDialog&amp;quot; of type Boolean while the other slots don&amp;#039;t have a status.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A menu controller will reflect this by showing status of the &amp;quot;Undo&amp;quot; entry as its title and setting or unsetting a check mark in front of the &amp;quot;DesignerDialof&amp;quot; entry reflecting its boolean status, a toolbar controller reflects the latter one in a pressed/unpressed state, the former in different button titles (or quick help texts that replace the button title if it&amp;#039;s switched off). Other types of status information need speccialized controller that know how to deal with this kind of information.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All the other attributes inside the block of a slot are &amp;#039;&amp;#039;flags&amp;#039;&amp;#039; that define the behavior of the slot at runtime. Some of the attributes are contradicting (like synchron or asynchron) and so of course only one of them can be set. The table below sums them up in one line.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;80%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!width=&amp;quot;40%&amp;quot;|Attribute&lt;br /&gt;
!width=&amp;quot;60%&amp;quot;|Meaning&lt;br /&gt;
|-&lt;br /&gt;
||Cachable (Volatile)|| Slot status is cached, sending a new status to controllers need an &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call that forces SFX to fetch a new status. Volatile slots are not cached and SFX permanently asks for status information based on a timer.&lt;br /&gt;
|-&lt;br /&gt;
|AutoUpdate || TRUE: After execution of the slot SFX automatically fetches the new status, no &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call necessary&lt;br /&gt;
|-&lt;br /&gt;
|FastCall || TRUE: SFX doesn&amp;#039;t check &amp;quot;enable&amp;quot; status before executing a slot&lt;br /&gt;
|-&lt;br /&gt;
|Toggle || Execute without parameters automatically toggles the current status. Works for property slots with boolean or enum type.&lt;br /&gt;
|-&lt;br /&gt;
|HasCoreId || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|HasDialog || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|ReadOnlyDoc || FALSE: SFX automatically disables this slot if the document is read only&lt;br /&gt;
|-&lt;br /&gt;
|Container || TRUE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the object.&amp;lt;br/&amp;gt;FALSE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the container.&lt;br /&gt;
|-&lt;br /&gt;
|RecordAbsolute || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|RecordPerSet (RecordPerItem, NoRecord) || See explanation for Recording.&lt;br /&gt;
|-&lt;br /&gt;
|Synchron (Asynchron) || Asynchron: SFX execute the slot by posting a user event instead of directly calling the execute function of the slot&lt;br /&gt;
|-&lt;br /&gt;
|Readonly || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|AccelConfig || Slot may be offered in the configuration dialog for keyboard shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|MenuConfig || Slot may be offered in the configuration dialog for menus&lt;br /&gt;
|-&lt;br /&gt;
|StatusBarConfig || Slot may be offered in the configuration dialog for status bar&lt;br /&gt;
|-&lt;br /&gt;
|ToolboxConfig || Slot may be offered in the configuration dialog for toolbars&lt;br /&gt;
|-&lt;br /&gt;
|GroupId || Assign the slot to a function group in the configuration dialogs (module is free to define categories)&lt;br /&gt;
|-&lt;br /&gt;
|ImageRotation || Toolbar images are rotated in case of writing direction from right to left&lt;br /&gt;
|-&lt;br /&gt;
|ImageReflection || Toolbar images are rotated in case of vertical text orientation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interface definitions ===&lt;br /&gt;
&lt;br /&gt;
As already mentioned, slots are bundled to interfaces and interfaces are used by shells. SDI files know both terms. Here&amp;#039;s an example how this looks. For clarity only a few slots are shown, the read file contains much more of them.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
interface Document : Object&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE ;&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_CLOSEDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface OfficeDocument : Document&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_DOC_MODIFIED&lt;br /&gt;
    [&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    SID_PRINTDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = PrintExec_Impl ;&lt;br /&gt;
        StateMethod = NoState ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
shell SfxObjectShell&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    import OfficeDocument [AUTOMATION];&lt;br /&gt;
&lt;br /&gt;
    SID_DOCINFO&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The interface term is used slightly different in the sdi files that it is used by SFX, so now we use the name &amp;quot;slot arrays&amp;quot; for what the SFX itself calls &amp;quot;interfaces&amp;quot; to avoid confusion.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As a residue of the old Basic API sdi files define interfaces and shells separately, thus differentiating between slots for both Basic and UI usage and slots only used for UI purposes. This is obsolete today, but still used. Additionally sdi files define base and derived interfaces and shells in a granularity we don&amp;#039;t need anymore, but this is also a residue of the StarBasic support. This might change in the near future. Some interfaces even contained real basic properties that are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; represented by slots at all (like the &amp;quot;object&amp;quot; interface referenced in the example) but they are not used anymore.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;shell&amp;quot; defined in the file references a C++ implementation class SfxObjectShell. This part of the sdi file defines the complete slot interface of this class. The &amp;quot;import&amp;quot; statement tells the svidl compiler that it should add all slots of the interface &amp;quot;OfficeDocument&amp;quot; here (and of course all slots of its &amp;quot;base class&amp;quot; interfaces).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;Automation&amp;quot; attribute that is assigned to both interfaces and shells tells the svidl compiler whether it should generate a slot array definition for this interface/shell or not. We only generate arrays for shell, not for interfaces (because we don&amp;#039;t need them anymore). In former times we also generated arrays for interfaces, and the &amp;quot;Automation&amp;quot; attribute allowed us to prevent svidl from generating them for base class interfaces also. The &amp;quot;Automation&amp;quot; attribute will become obsolete pretty soon.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the interface/shell definition block slots are referenced by their SlotID. Svidl will get all attributes of the slot it needs to generate the array definition from the slot definition (that of course needs to be included and processed before svidl gets to the shell definition). In the block below this identifier (again with rectangular brackets) two additional attributes are specified: the names of one or two methods can be defined that SFX calls to get status information or execute the slot. These methods have a prescribed signature:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Class::StateMethod( SfxItemSet&amp;amp; );&lt;br /&gt;
void Class::ExecMethod( SfxRequest&amp;amp; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The ItemSet is used to collect the status information, the SfxRequest contains everything necessary for the execution of a slot.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The svidl compiler takes the shell class name and the method name and generates an inline stub function that calls the C++ member. A pointer to each stub is generated into the slot definitions. The stubs are generated into the same header file that contains the generated arrays. Here is an example for the first slot of the interface &amp;quot;Document&amp;quot; shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_EXEC_STUB( SfxObjectShell, ExecFile_Impl )&lt;br /&gt;
SFX_STATE_STUB( SfxObjectShell, GetState_Impl )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We use function stubs here because pointer to member functions don&amp;#039;t have a fixed size and so we can&amp;#039;t store them inside a struct like SfxSlot. A pointer to a C function always has the same size as normal pointer on the machine.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The slots in our example show that both pointers can be set or only one of them. A slot without an &amp;quot;Exec&amp;quot; function is a slot that only has a status, execution is done by another slot. A slot without a &amp;quot;GetState&amp;quot; function is always enabled and has no status. SFX automatically generates empty stub in these cases.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the block defining the functions theoretically all slot attributes of the referenced slot can be overwritten and sometimes this can be found. This should be seen as exceptional cases and it might happen in the near future that this overwriting will become forbidden for more and more attributes. The benefit of this is very limited but the risk of dangerous inconsistencies is high.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Here&amp;#039;s an exerpt of the generated header file that belongs to the SID_CLOSEDOC slot shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_SLOTMAP_ARG(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
// Slot Nr. 0 : 5502&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_SAVEASDOC,SID_SAVEASDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[1] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                0/*Offset*/, 9/*Count*/,&amp;quot;.SaveAs&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;SaveAs&amp;quot; ),&lt;br /&gt;
// Slot Nr.1 : 5503&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_CLOSEDOC,SID_CLOSEDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[3] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                9/*Offset*/, 2/*Count*/,&amp;quot;.CloseDoc&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;CloseDoc&amp;quot; ),&lt;br /&gt;
// Slot Nr.2 : 5504&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_PRINTDOC,SID_PRINTDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[2] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR_NONE,&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                11/*Offset*/, 10/*Count*/,&amp;quot;.Print&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;Print&amp;quot; ),&lt;br /&gt;
&lt;br /&gt;
         // ... to be continued ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The SFX_NEW_SLOT_ARG macro initializes a complete slot. Most of it should be pretty obvious from what was described already, please note the macros for the generated stubs (and especially SFX_STUB_PTR_STATE_NONE for the empty stub).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An interesting addition is the second line of each block, it contains an &amp;quot;Offset Next&amp;quot;. It is a pointer that points to the next slot in this shell that uses the same &amp;quot;GetState&amp;quot; method as the current slot. This enables SFX to collects status information for several slots at once when a complete update is requested. In general the shell code allows to group slots together in Exec/GetState methods and have more than one per shell for clarity reasons.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The last line in each block also contains an offset and a count. These attributes point to the arguments of the slot (of course only for methods). All possible arguments of all slots inside a shell are grouped into a single array, arguments that belong to the same slot of course beneath each other. The offset points to the first argument of a slot:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_ARGUMENTMAP(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_NAME,&amp;quot;URL&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILTER_NAME,&amp;quot;FilterName&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_PASSWORD,&amp;quot;Password&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,&amp;quot;FilterOptions&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_COMMENTS,&amp;quot;VersionComment&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_AUTHOR,&amp;quot;VersionAuthor&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_OVERWRITE,&amp;quot;Overwrite&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_UNPACK,&amp;quot;Unpacked&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_SAVETO,&amp;quot;SaveTo&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_SAVE,&amp;quot;SaveChanges&amp;quot;,SfxBoolItem),    // &amp;lt;---- here args for SID_CLOSEDOC start&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_FILENAME,&amp;quot;FileName&amp;quot;,SfxStringItem), // &amp;quot;count&amp;quot; is 2, so this is the second one&lt;br /&gt;
&lt;br /&gt;
    // ... to be continued ...&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In each module one header file containing all shells is created. It must be included in the source file of each shell class that contains the SFX_IMPL_INTERFACE macro. To avoid multiple definitions of the slot arrays by this multiple inclusion each code block assigned to a particular shell is framed by an &amp;quot;#ifdef ClassName&amp;quot; block, so in the source file the typical code sequence is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define SfxObjectShell&lt;br /&gt;
#include &amp;quot;sfxslots.hxx&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Other parts of the header file are framed by &amp;quot;#ifdef SFX_TYPEMAP&amp;quot; and this part mustbe activated only once also so each module contains one file that includes the generated header file and defined SFX_TYPEMAP before. This can be on e of the shell files that also defines its shell interface or it can be a different one. The part of the generated header file that is activated here is not necessary for the SFX core (the slot dispatching), but was necessary in former times for the type information of the old Basic API and for macro recording. Today it is used for the wrapper that mediates between SFX dispatching and the Dispatch API and thus also for macro recording because the current macro recorder also uses the Dispatch API.&lt;br /&gt;
&lt;br /&gt;
=== Items and UNO structs ===&lt;br /&gt;
&lt;br /&gt;
The old SFX based Basic API was made up by the property and method slot defined in the sdi files. All types are specified as SfxPoolItems and this was fine for StarBasic because internally these types are used also (for Sbx classes). For recording purposes it was necessary to know the &amp;quot;real&amp;quot; types behind a particular SfxPoolItem type and especially structured items needed to be split up into basic types because StarBasic doesn&amp;#039;t support structs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The mapping from a SfxPoolItem to an atomic or structured type is done by using a mapping table in another sdi file. Here&amp;#039;s an example for atomic types from the SFX module:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item void     SfxVoidItem&lt;br /&gt;
item BOOL     SfxBoolItem&lt;br /&gt;
item INT32    SfxUInt16Item&lt;br /&gt;
item INT16    SfxInt16Item&lt;br /&gt;
item INT32    SfxUInt32Item&lt;br /&gt;
item INT32    SfxInt32Item&lt;br /&gt;
item String   SfxStringItem&lt;br /&gt;
item BYTE     SfxByteItem&lt;br /&gt;
item INT16    SfxEnumItem&lt;br /&gt;
item INT16    SfxAllEnumItem&lt;br /&gt;
item INT16    SbxImageItem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It&amp;#039;s pretty straightforward: &amp;quot;item&amp;quot; declares the type to be atomic and it is followed by the Basic (or better: UNO) type and the Item representing it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Structured types are a little bit more complicated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
struct Point&lt;br /&gt;
{&lt;br /&gt;
    INT32    X    MID_X;&lt;br /&gt;
    INT32    Y    MID_Y;&lt;br /&gt;
};&lt;br /&gt;
item Point SfxPointItem;&lt;br /&gt;
&lt;br /&gt;
struct Rectangle&lt;br /&gt;
{&lt;br /&gt;
    INT32    Left    MID_RECT_LEFT;&lt;br /&gt;
    INT32    Top     MID_RECT_TOP;&lt;br /&gt;
    INT32    Width   MID_WIDTH;&lt;br /&gt;
    INT32    Height  MID_HEIGHT;&lt;br /&gt;
};&lt;br /&gt;
item Rectangle SfxRectangleItem;&lt;br /&gt;
&lt;br /&gt;
struct DocInfo&lt;br /&gt;
{&lt;br /&gt;
    BOOL    UseUserData    MID_DOCINFO_USEUSERDATA;&lt;br /&gt;
    BOOL    DeleteUserData MID_DOCINFO_DELETEUSERDATA;&lt;br /&gt;
    String  Title          MID_DOCINFO_TITLE;&lt;br /&gt;
    String  Subject        MID_DOCINFO_SUBJECT;&lt;br /&gt;
    String  KeyWords       MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    String  Description    MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    BOOL    AutoReload     MID_DOCINFO_AUTOLOADENABLED;&lt;br /&gt;
};&lt;br /&gt;
item DocInfo SfxDocumentInfoItem;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The examples show simple structs like a Point or more complex structs like a DocInfo. Structs can be nested, a DocInfo could contain a Point also. In the old StarBasic and also in todays macro recording each number of a struct was represented by an individual item (so an ID was needed that is unique in the complete argument set) and the names of these arguments where assembled from the name of the struct parameter name and the member name in the obvious from ArgName.MemberName.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For some items that are used only internally SFX based code (but not for recording purposes) no mapping was necessary and for syntactical completeness they are mapped to any atomic type, but his mapping is never used:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item String    SbxItem;                //! Dummy&lt;br /&gt;
item String    SfxObjectItem;          //! Dummy&lt;br /&gt;
item String    SfxTemplateItem;        //! Dummy&lt;br /&gt;
item String    SfxMacroInfoItem;       //! Dummy&lt;br /&gt;
item String    SfxImageItem;           //! Dummy&lt;br /&gt;
item String    SfxFrameItem;           //! Dummy&lt;br /&gt;
item String    SfxObjectShellItem;     //! Dummy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The svidl compiler creates the type mappings into the following form:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// example for an atomic type&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType0 aSfxStringItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxStringItem), 0&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
// example for a struct with 4 members&lt;br /&gt;
extern SfxType4 aSfxRectangleItem_Impl;&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType4 aSfxRectangleItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxRectangleItem}, 4, { {MID_RECT_LEFT,&amp;quot;Left&amp;quot;}, {MID_RECT_TOP,&amp;quot;Top&amp;quot;}, {MID_WIDTH,&amp;quot;Width&amp;quot;},&lt;br /&gt;
{MID_HEIGHT,&amp;quot;Height&amp;quot;} }&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It utilizes the TOOLS based RTTI that allows to offer a static factory method by using one of the TYPEINIT_AUTOFACTORY macros. This factory that can be used to create an item of the particular class. This is very important for the conversion routines that match items to UNO structs and vice versa. An item that does not offer a factory can&amp;#039;t be converted properly and so macro recording and Dispatch API are broken for this item.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The conversion between an item and a UNO type uses the virtual PutValue and QueryValue methods of the items. In the case of macro recording (where only atomic types are allowed) the &amp;quot;MemberID&amp;quot; parameter of these calls is used always in case of structured items and so it is important that the MIDs in the sdi file match the MIDs used in the implementation of the item. As an example, an SfxRectangleItem is recorded as two integer values.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The matching we use for the Dispatch API in our controllers on the other hand always converts to complete structs, not to atomic members, so the SfxRectangleItem is converted to a com.sun.star.awt.Rectangle. The rect Put/QueryValue in this case is called with MID=0. It&amp;#039;s vital for this process that &amp;#039;&amp;#039;&amp;#039;&amp;quot;0&amp;quot; is an invalid MID&amp;#039;&amp;#039;&amp;#039; that must not be used for any member.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Article]]&lt;br /&gt;
[[Category:Framework]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137245</id>
		<title>Framework/Article/Implementation of the Dispatch API In SFX2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137245"/>
		<updated>2009-08-11T16:56:26Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Items and UNO structs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementation of the Dispatch API in SFX2 ==&lt;br /&gt;
&lt;br /&gt;
The Dispatch API as described in chapter 7.1.6 of the Developer&amp;#039;s Guide is the backbone of our communication between &amp;quot;generic&amp;quot; UI elements and the document core implementations.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Traditionally SFX based components implemented this communication with a much older framework based on the so called &amp;#039;&amp;#039;slots&amp;#039;&amp;#039; and their organization into &amp;#039;&amp;#039;shells&amp;#039;&amp;#039;. While up to OpenOffice.org 1.1 our generic UI elements (menus, toolbars, etc.) still used the SFX based API directly to a large degree in OpenOffice.org 2.0 we changed this to using the Dispatch API exclusively, thus enabling us to share the UI components with other, not SFX based components. This paper describes how the old SFX implementation is matched to the &amp;#039;&amp;#039;DispatchProvider&amp;#039;&amp;#039; implementation that the component provides to the outside to make this happen.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The basic entity in the dispatch API is a command, and it&amp;#039;s represented by a &amp;#039;&amp;#039;CommandURL&amp;#039;&amp;#039;. For simplifications we suppose that this CommandURL is a string (though the API transport it as a pre-parsed struct). All commands supported by our components have the form &amp;#039;&amp;#039;.uno:xxxxx&amp;#039;&amp;#039; for historical reasons, where &amp;#039;&amp;#039;xxxxx&amp;#039;&amp;#039; represents an internal command name. Examples are “.uno:Print” or “.uno:Paste”. The functionality provided by the Dispatch API is support to execute such commands and getting status information for them (enabled/disabled or explicit information if the commands represents something type, a boolean, a string etc.).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As explained in the Developer&amp;#039;s Guide the Dispatch API builds on the idea that such commands can be passed along a chain of Dispatch Provider objects. Every object in this chain is free to decide whether it will handle a command or wants to pass it to the next chain member. Each document window and the Frame object managing it has such a chain of Dispatch providers and at least one object in this chain belongs to the document model/view pair bound to this window. It&amp;#039;s the so called Controller object that amongst other interfaces supports the XDispatchProvider interface. &lt;br /&gt;
&lt;br /&gt;
=== Controller objects in SFX2 ===&lt;br /&gt;
&lt;br /&gt;
SFX2 based components share a common base class for their Controller object implementation, SfxBaseController. It has a queryDispatch() implementation of the XDispatchProvider interface where the received CommandURLs are compared with the CommandURLs in the set of commands the particular component supports. It uses some comparable functionality in the old SFX2 framework that also is able to execute commands and give status information about them. The main difference between the old SFX2 base framework and the UNO framework is that the latter defines commands by strings (CommandURLs) and the former does it by integer values (SlotID, see below). So the main job of the queryDispatch() implementation in the SfxBaseController is to match a commandURL to the corresponding SlotID and then proceed using the internal old SFX2 implementation.&lt;br /&gt;
&lt;br /&gt;
SFX2 organizes functionality in contexts that can be merged together and exposed to the outside world by a single point of contact. This contact point is an SfxDispatcher object that every SfxBaseController owns. [Remark: this ownership is indirect as the real owner of the SfxDispatcher is an SfxViewFrame; but there is always a 1:1 relationship between an SfxViewFrame and an SfxBaseController.]&lt;br /&gt;
The SfxDispatcher internally maintains a stack of objects, each representing a context. Examples for these contexts are “document”, “view”, “text”, “table”, “cell” etc. All these objects are derived from a common base class “SfxShell”. The complete stack of all contextual objects available in a particular situation, the “merged context”, represents the function set applicable to the current selection or cursor position in a document. Context changes inside the document&amp;#039;s editing window cause pushing and popping of shell objects to and from the stack. &lt;br /&gt;
&lt;br /&gt;
This is how a typical stack in Writer looks when the cursor is in a normal text paragraph:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The same stack when the cursor is in a text paragraph in a table:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* Table&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
Another stack when a graphic is selected:&lt;br /&gt;
&lt;br /&gt;
* Graphic&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Frame&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Application&amp;#039;&amp;#039; contexts are there for historical reasons, we are still in the process of moving their functionality to the framework where other &amp;#039;&amp;#039;DispatchProviders&amp;#039;&amp;#039; outside of the component take over. I omitted the &amp;quot;Form&amp;quot; context here because it&amp;#039;s somewhat confusing.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slots and Interfaces ==&lt;br /&gt;
&lt;br /&gt;
Each SfxShell class has a static member called SfxInterface. It is an object containing an array of SfxSlot structs. Each “slot” represents a command supported by the context (shell) it is assigned to. So the complete SfxInterface defines the functionality an instance of the particular SfxShell class using this interface provides.&lt;br /&gt;
&lt;br /&gt;
=== The SfxSlot struct ===&lt;br /&gt;
&lt;br /&gt;
The “slot” struct contains all necessary information that the SfxDispatcher needs to work together with the Shell object containing the slot. The slot contains function pointers that the dispatcher can call to either execute the command represented by the slot or get status information about it. Thus the dispatcher doesn&amp;#039;t need to know the concrete implementation classes of the shells, it can work with them through their base class (SfxShell) interface.&lt;br /&gt;
&lt;br /&gt;
Other important parts of the SfxSlot struct are the “name” of the slot and the numerical ID of it, its so called SlotID. Slot names have been chosen so that they match the part after the colon in “.uno:...” CommandURLs. Mapping between CommandURLs and SlotIDs to then need a simple lookup in all SfxInterfaces of the SfxShells on the shell stack of the SfxDispatcher. More about slots can be found below. &lt;br /&gt;
&lt;br /&gt;
When the SfxDispatcher is asked for support of a particular command it searches for a slot with the given internal command name starting with the top most shell on the stack and then proceeding with the next one until success. This way “higher prioritized” contexts can overrule functionality from “lower prioritized” contexts. As an example, the “document” context has a generic implementation of the “Print” command, but each particular “view” context can overrule the generic behavior and define a specific way of printing. &lt;br /&gt;
&lt;br /&gt;
=== The SfxInterface class ===&lt;br /&gt;
&lt;br /&gt;
The slot arrays aka SfxInterfaces are static to each shell class and so each interface is a part of the data segment of the library that contains the shell code assigned to this interface. The data for these arrays needs to be predefined in source files. Writing huge arrays into C++ source files is a very tedious work and so we use a different kind of source file that is easier to edit and have a compiler (“svidl”) that takes these files and compiles them into a generated header file containing the definition of the arrays. These idl files are located in the sdi sub folders of each SFX based project and have the extension “sdi”. The generated header file contains the definitions (not only declarations) of all “interfaces” of the library and some “#define” magic allows to have each interface generated only once. More about this process below.&lt;br /&gt;
&lt;br /&gt;
=== Slots, interfaces, shells, dispatchers ===&lt;br /&gt;
&lt;br /&gt;
In OOo1.x the SfxBaseController utilized its SfxDispatcher and its stack to provide a generic Dispatch object for every supported command. It gets the CommandURL in the queryDispatch call, looks for a slot on the dispatcher stack with a suitable internal command name and in case of success creates a dispatch object and returns it. There is a drawback in this approach: if the context changes (means: shells are pushed or popped) slots might appear or disappear from the stack so commands that had been supported aren&amp;#039;t any longer or the other way around. This forces the DispatchProvider to request a complete refetching of all dispatch objects and so can be time consuming.&lt;br /&gt;
&lt;br /&gt;
In OOo2.x we utilize the “slot pool” of the SFX based modules. This is the entirety of all “interfaces” (slot arrays) the module supports. On startup all interfaces register at the module class (SfxModule base class) so it is easy to iterate through its interfaces. Now a Dispatch Object is returned when the slot is found anywhere in the slot pool, even if the interface is not on the stack, but in this case the Dispatch Object reports its slots as disabled everytime it is used. This can be determined dynamically so context changes don&amp;#039;t need external updates, it&amp;#039;s enough to update the internal status of the already created Dispatch Objects. This approach also enables some future optimizations for the representation of slot arrays that will be discussed later.&lt;br /&gt;
&lt;br /&gt;
== Slot Processing ==&lt;br /&gt;
&lt;br /&gt;
In former (Pre-UNO) time the slots where not only used for command dispatching but also for the implementation of our Basic API (up to StarOffice 5.2), so the slot arrays where &amp;quot;real&amp;quot; &amp;#039;&amp;#039;interfaces&amp;#039;&amp;#039;. There are a lot residues of the in the sdi files (see below), but they aren&amp;#039;t used anymore.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slot definitions ===&lt;br /&gt;
&lt;br /&gt;
The use case explains why there are two different kinds of slots, property slots and method slots, and the difference between them can be spotted easily from the definition of a slot in the sdi file. Here are two examples, the first one describing a method slot and the second one describing a property slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem About SID_ABOUT&lt;br /&gt;
()&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxBoolItem DesignerDialog SID_STYLE_DESIGNER&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = TRUE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = TRUE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    Readyonly = FALSE,&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_FORMAT;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each slot is a block in rectangular bracket filled with attributes that is preceded by two lines that identify the slot and define its nature. The exact meaning of all the attributes is explained below, the most notable difference is seen in the second line of each block: the paranthesis of the &amp;quot;About&amp;quot; slot classify it as a method while the other one (without paranthesis) is a property. As explained above, this classification goes back to the old Basic API but besides that it&amp;#039;s important for the implementation of macro recording that is also based on the Dispatch API (and for SFX component it&amp;#039;s implemented using slots). &amp;quot;Method&amp;quot; and &amp;quot;property&amp;quot; slots are recorded differently.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The name in the middle of each first line of a block was used as the name of the property or method in the Basic API and today this name is the internal command name that is matched to any &amp;quot;.uno:xxx&amp;quot; CommandURLs of the Dispatch API. As an example, the slot named &amp;quot;Undo&amp;quot; is assigned to the &amp;quot;.uno:Undo&amp;quot; command. This matching requires that the internal command names have to be unique in the complete module. This uniqueness is verified by the svidl compiler that breaks in case if name clashes in a module.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last part of each first line is the so called SlotID that in former times was the real identifier (not as today the internal command name) and it was also used inside the GUI element configuration files where today CommandURLs are used. So this SlotID had to be unique for the module at least, currently it&amp;#039;s even globally unique but at least theoretically it is now obsolete. Inside the slot processing only the textual representation of the SlotID is relevant , not its numerical value.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Property slots have a type specified by the first part of the first line. The same data in a method slot specifies the return value of the associated method. Method slots also can gave parameters (non empty paranthesis) and a return value that could be used in the old Basic API of StarOffice, but also in internal methods of the SfxDispatcher. Strictly speaking the latter is still possible but we try to get rid of this. Here are two examples for slots with arguments, with and without return value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem Undo SID_UNDO&lt;br /&gt;
( SfxUInt16Item Undo SID_UNDO )&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Volatile,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* status */&lt;br /&gt;
    SlotType = SfxStringItem&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_EDIT;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxObjectItem Open SID_OPENDOC&lt;br /&gt;
(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, SfxStringItem OpenFlags SID_OPTIONS,&lt;br /&gt;
SfxStringItem Password SID_PASSWORD, SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS, SfxInt16Item Version SID_VERSION,&lt;br /&gt;
SfxStringItem Referer SID_REFERER)&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = TRUE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Asynchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As shown in the examples, property types and return values are given as &amp;#039;&amp;#039;Items&amp;#039;&amp;#039;, the whole slot &amp;quot;API&amp;quot; is based on SfxPoolItems, each identified by its ID. These IDs must be unique only in the context of the method.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Slots are used to bind their functionality to UI elements. In former times this was done by writing the SlotIDs into the UI element configuration files, today we use CommandURLs. Binding slots to UI elements (today indirectly through the &amp;#039;&amp;#039;Dispatch Object&amp;#039;&amp;#039;) means that the binding client wants to get status information from it and/or possibly wants to execute it, in most cases (means: the standard controllers) without any parameters.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The type of the status update information is given by the &amp;#039;&amp;#039;SlotType&amp;#039;&amp;#039; attribute. For property slots like &amp;quot;DesignerDialog&amp;quot; this is identical with its property type (and so this attribute is not explictly assigned in the block), for method slots it must be specified like shown in the &amp;quot;Undo&amp;quot; example. If a method slot doesn&amp;#039;t specify a SlotType it has no status (except &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; or &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;). So in the examples &amp;quot;Undo&amp;quot; is of type String, &amp;quot;DesignerDialog&amp;quot; of type Boolean while the other slots don&amp;#039;t have a status.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A menu controller will reflect this by showing status of the &amp;quot;Undo&amp;quot; entry as its title and setting or unsetting a check mark in front of the &amp;quot;DesignerDialof&amp;quot; entry reflecting its boolean status, a toolbar controller reflects the latter one in a pressed/unpressed state, the former in different button titles (or quick help texts that replace the button title if it&amp;#039;s switched off). Other types of status information need speccialized controller that know how to deal with this kind of information.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All the other attributes inside the block of a slot are &amp;#039;&amp;#039;flags&amp;#039;&amp;#039; that define the behavior of the slot at runtime. Some of the attributes are contradicting (like synchron or asynchron) and so of course only one of them can be set. The table below sums them up in one line.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;80%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!width=&amp;quot;40%&amp;quot;|Attribute&lt;br /&gt;
!width=&amp;quot;60%&amp;quot;|Meaning&lt;br /&gt;
|-&lt;br /&gt;
||Cachable (Volatile)|| Slot status is cached, sending a new status to controllers need an &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call that forces SFX to fetch a new status. Volatile slots are not cached and SFX permanently asks for status information based on a timer.&lt;br /&gt;
|-&lt;br /&gt;
|AutoUpdate || TRUE: After execution of the slot SFX automatically fetches the new status, no &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call necessary&lt;br /&gt;
|-&lt;br /&gt;
|FastCall || TRUE: SFX doesn&amp;#039;t check &amp;quot;enable&amp;quot; status before executing a slot&lt;br /&gt;
|-&lt;br /&gt;
|Toggle || Execute without parameters automatically toggles the current status. Works for property slots with boolean or enum type.&lt;br /&gt;
|-&lt;br /&gt;
|HasCoreId || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|HasDialog || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|ReadOnlyDoc || FALSE: SFX automatically disables this slot if the document is read only&lt;br /&gt;
|-&lt;br /&gt;
|Container || TRUE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the object.&amp;lt;br/&amp;gt;FALSE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the container.&lt;br /&gt;
|-&lt;br /&gt;
|RecordAbsolute || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|RecordPerSet (RecordPerItem, NoRecord) || See explanation for Recording.&lt;br /&gt;
|-&lt;br /&gt;
|Synchron (Asynchron) || Asynchron: SFX execute the slot by posting a user event instead of directly calling the execute function of the slot&lt;br /&gt;
|-&lt;br /&gt;
|Readonly || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|AccelConfig || Slot may be offered in the configuration dialog for keyboard shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|MenuConfig || Slot may be offered in the configuration dialog for menus&lt;br /&gt;
|-&lt;br /&gt;
|StatusBarConfig || Slot may be offered in the configuration dialog for status bar&lt;br /&gt;
|-&lt;br /&gt;
|ToolboxConfig || Slot may be offered in the configuration dialog for toolbars&lt;br /&gt;
|-&lt;br /&gt;
|GroupId || Assign the slot to a function group in the configuration dialogs (module is free to define categories)&lt;br /&gt;
|-&lt;br /&gt;
|ImageRotation || Toolbar images are rotated in case of writing direction from right to left&lt;br /&gt;
|-&lt;br /&gt;
|ImageReflection || Toolbar images are rotated in case of vertical text orientation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interface definitions ===&lt;br /&gt;
&lt;br /&gt;
As already mentioned, slots are bundled to interfaces and interfaces are used by shells. SDI files know both terms. Here&amp;#039;s an example how this looks. For clarity only a few slots are shown, the read file contains much more of them.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
interface Document : Object&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE ;&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_CLOSEDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface OfficeDocument : Document&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_DOC_MODIFIED&lt;br /&gt;
    [&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    SID_PRINTDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = PrintExec_Impl ;&lt;br /&gt;
        StateMethod = NoState ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
shell SfxObjectShell&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    import OfficeDocument [AUTOMATION];&lt;br /&gt;
&lt;br /&gt;
    SID_DOCINFO&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The interface term is used slightly different in the sdi files that it is used by SFX, so now we use the name &amp;quot;slot arrays&amp;quot; for what the SFX itself calls &amp;quot;interfaces&amp;quot; to avoid confusion.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As a residue of the old Basic API sdi files define interfaces and shells separately, thus differentiating between slots for both Basic and UI usage and slots only used for UI purposes. This is obsolete today, but still used. Additionally sdi files define base and derived interfaces and shells in a granularity we don&amp;#039;t need anymore, but this is also a residue of the StarBasic support. This might change in the near future. Some interfaces even contained real basic properties that are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; represented by slots at all (like the &amp;quot;object&amp;quot; interface referenced in the example) but they are not used anymore.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;shell&amp;quot; defined in the file references a C++ implementation class SfxObjectShell. This part of the sdi file defines the complete slot interface of this class. The &amp;quot;import&amp;quot; statement tells the svidl compiler that it should add all slots of the interface &amp;quot;OfficeDocument&amp;quot; here (and of course all slots of its &amp;quot;base class&amp;quot; interfaces).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;Automation&amp;quot; attribute that is assigned to both interfaces and shells tells the svidl compiler whether it should generate a slot array definition for this interface/shell or not. We only generate arrays for shell, not for interfaces (because we don&amp;#039;t need them anymore). In former times we also generated arrays for interfaces, and the &amp;quot;Automation&amp;quot; attribute allowed us to prevent svidl from generating them for base class interfaces also. The &amp;quot;Automation&amp;quot; attribute will become obsolete pretty soon.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the interface/shell definition block slots are referenced by their SlotID. Svidl will get all attributes of the slot it needs to generate the array definition from the slot definition (that of course needs to be included and processed before svidl gets to the shell definition). In the block below this identifier (again with rectangular brackets) two additional attributes are specified: the names of one or two methods can be defined that SFX calls to get status information or execute the slot. These methods have a prescribed signature:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Class::StateMethod( SfxItemSet&amp;amp; );&lt;br /&gt;
void Class::ExecMethod( SfxRequest&amp;amp; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The ItemSet is used to collect the status information, the SfxRequest contains everything necessary for the execution of a slot.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The svidl compiler takes the shell class name and the method name and generates an inline stub function that calls the C++ member. A pointer to each stub is generated into the slot definitions. The stubs are generated into the same header file that contains the generated arrays. Here is an example for the first slot of the interface &amp;quot;Document&amp;quot; shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_EXEC_STUB( SfxObjectShell, ExecFile_Impl )&lt;br /&gt;
SFX_STATE_STUB( SfxObjectShell, GetState_Impl )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We use function stubs here because pointer to member functions don&amp;#039;t have a fixed size and so we can&amp;#039;t store them inside a struct like SfxSlot. A pointer to a C function always has the same size as normal pointer on the machine.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The slots in our example show that both pointers can be set or only one of them. A slot without an &amp;quot;Exec&amp;quot; function is a slot that only has a status, execution is done by another slot. A slot without a &amp;quot;GetState&amp;quot; function is always enabled and has no status. SFX automatically generates empty stub in these cases.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the block defining the functions theoretically all slot attributes of the referenced slot can be overwritten and sometimes this can be found. This should be seen as exceptional cases and it might happen in the near future that this overwriting will become forbidden for more and more attributes. The benefit of this is very limited but the risk of dangerous inconsistencies is high.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Here&amp;#039;s an exerpt of the generated header file that belongs to the SID_CLOSEDOC slot shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_SLOTMAP_ARG(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
// Slot Nr. 0 : 5502&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_SAVEASDOC,SID_SAVEASDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[1] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                0/*Offset*/, 9/*Count*/,&amp;quot;.SaveAs&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;SaveAs&amp;quot; ),&lt;br /&gt;
// Slot Nr.1 : 5503&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_CLOSEDOC,SID_CLOSEDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[3] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                9/*Offset*/, 2/*Count*/,&amp;quot;.CloseDoc&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;CloseDoc&amp;quot; ),&lt;br /&gt;
// Slot Nr.2 : 5504&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_PRINTDOC,SID_PRINTDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[2] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR_NONE,&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                11/*Offset*/, 10/*Count*/,&amp;quot;.Print&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;Print&amp;quot; ),&lt;br /&gt;
&lt;br /&gt;
         // ... to be continued ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The SFX_NEW_SLOT_ARG macro initializes a complete slot. Most of it should be pretty obvious from what was described already, please note the macros for the generated stubs (and especially SFX_STUB_PTR_STATE_NONE for the empty stub).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An interesting addition is the second line of each block, it contains an &amp;quot;Offset Next&amp;quot;. It is a pointer that points to the next slot in this shell that uses the same &amp;quot;GetState&amp;quot; method as the current slot. This enables SFX to collects status information for several slots at once when a complete update is requested. In general the shell code allows to group slots together in Exec/GetState methods and have more than one per shell for clarity reasons.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The last line in each block also contains an offset and a count. These attributes point to the arguments of the slot (of course only for methods). All possible arguments of all slots inside a shell are grouped into a single array, arguments that belong to the same slot of course beneath each other. The offset points to the first argument of a slot:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_ARGUMENTMAP(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_NAME,&amp;quot;URL&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILTER_NAME,&amp;quot;FilterName&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_PASSWORD,&amp;quot;Password&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,&amp;quot;FilterOptions&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_COMMENTS,&amp;quot;VersionComment&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_AUTHOR,&amp;quot;VersionAuthor&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_OVERWRITE,&amp;quot;Overwrite&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_UNPACK,&amp;quot;Unpacked&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_SAVETO,&amp;quot;SaveTo&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_SAVE,&amp;quot;SaveChanges&amp;quot;,SfxBoolItem),    // &amp;lt;---- here args for SID_CLOSEDOC start&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_FILENAME,&amp;quot;FileName&amp;quot;,SfxStringItem), // &amp;quot;count&amp;quot; is 2, so this is the second one&lt;br /&gt;
&lt;br /&gt;
    // ... to be continued ...&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In each module one header file containing all shells is created. It must be included in the source file of each shell class that contains the SFX_IMPL_INTERFACE macro. To avoid multiple definitions of the slot arrays by this multiple inclusion each code block assigned to a particular shell is framed by an &amp;quot;#ifdef ClassName&amp;quot; block, so in the source file the typical code sequence is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define SfxObjectShell&lt;br /&gt;
#include &amp;quot;sfxslots.hxx&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Other parts of the header file are framed by &amp;quot;#ifdef SFX_TYPEMAP&amp;quot; and this part mustbe activated only once also so each module contains one file that includes the generated header file and defined SFX_TYPEMAP before. This can be on e of the shell files that also defines its shell interface or it can be a different one. The part of the generated header file that is activated here is not necessary for the SFX core (the slot dispatching), but was necessary in former times for the type information of the old Basic API and for macro recording. Today it is used for the wrapper that mediates between SFX dispatching and the Dispatch API and thus also for macro recording because the current macro recorder also uses the Dispatch API.&lt;br /&gt;
&lt;br /&gt;
=== Items and UNO structs ===&lt;br /&gt;
&lt;br /&gt;
The old SFX based Basic API was made up by the property and method slot defined in the sdi files. All types are specified as SfxPoolItems and this was fine for StarBasic because internally these types are used also (for Sbx classes). For recording purposes it was necessary to know the &amp;quot;real&amp;quot; types behind a particular SfxPoolItem type and especially structured items needed to be split up into basic types because StarBasic doesn&amp;#039;t support structs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The mapping from a SfxPoolItem to an atomic or structured type is done by using a mapping table in another sdi file. Here&amp;#039;s an example for atomic types from the SFX module:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item void     SfxVoidItem&lt;br /&gt;
item BOOL     SfxBoolItem&lt;br /&gt;
item INT32    SfxUInt16Item&lt;br /&gt;
item INT16    SfxInt16Item&lt;br /&gt;
item INT32    SfxUInt32Item&lt;br /&gt;
item INT32    SfxInt32Item&lt;br /&gt;
item String   SfxStringItem&lt;br /&gt;
item BYTE     SfxByteItem&lt;br /&gt;
item INT16    SfxEnumItem&lt;br /&gt;
item INT16    SfxAllEnumItem&lt;br /&gt;
item INT16    TbxImageItem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It&amp;#039;s pretty straightforward: &amp;quot;item&amp;quot; declares the type to be atomic and it is followed by the Basic (or better: UNO) type and the Item representing it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Structured types are a little bit more complicated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
struct Point&lt;br /&gt;
{&lt;br /&gt;
    INT32    X    MID_X;&lt;br /&gt;
    INT32    Y    MID_Y;&lt;br /&gt;
};&lt;br /&gt;
item Point SfxPointItem;&lt;br /&gt;
&lt;br /&gt;
struct Rectangle&lt;br /&gt;
{&lt;br /&gt;
    INT32    Left    MID_RECT_LEFT;&lt;br /&gt;
    INT32    Top     MID_RECT_TOP;&lt;br /&gt;
    INT32    Width   MID_WIDTH;&lt;br /&gt;
    INT32    Height  MID_HEIGHT;&lt;br /&gt;
};&lt;br /&gt;
item Rectangle SfxRectangleItem;&lt;br /&gt;
&lt;br /&gt;
struct DocInfo&lt;br /&gt;
{&lt;br /&gt;
    BOOL    UseUserData    MID_DOCINFO_USEUSERDATA;&lt;br /&gt;
    BOOL    DeleteUserData MID_DOCINFO_DELETEUSERDATA;&lt;br /&gt;
    String  Title          MID_DOCINFO_TITLE;&lt;br /&gt;
    String  Subject        MID_DOCINFO_SUBJECT;&lt;br /&gt;
    String  KeyWords       MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    String  Description    MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    BOOL    AutoReload     MID_DOCINFO_AUTOLOADENABLED;&lt;br /&gt;
};&lt;br /&gt;
item DocInfo SfxDocumentInfoItem;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The examples show simple structs like a Point or more complex structs like a DocInfo. Structs can be nested, a DocInfo could contain a Point also. In the old StarBasic and also in todays macro recording each number of a struct was represented by an individual item (so an ID was needed that is unique in the complete argument set) and the names of these arguments where assembled from the name of the struct parameter name and the member name in the obvious from ArgName.MemberName.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For some items that are used only internally SFX based code (but not for recording purposes) no mapping was necessary and for syntactical completeness they are mapped to any atomic type, but his mapping is never used:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item String    SbxItem;                //! Dummy&lt;br /&gt;
item String    SfxObjectItem;          //! Dummy&lt;br /&gt;
item String    SfxTemplateItem;        //! Dummy&lt;br /&gt;
item String    SfxMacroInfoItem;       //! Dummy&lt;br /&gt;
item String    SfxImageItem;           //! Dummy&lt;br /&gt;
item String    SfxFrameItem;           //! Dummy&lt;br /&gt;
item String    SfxObjectShellItem;     //! Dummy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The svidl compiler creates the type mappings into the following form:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// example for an atomic type&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType0 aSfxStringItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxStringItem), 0&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
// example for a struct with 4 members&lt;br /&gt;
extern SfxType4 aSfxRectangleItem_Impl;&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType4 aSfxRectangleItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxRectangleItem}, 4, { {MID_RECT_LEFT,&amp;quot;Left&amp;quot;}, {MID_RECT_TOP,&amp;quot;Top&amp;quot;}, {MID_WIDTH,&amp;quot;Width&amp;quot;},&lt;br /&gt;
{MID_HEIGHT,&amp;quot;Height&amp;quot;} }&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It utilizes the TOOLS based RTTI that allows to offer a static factory method by using one of the TYPEINIT_AUTOFACTORY macros. This factory that can be used to create an item of the particular class. This is very important for the conversion routines that match items to UNO structs and vice versa. An item that does not offer a factory can&amp;#039;t be converted properly and so macro recording and Dispatch API are broken for this item.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The conversion between an item and a UNO type uses the virtual PutValue and QueryValue methods of the items. In the case of macro recording (where only atomic types are allowed) the &amp;quot;MemberID&amp;quot; parameter of these calls is used always in case of structured items and so it is important that the MIDs in the sdi file match the MIDs used in the implementation of the item. As an example, an SfxRectangleItem is recorded as two integer values.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The matching we use for the Dispatch API in our controllers on the other hand always converts to complete structs, not to atomic members, so the SfxRectangleItem is converted to a com.sun.star.awt.Rectangle. The rect Put/QueryValue in this case is called with MID=0. It&amp;#039;s vital for this process that &amp;#039;&amp;#039;&amp;#039;&amp;quot;0&amp;quot; is an invalid MID&amp;#039;&amp;#039;&amp;#039; that must not be used for any member.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Article]]&lt;br /&gt;
[[Category:Framework]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137244</id>
		<title>Framework/Article/Implementation of the Dispatch API In SFX2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137244"/>
		<updated>2009-08-11T16:55:32Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Items and UNO structs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementation of the Dispatch API in SFX2 ==&lt;br /&gt;
&lt;br /&gt;
The Dispatch API as described in chapter 7.1.6 of the Developer&amp;#039;s Guide is the backbone of our communication between &amp;quot;generic&amp;quot; UI elements and the document core implementations.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Traditionally SFX based components implemented this communication with a much older framework based on the so called &amp;#039;&amp;#039;slots&amp;#039;&amp;#039; and their organization into &amp;#039;&amp;#039;shells&amp;#039;&amp;#039;. While up to OpenOffice.org 1.1 our generic UI elements (menus, toolbars, etc.) still used the SFX based API directly to a large degree in OpenOffice.org 2.0 we changed this to using the Dispatch API exclusively, thus enabling us to share the UI components with other, not SFX based components. This paper describes how the old SFX implementation is matched to the &amp;#039;&amp;#039;DispatchProvider&amp;#039;&amp;#039; implementation that the component provides to the outside to make this happen.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The basic entity in the dispatch API is a command, and it&amp;#039;s represented by a &amp;#039;&amp;#039;CommandURL&amp;#039;&amp;#039;. For simplifications we suppose that this CommandURL is a string (though the API transport it as a pre-parsed struct). All commands supported by our components have the form &amp;#039;&amp;#039;.uno:xxxxx&amp;#039;&amp;#039; for historical reasons, where &amp;#039;&amp;#039;xxxxx&amp;#039;&amp;#039; represents an internal command name. Examples are “.uno:Print” or “.uno:Paste”. The functionality provided by the Dispatch API is support to execute such commands and getting status information for them (enabled/disabled or explicit information if the commands represents something type, a boolean, a string etc.).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As explained in the Developer&amp;#039;s Guide the Dispatch API builds on the idea that such commands can be passed along a chain of Dispatch Provider objects. Every object in this chain is free to decide whether it will handle a command or wants to pass it to the next chain member. Each document window and the Frame object managing it has such a chain of Dispatch providers and at least one object in this chain belongs to the document model/view pair bound to this window. It&amp;#039;s the so called Controller object that amongst other interfaces supports the XDispatchProvider interface. &lt;br /&gt;
&lt;br /&gt;
=== Controller objects in SFX2 ===&lt;br /&gt;
&lt;br /&gt;
SFX2 based components share a common base class for their Controller object implementation, SfxBaseController. It has a queryDispatch() implementation of the XDispatchProvider interface where the received CommandURLs are compared with the CommandURLs in the set of commands the particular component supports. It uses some comparable functionality in the old SFX2 framework that also is able to execute commands and give status information about them. The main difference between the old SFX2 base framework and the UNO framework is that the latter defines commands by strings (CommandURLs) and the former does it by integer values (SlotID, see below). So the main job of the queryDispatch() implementation in the SfxBaseController is to match a commandURL to the corresponding SlotID and then proceed using the internal old SFX2 implementation.&lt;br /&gt;
&lt;br /&gt;
SFX2 organizes functionality in contexts that can be merged together and exposed to the outside world by a single point of contact. This contact point is an SfxDispatcher object that every SfxBaseController owns. [Remark: this ownership is indirect as the real owner of the SfxDispatcher is an SfxViewFrame; but there is always a 1:1 relationship between an SfxViewFrame and an SfxBaseController.]&lt;br /&gt;
The SfxDispatcher internally maintains a stack of objects, each representing a context. Examples for these contexts are “document”, “view”, “text”, “table”, “cell” etc. All these objects are derived from a common base class “SfxShell”. The complete stack of all contextual objects available in a particular situation, the “merged context”, represents the function set applicable to the current selection or cursor position in a document. Context changes inside the document&amp;#039;s editing window cause pushing and popping of shell objects to and from the stack. &lt;br /&gt;
&lt;br /&gt;
This is how a typical stack in Writer looks when the cursor is in a normal text paragraph:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The same stack when the cursor is in a text paragraph in a table:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* Table&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
Another stack when a graphic is selected:&lt;br /&gt;
&lt;br /&gt;
* Graphic&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Frame&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Application&amp;#039;&amp;#039; contexts are there for historical reasons, we are still in the process of moving their functionality to the framework where other &amp;#039;&amp;#039;DispatchProviders&amp;#039;&amp;#039; outside of the component take over. I omitted the &amp;quot;Form&amp;quot; context here because it&amp;#039;s somewhat confusing.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slots and Interfaces ==&lt;br /&gt;
&lt;br /&gt;
Each SfxShell class has a static member called SfxInterface. It is an object containing an array of SfxSlot structs. Each “slot” represents a command supported by the context (shell) it is assigned to. So the complete SfxInterface defines the functionality an instance of the particular SfxShell class using this interface provides.&lt;br /&gt;
&lt;br /&gt;
=== The SfxSlot struct ===&lt;br /&gt;
&lt;br /&gt;
The “slot” struct contains all necessary information that the SfxDispatcher needs to work together with the Shell object containing the slot. The slot contains function pointers that the dispatcher can call to either execute the command represented by the slot or get status information about it. Thus the dispatcher doesn&amp;#039;t need to know the concrete implementation classes of the shells, it can work with them through their base class (SfxShell) interface.&lt;br /&gt;
&lt;br /&gt;
Other important parts of the SfxSlot struct are the “name” of the slot and the numerical ID of it, its so called SlotID. Slot names have been chosen so that they match the part after the colon in “.uno:...” CommandURLs. Mapping between CommandURLs and SlotIDs to then need a simple lookup in all SfxInterfaces of the SfxShells on the shell stack of the SfxDispatcher. More about slots can be found below. &lt;br /&gt;
&lt;br /&gt;
When the SfxDispatcher is asked for support of a particular command it searches for a slot with the given internal command name starting with the top most shell on the stack and then proceeding with the next one until success. This way “higher prioritized” contexts can overrule functionality from “lower prioritized” contexts. As an example, the “document” context has a generic implementation of the “Print” command, but each particular “view” context can overrule the generic behavior and define a specific way of printing. &lt;br /&gt;
&lt;br /&gt;
=== The SfxInterface class ===&lt;br /&gt;
&lt;br /&gt;
The slot arrays aka SfxInterfaces are static to each shell class and so each interface is a part of the data segment of the library that contains the shell code assigned to this interface. The data for these arrays needs to be predefined in source files. Writing huge arrays into C++ source files is a very tedious work and so we use a different kind of source file that is easier to edit and have a compiler (“svidl”) that takes these files and compiles them into a generated header file containing the definition of the arrays. These idl files are located in the sdi sub folders of each SFX based project and have the extension “sdi”. The generated header file contains the definitions (not only declarations) of all “interfaces” of the library and some “#define” magic allows to have each interface generated only once. More about this process below.&lt;br /&gt;
&lt;br /&gt;
=== Slots, interfaces, shells, dispatchers ===&lt;br /&gt;
&lt;br /&gt;
In OOo1.x the SfxBaseController utilized its SfxDispatcher and its stack to provide a generic Dispatch object for every supported command. It gets the CommandURL in the queryDispatch call, looks for a slot on the dispatcher stack with a suitable internal command name and in case of success creates a dispatch object and returns it. There is a drawback in this approach: if the context changes (means: shells are pushed or popped) slots might appear or disappear from the stack so commands that had been supported aren&amp;#039;t any longer or the other way around. This forces the DispatchProvider to request a complete refetching of all dispatch objects and so can be time consuming.&lt;br /&gt;
&lt;br /&gt;
In OOo2.x we utilize the “slot pool” of the SFX based modules. This is the entirety of all “interfaces” (slot arrays) the module supports. On startup all interfaces register at the module class (SfxModule base class) so it is easy to iterate through its interfaces. Now a Dispatch Object is returned when the slot is found anywhere in the slot pool, even if the interface is not on the stack, but in this case the Dispatch Object reports its slots as disabled everytime it is used. This can be determined dynamically so context changes don&amp;#039;t need external updates, it&amp;#039;s enough to update the internal status of the already created Dispatch Objects. This approach also enables some future optimizations for the representation of slot arrays that will be discussed later.&lt;br /&gt;
&lt;br /&gt;
== Slot Processing ==&lt;br /&gt;
&lt;br /&gt;
In former (Pre-UNO) time the slots where not only used for command dispatching but also for the implementation of our Basic API (up to StarOffice 5.2), so the slot arrays where &amp;quot;real&amp;quot; &amp;#039;&amp;#039;interfaces&amp;#039;&amp;#039;. There are a lot residues of the in the sdi files (see below), but they aren&amp;#039;t used anymore.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slot definitions ===&lt;br /&gt;
&lt;br /&gt;
The use case explains why there are two different kinds of slots, property slots and method slots, and the difference between them can be spotted easily from the definition of a slot in the sdi file. Here are two examples, the first one describing a method slot and the second one describing a property slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem About SID_ABOUT&lt;br /&gt;
()&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxBoolItem DesignerDialog SID_STYLE_DESIGNER&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = TRUE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = TRUE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    Readyonly = FALSE,&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_FORMAT;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each slot is a block in rectangular bracket filled with attributes that is preceded by two lines that identify the slot and define its nature. The exact meaning of all the attributes is explained below, the most notable difference is seen in the second line of each block: the paranthesis of the &amp;quot;About&amp;quot; slot classify it as a method while the other one (without paranthesis) is a property. As explained above, this classification goes back to the old Basic API but besides that it&amp;#039;s important for the implementation of macro recording that is also based on the Dispatch API (and for SFX component it&amp;#039;s implemented using slots). &amp;quot;Method&amp;quot; and &amp;quot;property&amp;quot; slots are recorded differently.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The name in the middle of each first line of a block was used as the name of the property or method in the Basic API and today this name is the internal command name that is matched to any &amp;quot;.uno:xxx&amp;quot; CommandURLs of the Dispatch API. As an example, the slot named &amp;quot;Undo&amp;quot; is assigned to the &amp;quot;.uno:Undo&amp;quot; command. This matching requires that the internal command names have to be unique in the complete module. This uniqueness is verified by the svidl compiler that breaks in case if name clashes in a module.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last part of each first line is the so called SlotID that in former times was the real identifier (not as today the internal command name) and it was also used inside the GUI element configuration files where today CommandURLs are used. So this SlotID had to be unique for the module at least, currently it&amp;#039;s even globally unique but at least theoretically it is now obsolete. Inside the slot processing only the textual representation of the SlotID is relevant , not its numerical value.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Property slots have a type specified by the first part of the first line. The same data in a method slot specifies the return value of the associated method. Method slots also can gave parameters (non empty paranthesis) and a return value that could be used in the old Basic API of StarOffice, but also in internal methods of the SfxDispatcher. Strictly speaking the latter is still possible but we try to get rid of this. Here are two examples for slots with arguments, with and without return value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem Undo SID_UNDO&lt;br /&gt;
( SfxUInt16Item Undo SID_UNDO )&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Volatile,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* status */&lt;br /&gt;
    SlotType = SfxStringItem&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_EDIT;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxObjectItem Open SID_OPENDOC&lt;br /&gt;
(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, SfxStringItem OpenFlags SID_OPTIONS,&lt;br /&gt;
SfxStringItem Password SID_PASSWORD, SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS, SfxInt16Item Version SID_VERSION,&lt;br /&gt;
SfxStringItem Referer SID_REFERER)&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = TRUE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Asynchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As shown in the examples, property types and return values are given as &amp;#039;&amp;#039;Items&amp;#039;&amp;#039;, the whole slot &amp;quot;API&amp;quot; is based on SfxPoolItems, each identified by its ID. These IDs must be unique only in the context of the method.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Slots are used to bind their functionality to UI elements. In former times this was done by writing the SlotIDs into the UI element configuration files, today we use CommandURLs. Binding slots to UI elements (today indirectly through the &amp;#039;&amp;#039;Dispatch Object&amp;#039;&amp;#039;) means that the binding client wants to get status information from it and/or possibly wants to execute it, in most cases (means: the standard controllers) without any parameters.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The type of the status update information is given by the &amp;#039;&amp;#039;SlotType&amp;#039;&amp;#039; attribute. For property slots like &amp;quot;DesignerDialog&amp;quot; this is identical with its property type (and so this attribute is not explictly assigned in the block), for method slots it must be specified like shown in the &amp;quot;Undo&amp;quot; example. If a method slot doesn&amp;#039;t specify a SlotType it has no status (except &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; or &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;). So in the examples &amp;quot;Undo&amp;quot; is of type String, &amp;quot;DesignerDialog&amp;quot; of type Boolean while the other slots don&amp;#039;t have a status.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A menu controller will reflect this by showing status of the &amp;quot;Undo&amp;quot; entry as its title and setting or unsetting a check mark in front of the &amp;quot;DesignerDialof&amp;quot; entry reflecting its boolean status, a toolbar controller reflects the latter one in a pressed/unpressed state, the former in different button titles (or quick help texts that replace the button title if it&amp;#039;s switched off). Other types of status information need speccialized controller that know how to deal with this kind of information.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All the other attributes inside the block of a slot are &amp;#039;&amp;#039;flags&amp;#039;&amp;#039; that define the behavior of the slot at runtime. Some of the attributes are contradicting (like synchron or asynchron) and so of course only one of them can be set. The table below sums them up in one line.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;80%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!width=&amp;quot;40%&amp;quot;|Attribute&lt;br /&gt;
!width=&amp;quot;60%&amp;quot;|Meaning&lt;br /&gt;
|-&lt;br /&gt;
||Cachable (Volatile)|| Slot status is cached, sending a new status to controllers need an &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call that forces SFX to fetch a new status. Volatile slots are not cached and SFX permanently asks for status information based on a timer.&lt;br /&gt;
|-&lt;br /&gt;
|AutoUpdate || TRUE: After execution of the slot SFX automatically fetches the new status, no &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call necessary&lt;br /&gt;
|-&lt;br /&gt;
|FastCall || TRUE: SFX doesn&amp;#039;t check &amp;quot;enable&amp;quot; status before executing a slot&lt;br /&gt;
|-&lt;br /&gt;
|Toggle || Execute without parameters automatically toggles the current status. Works for property slots with boolean or enum type.&lt;br /&gt;
|-&lt;br /&gt;
|HasCoreId || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|HasDialog || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|ReadOnlyDoc || FALSE: SFX automatically disables this slot if the document is read only&lt;br /&gt;
|-&lt;br /&gt;
|Container || TRUE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the object.&amp;lt;br/&amp;gt;FALSE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the container.&lt;br /&gt;
|-&lt;br /&gt;
|RecordAbsolute || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|RecordPerSet (RecordPerItem, NoRecord) || See explanation for Recording.&lt;br /&gt;
|-&lt;br /&gt;
|Synchron (Asynchron) || Asynchron: SFX execute the slot by posting a user event instead of directly calling the execute function of the slot&lt;br /&gt;
|-&lt;br /&gt;
|Readonly || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|AccelConfig || Slot may be offered in the configuration dialog for keyboard shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|MenuConfig || Slot may be offered in the configuration dialog for menus&lt;br /&gt;
|-&lt;br /&gt;
|StatusBarConfig || Slot may be offered in the configuration dialog for status bar&lt;br /&gt;
|-&lt;br /&gt;
|ToolboxConfig || Slot may be offered in the configuration dialog for toolbars&lt;br /&gt;
|-&lt;br /&gt;
|GroupId || Assign the slot to a function group in the configuration dialogs (module is free to define categories)&lt;br /&gt;
|-&lt;br /&gt;
|ImageRotation || Toolbar images are rotated in case of writing direction from right to left&lt;br /&gt;
|-&lt;br /&gt;
|ImageReflection || Toolbar images are rotated in case of vertical text orientation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interface definitions ===&lt;br /&gt;
&lt;br /&gt;
As already mentioned, slots are bundled to interfaces and interfaces are used by shells. SDI files know both terms. Here&amp;#039;s an example how this looks. For clarity only a few slots are shown, the read file contains much more of them.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
interface Document : Object&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE ;&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_CLOSEDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface OfficeDocument : Document&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_DOC_MODIFIED&lt;br /&gt;
    [&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    SID_PRINTDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = PrintExec_Impl ;&lt;br /&gt;
        StateMethod = NoState ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
shell SfxObjectShell&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    import OfficeDocument [AUTOMATION];&lt;br /&gt;
&lt;br /&gt;
    SID_DOCINFO&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The interface term is used slightly different in the sdi files that it is used by SFX, so now we use the name &amp;quot;slot arrays&amp;quot; for what the SFX itself calls &amp;quot;interfaces&amp;quot; to avoid confusion.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As a residue of the old Basic API sdi files define interfaces and shells separately, thus differentiating between slots for both Basic and UI usage and slots only used for UI purposes. This is obsolete today, but still used. Additionally sdi files define base and derived interfaces and shells in a granularity we don&amp;#039;t need anymore, but this is also a residue of the StarBasic support. This might change in the near future. Some interfaces even contained real basic properties that are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; represented by slots at all (like the &amp;quot;object&amp;quot; interface referenced in the example) but they are not used anymore.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;shell&amp;quot; defined in the file references a C++ implementation class SfxObjectShell. This part of the sdi file defines the complete slot interface of this class. The &amp;quot;import&amp;quot; statement tells the svidl compiler that it should add all slots of the interface &amp;quot;OfficeDocument&amp;quot; here (and of course all slots of its &amp;quot;base class&amp;quot; interfaces).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;Automation&amp;quot; attribute that is assigned to both interfaces and shells tells the svidl compiler whether it should generate a slot array definition for this interface/shell or not. We only generate arrays for shell, not for interfaces (because we don&amp;#039;t need them anymore). In former times we also generated arrays for interfaces, and the &amp;quot;Automation&amp;quot; attribute allowed us to prevent svidl from generating them for base class interfaces also. The &amp;quot;Automation&amp;quot; attribute will become obsolete pretty soon.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the interface/shell definition block slots are referenced by their SlotID. Svidl will get all attributes of the slot it needs to generate the array definition from the slot definition (that of course needs to be included and processed before svidl gets to the shell definition). In the block below this identifier (again with rectangular brackets) two additional attributes are specified: the names of one or two methods can be defined that SFX calls to get status information or execute the slot. These methods have a prescribed signature:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Class::StateMethod( SfxItemSet&amp;amp; );&lt;br /&gt;
void Class::ExecMethod( SfxRequest&amp;amp; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The ItemSet is used to collect the status information, the SfxRequest contains everything necessary for the execution of a slot.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The svidl compiler takes the shell class name and the method name and generates an inline stub function that calls the C++ member. A pointer to each stub is generated into the slot definitions. The stubs are generated into the same header file that contains the generated arrays. Here is an example for the first slot of the interface &amp;quot;Document&amp;quot; shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_EXEC_STUB( SfxObjectShell, ExecFile_Impl )&lt;br /&gt;
SFX_STATE_STUB( SfxObjectShell, GetState_Impl )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We use function stubs here because pointer to member functions don&amp;#039;t have a fixed size and so we can&amp;#039;t store them inside a struct like SfxSlot. A pointer to a C function always has the same size as normal pointer on the machine.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The slots in our example show that both pointers can be set or only one of them. A slot without an &amp;quot;Exec&amp;quot; function is a slot that only has a status, execution is done by another slot. A slot without a &amp;quot;GetState&amp;quot; function is always enabled and has no status. SFX automatically generates empty stub in these cases.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the block defining the functions theoretically all slot attributes of the referenced slot can be overwritten and sometimes this can be found. This should be seen as exceptional cases and it might happen in the near future that this overwriting will become forbidden for more and more attributes. The benefit of this is very limited but the risk of dangerous inconsistencies is high.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Here&amp;#039;s an exerpt of the generated header file that belongs to the SID_CLOSEDOC slot shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_SLOTMAP_ARG(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
// Slot Nr. 0 : 5502&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_SAVEASDOC,SID_SAVEASDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[1] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                0/*Offset*/, 9/*Count*/,&amp;quot;.SaveAs&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;SaveAs&amp;quot; ),&lt;br /&gt;
// Slot Nr.1 : 5503&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_CLOSEDOC,SID_CLOSEDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[3] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                9/*Offset*/, 2/*Count*/,&amp;quot;.CloseDoc&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;CloseDoc&amp;quot; ),&lt;br /&gt;
// Slot Nr.2 : 5504&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_PRINTDOC,SID_PRINTDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[2] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR_NONE,&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                11/*Offset*/, 10/*Count*/,&amp;quot;.Print&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;Print&amp;quot; ),&lt;br /&gt;
&lt;br /&gt;
         // ... to be continued ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The SFX_NEW_SLOT_ARG macro initializes a complete slot. Most of it should be pretty obvious from what was described already, please note the macros for the generated stubs (and especially SFX_STUB_PTR_STATE_NONE for the empty stub).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An interesting addition is the second line of each block, it contains an &amp;quot;Offset Next&amp;quot;. It is a pointer that points to the next slot in this shell that uses the same &amp;quot;GetState&amp;quot; method as the current slot. This enables SFX to collects status information for several slots at once when a complete update is requested. In general the shell code allows to group slots together in Exec/GetState methods and have more than one per shell for clarity reasons.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The last line in each block also contains an offset and a count. These attributes point to the arguments of the slot (of course only for methods). All possible arguments of all slots inside a shell are grouped into a single array, arguments that belong to the same slot of course beneath each other. The offset points to the first argument of a slot:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_ARGUMENTMAP(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_NAME,&amp;quot;URL&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILTER_NAME,&amp;quot;FilterName&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_PASSWORD,&amp;quot;Password&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,&amp;quot;FilterOptions&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_COMMENTS,&amp;quot;VersionComment&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_AUTHOR,&amp;quot;VersionAuthor&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_OVERWRITE,&amp;quot;Overwrite&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_UNPACK,&amp;quot;Unpacked&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_SAVETO,&amp;quot;SaveTo&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_SAVE,&amp;quot;SaveChanges&amp;quot;,SfxBoolItem),    // &amp;lt;---- here args for SID_CLOSEDOC start&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_FILENAME,&amp;quot;FileName&amp;quot;,SfxStringItem), // &amp;quot;count&amp;quot; is 2, so this is the second one&lt;br /&gt;
&lt;br /&gt;
    // ... to be continued ...&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In each module one header file containing all shells is created. It must be included in the source file of each shell class that contains the SFX_IMPL_INTERFACE macro. To avoid multiple definitions of the slot arrays by this multiple inclusion each code block assigned to a particular shell is framed by an &amp;quot;#ifdef ClassName&amp;quot; block, so in the source file the typical code sequence is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define SfxObjectShell&lt;br /&gt;
#include &amp;quot;sfxslots.hxx&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Other parts of the header file are framed by &amp;quot;#ifdef SFX_TYPEMAP&amp;quot; and this part mustbe activated only once also so each module contains one file that includes the generated header file and defined SFX_TYPEMAP before. This can be on e of the shell files that also defines its shell interface or it can be a different one. The part of the generated header file that is activated here is not necessary for the SFX core (the slot dispatching), but was necessary in former times for the type information of the old Basic API and for macro recording. Today it is used for the wrapper that mediates between SFX dispatching and the Dispatch API and thus also for macro recording because the current macro recorder also uses the Dispatch API.&lt;br /&gt;
&lt;br /&gt;
=== Items and UNO structs ===&lt;br /&gt;
&lt;br /&gt;
The old SFX based Basic API was made up by the property and method slot defined in the sdi files. All types are specified as SfxPoolItems and this was fine for StarBasic because internally these types are used also (for Sbx classes). For recording purposes it was necessary to know the &amp;quot;real&amp;quot; types behind a particular SfxPoolItem type and especially structured items needed to be split up into basic types because StarBasic doesn&amp;#039;t support structs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The mapping from a SfxPoolItem to an atomic or structured type is done by using a mapping table in another sdi file. Here&amp;#039;s an example for atomar types from the SFX module:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item void     SfxVoidItem&lt;br /&gt;
item BOOL     SfxBoolItem&lt;br /&gt;
item INT32    SfxUInt16Item&lt;br /&gt;
item INT16    SfxInt16Item&lt;br /&gt;
item INT32    SfxUInt32Item&lt;br /&gt;
item INT32    SfxInt32Item&lt;br /&gt;
item String   SfxStringItem&lt;br /&gt;
item BYTE     SfxByteItem&lt;br /&gt;
item INT16    SfxEnumItem&lt;br /&gt;
item INT16    SfxAllEnumItem&lt;br /&gt;
item INT16    TbxImageItem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It&amp;#039;s pretty straightforward: &amp;quot;item&amp;quot; declares the type to be atomar and it is followed by the Basic (or better: UNO) type and the Item representing it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Structured types are a little bit more complicated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
struct Point&lt;br /&gt;
{&lt;br /&gt;
    INT32    X    MID_X;&lt;br /&gt;
    INT32    Y    MID_Y;&lt;br /&gt;
};&lt;br /&gt;
item Point SfxPointItem;&lt;br /&gt;
&lt;br /&gt;
struct Rectangle&lt;br /&gt;
{&lt;br /&gt;
    INT32    Left    MID_RECT_LEFT;&lt;br /&gt;
    INT32    Top     MID_RECT_TOP;&lt;br /&gt;
    INT32    Width   MID_WIDTH;&lt;br /&gt;
    INT32    Height  MID_HEIGHT;&lt;br /&gt;
};&lt;br /&gt;
item Rectangle SfxRectangleItem;&lt;br /&gt;
&lt;br /&gt;
struct DocInfo&lt;br /&gt;
{&lt;br /&gt;
    BOOL    UseUserData    MID_DOCINFO_USEUSERDATA;&lt;br /&gt;
    BOOL    DeleteUserData MID_DOCINFO_DELETEUSERDATA;&lt;br /&gt;
    String  Title          MID_DOCINFO_TITLE;&lt;br /&gt;
    String  Subject        MID_DOCINFO_SUBJECT;&lt;br /&gt;
    String  KeyWords       MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    String  Description    MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    BOOL    AutoReload     MID_DOCINFO_AUTOLOADENABLED;&lt;br /&gt;
};&lt;br /&gt;
item DocInfo SfxDocumentInfoItem;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The examples show simple structs like a Point or more complex structs like a DocInfo. Structs can be nested, a DocInfo could contain a Point also. In the old StarBasic and also in todays macro recording each number of a struct was represented by an individual item (so an ID was needed that is unique in the complete argument set) and the names of these arguments where assembled from the name of the struct parameter name and the member name in the obvious from ArgName.MemberName.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For some items that are used only internally SFX based code (but not for recording purposes) no mapping was necessary and for syntactical completeness they are mapped to any atomar type, but his mapping is never used:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item String    SbxItem;                //! Dummy&lt;br /&gt;
item String    SfxObjectItem;          //! Dummy&lt;br /&gt;
item String    SfxTemplateItem;        //! Dummy&lt;br /&gt;
item String    SfxMacroInfoItem;       //! Dummy&lt;br /&gt;
item String    SfxImageItem;           //! Dummy&lt;br /&gt;
item String    SfxFrameItem;           //! Dummy&lt;br /&gt;
item String    SfxObjectShellItem;     //! Dummy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The svidl compiler creates the type mappings into the following form:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// example for an atomar type&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType0 aSfxStringItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxStringItem), 0&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
// example for a struct with 4 members&lt;br /&gt;
extern SfxType4 aSfxRectangleItem_Impl;&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType4 aSfxRectangleItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxRectangleItem}, 4, { {MID_RECT_LEFT,&amp;quot;Left&amp;quot;}, {MID_RECT_TOP,&amp;quot;Top&amp;quot;}, {MID_WIDTH,&amp;quot;Width&amp;quot;},&lt;br /&gt;
{MID_HEIGHT,&amp;quot;Height&amp;quot;} }&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It utilizes the TOOLS based RTTI that allows to offer a static factory method by using one of the TYPEINIT_AUTOFACTORY macros. This factory that can be used to create an item of the particular class. This is very important for the conversion routines that match items to UNO structs and vice versa. An item that does not offer a factory can&amp;#039;t be converted properly and so macro recording and Dispatch API are broken for this item.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The conversion between an item and a UNO type uses the virtual PutValue and QueryValue methods of the items. In the case of macro recording (where only atomar types are allowed) the &amp;quot;MemberID&amp;quot; parameter of these calls is used always in case of structured items and so it is important that the MIDs in the sdi file match the MIDs used in the implementation of the item. As an example, an SfxRectangleItem is recorded as two integer values.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The matching we use for the Dispatch API in our controllers on the other hand always converts to complete structs, not to atomar members, so the SfxRectangleItem is converted to a com.sun.star.awt.Rectangle. The rect Put/QueryValue in this case is called with MID=0. It&amp;#039;s vital for this process that &amp;#039;&amp;#039;&amp;#039;&amp;quot;0&amp;quot; is an invalid MID&amp;#039;&amp;#039;&amp;#039; that must not be used for any member.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Article]]&lt;br /&gt;
[[Category:Framework]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137243</id>
		<title>Framework/Article/Implementation of the Dispatch API In SFX2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137243"/>
		<updated>2009-08-11T16:54:12Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: fix formatting of examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementation of the Dispatch API in SFX2 ==&lt;br /&gt;
&lt;br /&gt;
The Dispatch API as described in chapter 7.1.6 of the Developer&amp;#039;s Guide is the backbone of our communication between &amp;quot;generic&amp;quot; UI elements and the document core implementations.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Traditionally SFX based components implemented this communication with a much older framework based on the so called &amp;#039;&amp;#039;slots&amp;#039;&amp;#039; and their organization into &amp;#039;&amp;#039;shells&amp;#039;&amp;#039;. While up to OpenOffice.org 1.1 our generic UI elements (menus, toolbars, etc.) still used the SFX based API directly to a large degree in OpenOffice.org 2.0 we changed this to using the Dispatch API exclusively, thus enabling us to share the UI components with other, not SFX based components. This paper describes how the old SFX implementation is matched to the &amp;#039;&amp;#039;DispatchProvider&amp;#039;&amp;#039; implementation that the component provides to the outside to make this happen.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The basic entity in the dispatch API is a command, and it&amp;#039;s represented by a &amp;#039;&amp;#039;CommandURL&amp;#039;&amp;#039;. For simplifications we suppose that this CommandURL is a string (though the API transport it as a pre-parsed struct). All commands supported by our components have the form &amp;#039;&amp;#039;.uno:xxxxx&amp;#039;&amp;#039; for historical reasons, where &amp;#039;&amp;#039;xxxxx&amp;#039;&amp;#039; represents an internal command name. Examples are “.uno:Print” or “.uno:Paste”. The functionality provided by the Dispatch API is support to execute such commands and getting status information for them (enabled/disabled or explicit information if the commands represents something type, a boolean, a string etc.).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As explained in the Developer&amp;#039;s Guide the Dispatch API builds on the idea that such commands can be passed along a chain of Dispatch Provider objects. Every object in this chain is free to decide whether it will handle a command or wants to pass it to the next chain member. Each document window and the Frame object managing it has such a chain of Dispatch providers and at least one object in this chain belongs to the document model/view pair bound to this window. It&amp;#039;s the so called Controller object that amongst other interfaces supports the XDispatchProvider interface. &lt;br /&gt;
&lt;br /&gt;
=== Controller objects in SFX2 ===&lt;br /&gt;
&lt;br /&gt;
SFX2 based components share a common base class for their Controller object implementation, SfxBaseController. It has a queryDispatch() implementation of the XDispatchProvider interface where the received CommandURLs are compared with the CommandURLs in the set of commands the particular component supports. It uses some comparable functionality in the old SFX2 framework that also is able to execute commands and give status information about them. The main difference between the old SFX2 base framework and the UNO framework is that the latter defines commands by strings (CommandURLs) and the former does it by integer values (SlotID, see below). So the main job of the queryDispatch() implementation in the SfxBaseController is to match a commandURL to the corresponding SlotID and then proceed using the internal old SFX2 implementation.&lt;br /&gt;
&lt;br /&gt;
SFX2 organizes functionality in contexts that can be merged together and exposed to the outside world by a single point of contact. This contact point is an SfxDispatcher object that every SfxBaseController owns. [Remark: this ownership is indirect as the real owner of the SfxDispatcher is an SfxViewFrame; but there is always a 1:1 relationship between an SfxViewFrame and an SfxBaseController.]&lt;br /&gt;
The SfxDispatcher internally maintains a stack of objects, each representing a context. Examples for these contexts are “document”, “view”, “text”, “table”, “cell” etc. All these objects are derived from a common base class “SfxShell”. The complete stack of all contextual objects available in a particular situation, the “merged context”, represents the function set applicable to the current selection or cursor position in a document. Context changes inside the document&amp;#039;s editing window cause pushing and popping of shell objects to and from the stack. &lt;br /&gt;
&lt;br /&gt;
This is how a typical stack in Writer looks when the cursor is in a normal text paragraph:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The same stack when the cursor is in a text paragraph in a table:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* Table&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
Another stack when a graphic is selected:&lt;br /&gt;
&lt;br /&gt;
* Graphic&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Frame&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Application&amp;#039;&amp;#039; contexts are there for historical reasons, we are still in the process of moving their functionality to the framework where other &amp;#039;&amp;#039;DispatchProviders&amp;#039;&amp;#039; outside of the component take over. I omitted the &amp;quot;Form&amp;quot; context here because it&amp;#039;s somewhat confusing.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slots and Interfaces ==&lt;br /&gt;
&lt;br /&gt;
Each SfxShell class has a static member called SfxInterface. It is an object containing an array of SfxSlot structs. Each “slot” represents a command supported by the context (shell) it is assigned to. So the complete SfxInterface defines the functionality an instance of the particular SfxShell class using this interface provides.&lt;br /&gt;
&lt;br /&gt;
=== The SfxSlot struct ===&lt;br /&gt;
&lt;br /&gt;
The “slot” struct contains all necessary information that the SfxDispatcher needs to work together with the Shell object containing the slot. The slot contains function pointers that the dispatcher can call to either execute the command represented by the slot or get status information about it. Thus the dispatcher doesn&amp;#039;t need to know the concrete implementation classes of the shells, it can work with them through their base class (SfxShell) interface.&lt;br /&gt;
&lt;br /&gt;
Other important parts of the SfxSlot struct are the “name” of the slot and the numerical ID of it, its so called SlotID. Slot names have been chosen so that they match the part after the colon in “.uno:...” CommandURLs. Mapping between CommandURLs and SlotIDs to then need a simple lookup in all SfxInterfaces of the SfxShells on the shell stack of the SfxDispatcher. More about slots can be found below. &lt;br /&gt;
&lt;br /&gt;
When the SfxDispatcher is asked for support of a particular command it searches for a slot with the given internal command name starting with the top most shell on the stack and then proceeding with the next one until success. This way “higher prioritized” contexts can overrule functionality from “lower prioritized” contexts. As an example, the “document” context has a generic implementation of the “Print” command, but each particular “view” context can overrule the generic behavior and define a specific way of printing. &lt;br /&gt;
&lt;br /&gt;
=== The SfxInterface class ===&lt;br /&gt;
&lt;br /&gt;
The slot arrays aka SfxInterfaces are static to each shell class and so each interface is a part of the data segment of the library that contains the shell code assigned to this interface. The data for these arrays needs to be predefined in source files. Writing huge arrays into C++ source files is a very tedious work and so we use a different kind of source file that is easier to edit and have a compiler (“svidl”) that takes these files and compiles them into a generated header file containing the definition of the arrays. These idl files are located in the sdi sub folders of each SFX based project and have the extension “sdi”. The generated header file contains the definitions (not only declarations) of all “interfaces” of the library and some “#define” magic allows to have each interface generated only once. More about this process below.&lt;br /&gt;
&lt;br /&gt;
=== Slots, interfaces, shells, dispatchers ===&lt;br /&gt;
&lt;br /&gt;
In OOo1.x the SfxBaseController utilized its SfxDispatcher and its stack to provide a generic Dispatch object for every supported command. It gets the CommandURL in the queryDispatch call, looks for a slot on the dispatcher stack with a suitable internal command name and in case of success creates a dispatch object and returns it. There is a drawback in this approach: if the context changes (means: shells are pushed or popped) slots might appear or disappear from the stack so commands that had been supported aren&amp;#039;t any longer or the other way around. This forces the DispatchProvider to request a complete refetching of all dispatch objects and so can be time consuming.&lt;br /&gt;
&lt;br /&gt;
In OOo2.x we utilize the “slot pool” of the SFX based modules. This is the entirety of all “interfaces” (slot arrays) the module supports. On startup all interfaces register at the module class (SfxModule base class) so it is easy to iterate through its interfaces. Now a Dispatch Object is returned when the slot is found anywhere in the slot pool, even if the interface is not on the stack, but in this case the Dispatch Object reports its slots as disabled everytime it is used. This can be determined dynamically so context changes don&amp;#039;t need external updates, it&amp;#039;s enough to update the internal status of the already created Dispatch Objects. This approach also enables some future optimizations for the representation of slot arrays that will be discussed later.&lt;br /&gt;
&lt;br /&gt;
== Slot Processing ==&lt;br /&gt;
&lt;br /&gt;
In former (Pre-UNO) time the slots where not only used for command dispatching but also for the implementation of our Basic API (up to StarOffice 5.2), so the slot arrays where &amp;quot;real&amp;quot; &amp;#039;&amp;#039;interfaces&amp;#039;&amp;#039;. There are a lot residues of the in the sdi files (see below), but they aren&amp;#039;t used anymore.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slot definitions ===&lt;br /&gt;
&lt;br /&gt;
The use case explains why there are two different kinds of slots, property slots and method slots, and the difference between them can be spotted easily from the definition of a slot in the sdi file. Here are two examples, the first one describing a method slot and the second one describing a property slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem About SID_ABOUT&lt;br /&gt;
()&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxBoolItem DesignerDialog SID_STYLE_DESIGNER&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = TRUE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = TRUE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    Readyonly = FALSE,&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_FORMAT;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each slot is a block in rectangular bracket filled with attributes that is preceded by two lines that identify the slot and define its nature. The exact meaning of all the attributes is explained below, the most notable difference is seen in the second line of each block: the paranthesis of the &amp;quot;About&amp;quot; slot classify it as a method while the other one (without paranthesis) is a property. As explained above, this classification goes back to the old Basic API but besides that it&amp;#039;s important for the implementation of macro recording that is also based on the Dispatch API (and for SFX component it&amp;#039;s implemented using slots). &amp;quot;Method&amp;quot; and &amp;quot;property&amp;quot; slots are recorded differently.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The name in the middle of each first line of a block was used as the name of the property or method in the Basic API and today this name is the internal command name that is matched to any &amp;quot;.uno:xxx&amp;quot; CommandURLs of the Dispatch API. As an example, the slot named &amp;quot;Undo&amp;quot; is assigned to the &amp;quot;.uno:Undo&amp;quot; command. This matching requires that the internal command names have to be unique in the complete module. This uniqueness is verified by the svidl compiler that breaks in case if name clashes in a module.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last part of each first line is the so called SlotID that in former times was the real identifier (not as today the internal command name) and it was also used inside the GUI element configuration files where today CommandURLs are used. So this SlotID had to be unique for the module at least, currently it&amp;#039;s even globally unique but at least theoretically it is now obsolete. Inside the slot processing only the textual representation of the SlotID is relevant , not its numerical value.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Property slots have a type specified by the first part of the first line. The same data in a method slot specifies the return value of the associated method. Method slots also can gave parameters (non empty paranthesis) and a return value that could be used in the old Basic API of StarOffice, but also in internal methods of the SfxDispatcher. Strictly speaking the latter is still possible but we try to get rid of this. Here are two examples for slots with arguments, with and without return value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem Undo SID_UNDO&lt;br /&gt;
( SfxUInt16Item Undo SID_UNDO )&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Volatile,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* status */&lt;br /&gt;
    SlotType = SfxStringItem&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_EDIT;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxObjectItem Open SID_OPENDOC&lt;br /&gt;
(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, SfxStringItem OpenFlags SID_OPTIONS,&lt;br /&gt;
SfxStringItem Password SID_PASSWORD, SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS, SfxInt16Item Version SID_VERSION,&lt;br /&gt;
SfxStringItem Referer SID_REFERER)&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = TRUE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Asynchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As shown in the examples, property types and return values are given as &amp;#039;&amp;#039;Items&amp;#039;&amp;#039;, the whole slot &amp;quot;API&amp;quot; is based on SfxPoolItems, each identified by its ID. These IDs must be unique only in the context of the method.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Slots are used to bind their functionality to UI elements. In former times this was done by writing the SlotIDs into the UI element configuration files, today we use CommandURLs. Binding slots to UI elements (today indirectly through the &amp;#039;&amp;#039;Dispatch Object&amp;#039;&amp;#039;) means that the binding client wants to get status information from it and/or possibly wants to execute it, in most cases (means: the standard controllers) without any parameters.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The type of the status update information is given by the &amp;#039;&amp;#039;SlotType&amp;#039;&amp;#039; attribute. For property slots like &amp;quot;DesignerDialog&amp;quot; this is identical with its property type (and so this attribute is not explictly assigned in the block), for method slots it must be specified like shown in the &amp;quot;Undo&amp;quot; example. If a method slot doesn&amp;#039;t specify a SlotType it has no status (except &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; or &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;). So in the examples &amp;quot;Undo&amp;quot; is of type String, &amp;quot;DesignerDialog&amp;quot; of type Boolean while the other slots don&amp;#039;t have a status.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A menu controller will reflect this by showing status of the &amp;quot;Undo&amp;quot; entry as its title and setting or unsetting a check mark in front of the &amp;quot;DesignerDialof&amp;quot; entry reflecting its boolean status, a toolbar controller reflects the latter one in a pressed/unpressed state, the former in different button titles (or quick help texts that replace the button title if it&amp;#039;s switched off). Other types of status information need speccialized controller that know how to deal with this kind of information.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All the other attributes inside the block of a slot are &amp;#039;&amp;#039;flags&amp;#039;&amp;#039; that define the behavior of the slot at runtime. Some of the attributes are contradicting (like synchron or asynchron) and so of course only one of them can be set. The table below sums them up in one line.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;80%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!width=&amp;quot;40%&amp;quot;|Attribute&lt;br /&gt;
!width=&amp;quot;60%&amp;quot;|Meaning&lt;br /&gt;
|-&lt;br /&gt;
||Cachable (Volatile)|| Slot status is cached, sending a new status to controllers need an &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call that forces SFX to fetch a new status. Volatile slots are not cached and SFX permanently asks for status information based on a timer.&lt;br /&gt;
|-&lt;br /&gt;
|AutoUpdate || TRUE: After execution of the slot SFX automatically fetches the new status, no &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call necessary&lt;br /&gt;
|-&lt;br /&gt;
|FastCall || TRUE: SFX doesn&amp;#039;t check &amp;quot;enable&amp;quot; status before executing a slot&lt;br /&gt;
|-&lt;br /&gt;
|Toggle || Execute without parameters automatically toggles the current status. Works for property slots with boolean or enum type.&lt;br /&gt;
|-&lt;br /&gt;
|HasCoreId || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|HasDialog || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|ReadOnlyDoc || FALSE: SFX automatically disables this slot if the document is read only&lt;br /&gt;
|-&lt;br /&gt;
|Container || TRUE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the object.&amp;lt;br/&amp;gt;FALSE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the container.&lt;br /&gt;
|-&lt;br /&gt;
|RecordAbsolute || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|RecordPerSet (RecordPerItem, NoRecord) || See explanation for Recording.&lt;br /&gt;
|-&lt;br /&gt;
|Synchron (Asynchron) || Asynchron: SFX execute the slot by posting a user event instead of directly calling the execute function of the slot&lt;br /&gt;
|-&lt;br /&gt;
|Readonly || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|AccelConfig || Slot may be offered in the configuration dialog for keyboard shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|MenuConfig || Slot may be offered in the configuration dialog for menus&lt;br /&gt;
|-&lt;br /&gt;
|StatusBarConfig || Slot may be offered in the configuration dialog for status bar&lt;br /&gt;
|-&lt;br /&gt;
|ToolboxConfig || Slot may be offered in the configuration dialog for toolbars&lt;br /&gt;
|-&lt;br /&gt;
|GroupId || Assign the slot to a function group in the configuration dialogs (module is free to define categories)&lt;br /&gt;
|-&lt;br /&gt;
|ImageRotation || Toolbar images are rotated in case of writing direction from right to left&lt;br /&gt;
|-&lt;br /&gt;
|ImageReflection || Toolbar images are rotated in case of vertical text orientation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interface definitions ===&lt;br /&gt;
&lt;br /&gt;
As already mentioned, slots are bundled to interfaces and interfaces are used by shells. SDI files know both terms. Here&amp;#039;s an example how this looks. For clarity only a few slots are shown, the read file contains much more of them.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
interface Document : Object&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE ;&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_CLOSEDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface OfficeDocument : Document&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_DOC_MODIFIED&lt;br /&gt;
    [&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    SID_PRINTDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = PrintExec_Impl ;&lt;br /&gt;
        StateMethod = NoState ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
shell SfxObjectShell&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    import OfficeDocument [AUTOMATION];&lt;br /&gt;
&lt;br /&gt;
    SID_DOCINFO&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The interface term is used slightly different in the sdi files that it is used by SFX, so now we use the name &amp;quot;slot arrays&amp;quot; for what the SFX itself calls &amp;quot;interfaces&amp;quot; to avoid confusion.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As a residue of the old Basic API sdi files define interfaces and shells separately, thus differentiating between slots for both Basic and UI usage and slots only used for UI purposes. This is obsolete today, but still used. Additionally sdi files define base and derived interfaces and shells in a granularity we don&amp;#039;t need anymore, but this is also a residue of the StarBasic support. This might change in the near future. Some interfaces even contained real basic properties that are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; represented by slots at all (like the &amp;quot;object&amp;quot; interface referenced in the example) but they are not used anymore.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;shell&amp;quot; defined in the file references a C++ implementation class SfxObjectShell. This part of the sdi file defines the complete slot interface of this class. The &amp;quot;import&amp;quot; statement tells the svidl compiler that it should add all slots of the interface &amp;quot;OfficeDocument&amp;quot; here (and of course all slots of its &amp;quot;base class&amp;quot; interfaces).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;Automation&amp;quot; attribute that is assigned to both interfaces and shells tells the svidl compiler whether it should generate a slot array definition for this interface/shell or not. We only generate arrays for shell, not for interfaces (because we don&amp;#039;t need them anymore). In former times we also generated arrays for interfaces, and the &amp;quot;Automation&amp;quot; attribute allowed us to prevent svidl from generating them for base class interfaces also. The &amp;quot;Automation&amp;quot; attribute will become obsolete pretty soon.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the interface/shell definition block slots are referenced by their SlotID. Svidl will get all attributes of the slot it needs to generate the array definition from the slot definition (that of course needs to be included and processed before svidl gets to the shell definition). In the block below this identifier (again with rectangular brackets) two additional attributes are specified: the names of one or two methods can be defined that SFX calls to get status information or execute the slot. These methods have a prescribed signature:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Class::StateMethod( SfxItemSet&amp;amp; );&lt;br /&gt;
void Class::ExecMethod( SfxRequest&amp;amp; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The ItemSet is used to collect the status information, the SfxRequest contains everything necessary for the execution of a slot.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The svidl compiler takes the shell class name and the method name and generates an inline stub function that calls the C++ member. A pointer to each stub is generated into the slot definitions. The stubs are generated into the same header file that contains the generated arrays. Here is an example for the first slot of the interface &amp;quot;Document&amp;quot; shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_EXEC_STUB( SfxObjectShell, ExecFile_Impl )&lt;br /&gt;
SFX_STATE_STUB( SfxObjectShell, GetState_Impl )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We use function stubs here because pointer to member functions don&amp;#039;t have a fixed size and so we can&amp;#039;t store them inside a struct like SfxSlot. A pointer to a C function always has the same size as normal pointer on the machine.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The slots in our example show that both pointers can be set or only one of them. A slot without an &amp;quot;Exec&amp;quot; function is a slot that only has a status, execution is done by another slot. A slot without a &amp;quot;GetState&amp;quot; function is always enabled and has no status. SFX automatically generates empty stub in these cases.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the block defining the functions theoretically all slot attributes of the referenced slot can be overwritten and sometimes this can be found. This should be seen as exceptional cases and it might happen in the near future that this overwriting will become forbidden for more and more attributes. The benefit of this is very limited but the risk of dangerous inconsistencies is high.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Here&amp;#039;s an exerpt of the generated header file that belongs to the SID_CLOSEDOC slot shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_SLOTMAP_ARG(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
// Slot Nr. 0 : 5502&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_SAVEASDOC,SID_SAVEASDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[1] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                0/*Offset*/, 9/*Count*/,&amp;quot;.SaveAs&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;SaveAs&amp;quot; ),&lt;br /&gt;
// Slot Nr.1 : 5503&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_CLOSEDOC,SID_CLOSEDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[3] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                9/*Offset*/, 2/*Count*/,&amp;quot;.CloseDoc&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;CloseDoc&amp;quot; ),&lt;br /&gt;
// Slot Nr.2 : 5504&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_PRINTDOC,SID_PRINTDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[2] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR_NONE,&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                11/*Offset*/, 10/*Count*/,&amp;quot;.Print&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;Print&amp;quot; ),&lt;br /&gt;
&lt;br /&gt;
         // ... to be continued ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The SFX_NEW_SLOT_ARG macro initializes a complete slot. Most of it should be pretty obvious from what was described already, please note the macros for the generated stubs (and especially SFX_STUB_PTR_STATE_NONE for the empty stub).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An interesting addition is the second line of each block, it contains an &amp;quot;Offset Next&amp;quot;. It is a pointer that points to the next slot in this shell that uses the same &amp;quot;GetState&amp;quot; method as the current slot. This enables SFX to collects status information for several slots at once when a complete update is requested. In general the shell code allows to group slots together in Exec/GetState methods and have more than one per shell for clarity reasons.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The last line in each block also contains an offset and a count. These attributes point to the arguments of the slot (of course only for methods). All possible arguments of all slots inside a shell are grouped into a single array, arguments that belong to the same slot of course beneath each other. The offset points to the first argument of a slot:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_ARGUMENTMAP(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_NAME,&amp;quot;URL&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILTER_NAME,&amp;quot;FilterName&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_PASSWORD,&amp;quot;Password&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,&amp;quot;FilterOptions&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_COMMENTS,&amp;quot;VersionComment&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_AUTHOR,&amp;quot;VersionAuthor&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_OVERWRITE,&amp;quot;Overwrite&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_UNPACK,&amp;quot;Unpacked&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_SAVETO,&amp;quot;SaveTo&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_SAVE,&amp;quot;SaveChanges&amp;quot;,SfxBoolItem),    // &amp;lt;---- here args for SID_CLOSEDOC start&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_FILENAME,&amp;quot;FileName&amp;quot;,SfxStringItem), // &amp;quot;count&amp;quot; is 2, so this is the second one&lt;br /&gt;
&lt;br /&gt;
    // ... to be continued ...&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In each module one header file containing all shells is created. It must be included in the source file of each shell class that contains the SFX_IMPL_INTERFACE macro. To avoid multiple definitions of the slot arrays by this multiple inclusion each code block assigned to a particular shell is framed by an &amp;quot;#ifdef ClassName&amp;quot; block, so in the source file the typical code sequence is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define SfxObjectShell&lt;br /&gt;
#include &amp;quot;sfxslots.hxx&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Other parts of the header file are framed by &amp;quot;#ifdef SFX_TYPEMAP&amp;quot; and this part mustbe activated only once also so each module contains one file that includes the generated header file and defined SFX_TYPEMAP before. This can be on e of the shell files that also defines its shell interface or it can be a different one. The part of the generated header file that is activated here is not necessary for the SFX core (the slot dispatching), but was necessary in former times for the type information of the old Basic API and for macro recording. Today it is used for the wrapper that mediates between SFX dispatching and the Dispatch API and thus also for macro recording because the current macro recorder also uses the Dispatch API.&lt;br /&gt;
&lt;br /&gt;
=== Items and UNO structs ===&lt;br /&gt;
&lt;br /&gt;
The old SFX based Basic API was made up by the property and method slot defined in the sdi files. All types are specified as SfxPoolItems and this was fine for StarBasic because internally these types are used also (for Sbx classes). For recording purposes it was necessary to know the &amp;quot;real&amp;quot; types behind a particular SfxPoolItem type and especially structured items needed to be split up into basic types because StarBasic doesn&amp;#039;t support structs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The mapping from a SfxPoolItem to an atomar or structured type is done by using a mapping table in another sdi file. Here&amp;#039;s an example for atomar types from the SFX module:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item void     SfxVoidItem&lt;br /&gt;
item BOOL     SfxBoolItem&lt;br /&gt;
item INT32    SfxUInt16Item&lt;br /&gt;
item INT16    SfxInt16Item&lt;br /&gt;
item INT32    SfxUInt32Item&lt;br /&gt;
item INT32    SfxInt32Item&lt;br /&gt;
item String   SfxStringItem&lt;br /&gt;
item BYTE     SfxByteItem&lt;br /&gt;
item INT16    SfxEnumItem&lt;br /&gt;
item INT16    SfxAllEnumItem&lt;br /&gt;
item INT16    TbxImageItem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It&amp;#039;s pretty straightforward: &amp;quot;item&amp;quot; declares the type to be atomar and it is followed by the Basic (or better: UNO) type and the Item representing it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Structured types are a little bit more complicated:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
struct Point&lt;br /&gt;
{&lt;br /&gt;
    INT32    X    MID_X;&lt;br /&gt;
    INT32    Y    MID_Y;&lt;br /&gt;
};&lt;br /&gt;
item Point SfxPointItem;&lt;br /&gt;
&lt;br /&gt;
struct Rectangle&lt;br /&gt;
{&lt;br /&gt;
    INT32    Left    MID_RECT_LEFT;&lt;br /&gt;
    INT32    Top     MID_RECT_TOP;&lt;br /&gt;
    INT32    Width   MID_WIDTH;&lt;br /&gt;
    INT32    Height  MID_HEIGHT;&lt;br /&gt;
};&lt;br /&gt;
item Rectangle SfxRectangleItem;&lt;br /&gt;
&lt;br /&gt;
struct DocInfo&lt;br /&gt;
{&lt;br /&gt;
    BOOL    UseUserData    MID_DOCINFO_USEUSERDATA;&lt;br /&gt;
    BOOL    DeleteUserData MID_DOCINFO_DELETEUSERDATA;&lt;br /&gt;
    String  Title          MID_DOCINFO_TITLE;&lt;br /&gt;
    String  Subject        MID_DOCINFO_SUBJECT;&lt;br /&gt;
    String  KeyWords       MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    String  Description    MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    BOOL    AutoReload     MID_DOCINFO_AUTOLOADENABLED;&lt;br /&gt;
};&lt;br /&gt;
item DocInfo SfxDocumentInfoItem;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The examples show simple structs like a Point or more complex structs like a DocInfo. Structs can be nested, a DocInfo could contain a Point also. In the old StarBasic and also in todays macro recording each number of a struct was represented by an individual item (so an ID was needed that is unique in the complete argument set) and the names of these arguments where assembled from the name of the struct parameter name and the member name in the obvious from ArgName.MemberName.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For some items that are used only internally SFX based code (but not for recording purposes) no mapping was necessary and for syntactical completeness they are mapped to any atomar type, but his mapping is never used:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
item String    SbxItem;                //! Dummy&lt;br /&gt;
item String    SfxObjectItem;          //! Dummy&lt;br /&gt;
item String    SfxTemplateItem;        //! Dummy&lt;br /&gt;
item String    SfxMacroInfoItem;       //! Dummy&lt;br /&gt;
item String    SfxImageItem;           //! Dummy&lt;br /&gt;
item String    SfxFrameItem;           //! Dummy&lt;br /&gt;
item String    SfxObjectShellItem;     //! Dummy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The svidl compiler creates the type mappings into the following form:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// example for an atomar type&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType0 aSfxStringItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxStringItem), 0&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
// example for a struct with 4 members&lt;br /&gt;
extern SfxType4 aSfxRectangleItem_Impl;&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType4 aSfxRectangleItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxRectangleItem}, 4, { {MID_RECT_LEFT,&amp;quot;Left&amp;quot;}, {MID_RECT_TOP,&amp;quot;Top&amp;quot;}, {MID_WIDTH,&amp;quot;Width&amp;quot;},&lt;br /&gt;
{MID_HEIGHT,&amp;quot;Height&amp;quot;} }&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It utilizes the TOOLS based RTTI that allows to offer a static factory method by using one of the TYPEINIT_AUTOFACTORY macros. This factory that can be used to create an item of the particular class. This is very important for the conversion routines that match items to UNO structs and vice versa. An item that does not offer a factory can&amp;#039;t be converted properly and so macro recording and Dispatch API are broken for this item.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The conversion between an item and a UNO type uses the virtual PutValue and QueryValue methods of the items. In the case of macro recording (where only atomar types are allowed) the &amp;quot;MemberID&amp;quot; parameter of these calls is used always in case of structured items and so it is important that the MIDs in the sdi file match the MIDs used in the implementation of the item. As an example, an SfxRectangleItem is recorded as two integer values.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The matching we use for the Dispatch API in our controllers on the other hand always converts to complete structs, not to atomar members, so the SfxRectangleItem is converted to a com.sun.star.awt.Rectangle. The rect Put/QueryValue in this case is called with MID=0. It&amp;#039;s vital for this process that &amp;#039;&amp;#039;&amp;#039;&amp;quot;0&amp;quot; is an invalid MID&amp;#039;&amp;#039;&amp;#039; that must not be used for any member.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Article]]&lt;br /&gt;
[[Category:Framework]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137238</id>
		<title>Framework/Article/Implementation of the Dispatch API In SFX2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137238"/>
		<updated>2009-08-11T16:34:27Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: fix of the previous fix :(&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementation of the Dispatch API in SFX2 ==&lt;br /&gt;
&lt;br /&gt;
The Dispatch API as described in chapter 7.1.6 of the Developer&amp;#039;s Guide is the backbone of our communication between &amp;quot;generic&amp;quot; UI elements and the document core implementations.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Traditionally SFX based components implemented this communication with a much older framework based on the so called &amp;#039;&amp;#039;slots&amp;#039;&amp;#039; and their organization into &amp;#039;&amp;#039;shells&amp;#039;&amp;#039;. While up to OpenOffice.org 1.1 our generic UI elements (menus, toolbars, etc.) still used the SFX based API directly to a large degree in OpenOffice.org 2.0 we changed this to using the Dispatch API exclusively, thus enabling us to share the UI components with other, not SFX based components. This paper describes how the old SFX implementation is matched to the &amp;#039;&amp;#039;DispatchProvider&amp;#039;&amp;#039; implementation that the component provides to the outside to make this happen.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The basic entity in the dispatch API is a command, and it&amp;#039;s represented by a &amp;#039;&amp;#039;CommandURL&amp;#039;&amp;#039;. For simplifications we suppose that this CommandURL is a string (though the API transport it as a pre-parsed struct). All commands supported by our components have the form &amp;#039;&amp;#039;.uno:xxxxx&amp;#039;&amp;#039; for historical reasons, where &amp;#039;&amp;#039;xxxxx&amp;#039;&amp;#039; represents an internal command name. Examples are “.uno:Print” or “.uno:Paste”. The functionality provided by the Dispatch API is support to execute such commands and getting status information for them (enabled/disabled or explicit information if the commands represents something type, a boolean, a string etc.).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As explained in the Developer&amp;#039;s Guide the Dispatch API builds on the idea that such commands can be passed along a chain of Dispatch Provider objects. Every object in this chain is free to decide whether it will handle a command or wants to pass it to the next chain member. Each document window and the Frame object managing it has such a chain of Dispatch providers and at least one object in this chain belongs to the document model/view pair bound to this window. It&amp;#039;s the so called Controller object that amongst other interfaces supports the XDispatchProvider interface. &lt;br /&gt;
&lt;br /&gt;
=== Controller objects in SFX2 ===&lt;br /&gt;
&lt;br /&gt;
SFX2 based components share a common base class for their Controller object implementation, SfxBaseController. It has a queryDispatch() implementation of the XDispatchProvider interface where the received CommandURLs are compared with the CommandURLs in the set of commands the particular component supports. It uses some comparable functionality in the old SFX2 framework that also is able to execute commands and give status information about them. The main difference between the old SFX2 base framework and the UNO framework is that the latter defines commands by strings (CommandURLs) and the former does it by integer values (SlotID, see below). So the main job of the queryDispatch() implementation in the SfxBaseController is to match a commandURL to the corresponding SlotID and then proceed using the internal old SFX2 implementation.&lt;br /&gt;
&lt;br /&gt;
SFX2 organizes functionality in contexts that can be merged together and exposed to the outside world by a single point of contact. This contact point is an SfxDispatcher object that every SfxBaseController owns. [Remark: this ownership is indirect as the real owner of the SfxDispatcher is an SfxViewFrame; but there is always a 1:1 relationship between an SfxViewFrame and an SfxBaseController.]&lt;br /&gt;
The SfxDispatcher internally maintains a stack of objects, each representing a context. Examples for these contexts are “document”, “view”, “text”, “table”, “cell” etc. All these objects are derived from a common base class “SfxShell”. The complete stack of all contextual objects available in a particular situation, the “merged context”, represents the function set applicable to the current selection or cursor position in a document. Context changes inside the document&amp;#039;s editing window cause pushing and popping of shell objects to and from the stack. &lt;br /&gt;
&lt;br /&gt;
This is how a typical stack in Writer looks when the cursor is in a normal text paragraph:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The same stack when the cursor is in a text paragraph in a table:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* Table&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
Another stack when a graphic is selected:&lt;br /&gt;
&lt;br /&gt;
* Graphic&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Frame&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Application&amp;#039;&amp;#039; contexts are there for historical reasons, we are still in the process of moving their functionality to the framework where other &amp;#039;&amp;#039;DispatchProviders&amp;#039;&amp;#039; outside of the component take over. I omitted the &amp;quot;Form&amp;quot; context here because it&amp;#039;s somewhat confusing.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slots and Interfaces ==&lt;br /&gt;
&lt;br /&gt;
Each SfxShell class has a static member called SfxInterface. It is an object containing an array of SfxSlot structs. Each “slot” represents a command supported by the context (shell) it is assigned to. So the complete SfxInterface defines the functionality an instance of the particular SfxShell class using this interface provides.&lt;br /&gt;
&lt;br /&gt;
=== The SfxSlot struct ===&lt;br /&gt;
&lt;br /&gt;
The “slot” struct contains all necessary information that the SfxDispatcher needs to work together with the Shell object containing the slot. The slot contains function pointers that the dispatcher can call to either execute the command represented by the slot or get status information about it. Thus the dispatcher doesn&amp;#039;t need to know the concrete implementation classes of the shells, it can work with them through their base class (SfxShell) interface.&lt;br /&gt;
&lt;br /&gt;
Other important parts of the SfxSlot struct are the “name” of the slot and the numerical ID of it, its so called SlotID. Slot names have been chosen so that they match the part after the colon in “.uno:...” CommandURLs. Mapping between CommandURLs and SlotIDs to then need a simple lookup in all SfxInterfaces of the SfxShells on the shell stack of the SfxDispatcher. More about slots can be found below. &lt;br /&gt;
&lt;br /&gt;
When the SfxDispatcher is asked for support of a particular command it searches for a slot with the given internal command name starting with the top most shell on the stack and then proceeding with the next one until success. This way “higher prioritized” contexts can overrule functionality from “lower prioritized” contexts. As an example, the “document” context has a generic implementation of the “Print” command, but each particular “view” context can overrule the generic behavior and define a specific way of printing. &lt;br /&gt;
&lt;br /&gt;
=== The SfxInterface class ===&lt;br /&gt;
&lt;br /&gt;
The slot arrays aka SfxInterfaces are static to each shell class and so each interface is a part of the data segment of the library that contains the shell code assigned to this interface. The data for these arrays needs to be predefined in source files. Writing huge arrays into C++ source files is a very tedious work and so we use a different kind of source file that is easier to edit and have a compiler (“svidl”) that takes these files and compiles them into a generated header file containing the definition of the arrays. These idl files are located in the sdi sub folders of each SFX based project and have the extension “sdi”. The generated header file contains the definitions (not only declarations) of all “interfaces” of the library and some “#define” magic allows to have each interface generated only once. More about this process below.&lt;br /&gt;
&lt;br /&gt;
=== Slots, interfaces, shells, dispatchers ===&lt;br /&gt;
&lt;br /&gt;
In OOo1.x the SfxBaseController utilized its SfxDispatcher and its stack to provide a generic Dispatch object for every supported command. It gets the CommandURL in the queryDispatch call, looks for a slot on the dispatcher stack with a suitable internal command name and in case of success creates a dispatch object and returns it. There is a drawback in this approach: if the context changes (means: shells are pushed or popped) slots might appear or disappear from the stack so commands that had been supported aren&amp;#039;t any longer or the other way around. This forces the DispatchProvider to request a complete refetching of all dispatch objects and so can be time consuming.&lt;br /&gt;
&lt;br /&gt;
In OOo2.x we utilize the “slot pool” of the SFX based modules. This is the entirety of all “interfaces” (slot arrays) the module supports. On startup all interfaces register at the module class (SfxModule base class) so it is easy to iterate through its interfaces. Now a Dispatch Object is returned when the slot is found anywhere in the slot pool, even if the interface is not on the stack, but in this case the Dispatch Object reports its slots as disabled everytime it is used. This can be determined dynamically so context changes don&amp;#039;t need external updates, it&amp;#039;s enough to update the internal status of the already created Dispatch Objects. This approach also enables some future optimizations for the representation of slot arrays that will be discussed later.&lt;br /&gt;
&lt;br /&gt;
== Slot Processing ==&lt;br /&gt;
&lt;br /&gt;
In former (Pre-UNO) time the slots where not only used for command dispatching but also for the implementation of our Basic API (up to StarOffice 5.2), so the slot arrays where &amp;quot;real&amp;quot; &amp;#039;&amp;#039;interfaces&amp;#039;&amp;#039;. There are a lot residues of the in the sdi files (see below), but they aren&amp;#039;t used anymore.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slot definitions ===&lt;br /&gt;
&lt;br /&gt;
The use case explains why there are two different kinds of slots, property slots and method slots, and the difference between them can be spotted easily from the definition of a slot in the sdi file. Here are two examples, the first one describing a method slot and the second one describing a property slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem About SID_ABOUT&lt;br /&gt;
()&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxBoolItem DesignerDialog SID_STYLE_DESIGNER&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = TRUE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = TRUE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    Readyonly = FALSE,&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_FORMAT;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each slot is a block in rectangular bracket filled with attributes that is preceded by two lines that identify the slot and define its nature. The exact meaning of all the attributes is explained below, the most notable difference is seen in the second line of each block: the paranthesis of the &amp;quot;About&amp;quot; slot classify it as a method while the other one (without paranthesis) is a property. As explained above, this classification goes back to the old Basic API but besides that it&amp;#039;s important for the implementation of macro recording that is also based on the Dispatch API (and for SFX component it&amp;#039;s implemented using slots). &amp;quot;Method&amp;quot; and &amp;quot;property&amp;quot; slots are recorded differently.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The name in the middle of each first line of a block was used as the name of the property or method in the Basic API and today this name is the internal command name that is matched to any &amp;quot;.uno:xxx&amp;quot; CommandURLs of the Dispatch API. As an example, the slot named &amp;quot;Undo&amp;quot; is assigned to the &amp;quot;.uno:Undo&amp;quot; command. This matching requires that the internal command names have to be unique in the complete module. This uniqueness is verified by the svidl compiler that breaks in case if name clashes in a module.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last part of each first line is the so called SlotID that in former times was the real identifier (not as today the internal command name) and it was also used inside the GUI element configuration files where today CommandURLs are used. So this SlotID had to be unique for the module at least, currently it&amp;#039;s even globally unique but at least theoretically it is now obsolete. Inside the slot processing only the textual representation of the SlotID is relevant , not its numerical value.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Property slots have a type specified by the first part of the first line. The same data in a method slot specifies the return value of the associated method. Method slots also can gave parameters (non empty paranthesis) and a return value that could be used in the old Basic API of StarOffice, but also in internal methods of the SfxDispatcher. Strictly speaking the latter is still possible but we try to get rid of this. Here are two examples for slots with arguments, with and without return value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem Undo SID_UNDO&lt;br /&gt;
( SfxUInt16Item Undo SID_UNDO )&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Volatile,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* status */&lt;br /&gt;
    SlotType = SfxStringItem&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_EDIT;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxObjectItem Open SID_OPENDOC&lt;br /&gt;
(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, SfxStringItem OpenFlags SID_OPTIONS,&lt;br /&gt;
SfxStringItem Password SID_PASSWORD, SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS, SfxInt16Item Version SID_VERSION,&lt;br /&gt;
SfxStringItem Referer SID_REFERER)&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = TRUE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Asynchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As shown in the examples, property types and return values are given as &amp;#039;&amp;#039;Items&amp;#039;&amp;#039;, the whole slot &amp;quot;API&amp;quot; is based on SfxPoolItems, each identified by its ID. These IDs must be unique only in the context of the method.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Slots are used to bind their functionality to UI elements. In former times this was done by writing the SlotIDs into the UI element configuration files, today we use CommandURLs. Binding slots to UI elements (today indirectly through the &amp;#039;&amp;#039;Dispatch Object&amp;#039;&amp;#039;) means that the binding client wants to get status information from it and/or possibly wants to execute it, in most cases (means: the standard controllers) without any parameters.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The type of the status update information is given by the &amp;#039;&amp;#039;SlotType&amp;#039;&amp;#039; attribute. For property slots like &amp;quot;DesignerDialog&amp;quot; this is identical with its property type (and so this attribute is not explictly assigned in the block), for method slots it must be specified like shown in the &amp;quot;Undo&amp;quot; example. If a method slot doesn&amp;#039;t specify a SlotType it has no status (except &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; or &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;). So in the examples &amp;quot;Undo&amp;quot; is of type String, &amp;quot;DesignerDialog&amp;quot; of type Boolean while the other slots don&amp;#039;t have a status.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A menu controller will reflect this by showing status of the &amp;quot;Undo&amp;quot; entry as its title and setting or unsetting a check mark in front of the &amp;quot;DesignerDialof&amp;quot; entry reflecting its boolean status, a toolbar controller reflects the latter one in a pressed/unpressed state, the former in different button titles (or quick help texts that replace the button title if it&amp;#039;s switched off). Other types of status information need speccialized controller that know how to deal with this kind of information.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All the other attributes inside the block of a slot are &amp;#039;&amp;#039;flags&amp;#039;&amp;#039; that define the behavior of the slot at runtime. Some of the attributes are contradicting (like synchron or asynchron) and so of course only one of them can be set. The table below sums them up in one line.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;80%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!width=&amp;quot;40%&amp;quot;|Attribute&lt;br /&gt;
!width=&amp;quot;60%&amp;quot;|Meaning&lt;br /&gt;
|-&lt;br /&gt;
||Cachable (Volatile)|| Slot status is cached, sending a new status to controllers need an &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call that forces SFX to fetch a new status. Volatile slots are not cached and SFX permanently asks for status information based on a timer.&lt;br /&gt;
|-&lt;br /&gt;
|AutoUpdate || TRUE: After execution of the slot SFX automatically fetches the new status, no &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call necessary&lt;br /&gt;
|-&lt;br /&gt;
|FastCall || TRUE: SFX doesn&amp;#039;t check &amp;quot;enable&amp;quot; status before executing a slot&lt;br /&gt;
|-&lt;br /&gt;
|Toggle || Execute without parameters automatically toggles the current status. Works for property slots with boolean or enum type.&lt;br /&gt;
|-&lt;br /&gt;
|HasCoreId || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|HasDialog || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|ReadOnlyDoc || FALSE: SFX automatically disables this slot if the document is read only&lt;br /&gt;
|-&lt;br /&gt;
|Container || TRUE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the object.&amp;lt;br/&amp;gt;FALSE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the container.&lt;br /&gt;
|-&lt;br /&gt;
|RecordAbsolute || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|RecordPerSet (RecordPerItem, NoRecord) || See explanation for Recording.&lt;br /&gt;
|-&lt;br /&gt;
|Synchron (Asynchron) || Asynchron: SFX execute the slot by posting a user event instead of directly calling the execute function of the slot&lt;br /&gt;
|-&lt;br /&gt;
|Readonly || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|AccelConfig || Slot may be offered in the configuration dialog for keyboard shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|MenuConfig || Slot may be offered in the configuration dialog for menus&lt;br /&gt;
|-&lt;br /&gt;
|StatusBarConfig || Slot may be offered in the configuration dialog for status bar&lt;br /&gt;
|-&lt;br /&gt;
|ToolboxConfig || Slot may be offered in the configuration dialog for toolbars&lt;br /&gt;
|-&lt;br /&gt;
|GroupId || Assign the slot to a function group in the configuration dialogs (module is free to define categories)&lt;br /&gt;
|-&lt;br /&gt;
|ImageRotation || Toolbar images are rotated in case of writing direction from right to left&lt;br /&gt;
|-&lt;br /&gt;
|ImageReflection || Toolbar images are rotated in case of vertical text orientation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interface definitions ===&lt;br /&gt;
&lt;br /&gt;
As already mentioned, slots are bundled to interfaces and interfaces are used by shells. SDI files know both terms. Here&amp;#039;s an example how this looks. For clarity only a few slots are shown, the read file contains much more of them.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
interface Document : Object&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE ;&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_CLOSEDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface OfficeDocument : Document&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_DOC_MODIFIED&lt;br /&gt;
    [&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    SID_PRINTDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = PrintExec_Impl ;&lt;br /&gt;
        StateMethod = NoState ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
shell SfxObjectShell&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    import OfficeDocument [AUTOMATION];&lt;br /&gt;
&lt;br /&gt;
    SID_DOCINFO&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The interface term is used slightly different in the sdi files that it is used by SFX, so now we use the name &amp;quot;slot arrays&amp;quot; for what the SFX itself calls &amp;quot;interfaces&amp;quot; to avoid confusion.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As a residue of the old Basic API sdi files define interfaces and shells separately, thus differentiating between slots for both Basic and UI usage and slots only used for UI purposes. This is obsolete today, but still used. Additionally sdi files define base and derived interfaces and shells in a granularity we don&amp;#039;t need anymore, but this is also a residue of the StarBasic support. This might change in the near future. Some interfaces even contained real basic properties that are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; represented by slots at all (like the &amp;quot;object&amp;quot; interface referenced in the example) but they are not used anymore.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;shell&amp;quot; defined in the file references a C++ implementation class SfxObjectShell. This part of the sdi file defines the complete slot interface of this class. The &amp;quot;import&amp;quot; statement tells the svidl compiler that it should add all slots of the interface &amp;quot;OfficeDocument&amp;quot; here (and of course all slots of its &amp;quot;base class&amp;quot; interfaces).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;Automation&amp;quot; attribute that is assigned to both interfaces and shells tells the svidl compiler whether it should generate a slot array definition for this interface/shell or not. We only generate arrays for shell, not for interfaces (because we don&amp;#039;t need them anymore). In former times we also generated arrays for interfaces, and the &amp;quot;Automation&amp;quot; attribute allowed us to prevent svidl from generating them for base class interfaces also. The &amp;quot;Automation&amp;quot; attribute will become obsolete pretty soon.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the interface/shell definition block slots are referenced by their SlotID. Svidl will get all attributes of the slot it needs to generate the array definition from the slot definition (that of course needs to be included and processed before svidl gets to the shell definition). In the block below this identifier (again with rectangular brackets) two additional attributes are specified: the names of one or two methods can be defined that SFX calls to get status information or execute the slot. These methods have a prescribed signature:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Class::StateMethod( SfxItemSet&amp;amp; );&lt;br /&gt;
void Class::ExecMethod( SfxRequest&amp;amp; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The ItemSet is used to collect the status information, the SfxRequest contains everything necessary for the execution of a slot.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The svidl compiler takes the shell class name and the method name and generates an inline stub function that calls the C++ member. A pointer to each stub is generated into the slot definitions. The stubs are generated into the same header file that contains the generated arrays. Here is an example for the first slot of the interface &amp;quot;Document&amp;quot; shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_EXEC_STUB( SfxObjectShell, ExecFile_Impl )&lt;br /&gt;
SFX_STATE_STUB( SfxObjectShell, GetState_Impl )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We use function stubs here because pointer to member functions don&amp;#039;t have a fixed size and so we can&amp;#039;t store them inside a struct like SfxSlot. A pointer to a C function always has the same size as normal pointer on the machine.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The slots in our example show that both pointers can be set or only one of them. A slot without an &amp;quot;Exec&amp;quot; function is a slot that only has a status, execution is done by another slot. A slot without a &amp;quot;GetState&amp;quot; function is always enabled and has no status. SFX automatically generates empty stub in these cases.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the block defining the functions theoretically all slot attributes of the referenced slot can be overwritten and sometimes this can be found. This should be seen as exceptional cases and it might happen in the near future that this overwriting will become forbidden for more and more attributes. The benefit of this is very limited but the risk of dangerous inconsistencies is high.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Here&amp;#039;s an exerpt of the generated header file that belongs to the SID_CLOSEDOC slot shown above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_SLOTMAP_ARG(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
// Slot Nr. 0 : 5502&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_SAVEASDOC,SID_SAVEASDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[1] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                0/*Offset*/, 9/*Count*/,&amp;quot;.SaveAs&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;SaveAs&amp;quot; ),&lt;br /&gt;
// Slot Nr.1 : 5503&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_CLOSEDOC,SID_CLOSEDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[3] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                9/*Offset*/, 2/*Count*/,&amp;quot;.CloseDoc&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;CloseDoc&amp;quot; ),&lt;br /&gt;
// Slot Nr.2 : 5504&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_PRINTDOC,SID_PRINTDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[2] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR_NONE,&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                11/*Offset*/, 10/*Count*/,&amp;quot;.Print&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;Print&amp;quot; ),&lt;br /&gt;
&lt;br /&gt;
         // ... to be continued ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The SFX_NEW_SLOT_ARG macro initializes a complete slot. Most of it should be pretty obvious from what was described already, please note the macros for the generated stubs (and especially SFX_STUB_PTR_STATE_NONE for the empty stub).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An interesting addition is the second line of each block, it contains an &amp;quot;Offset Next&amp;quot;. It is a pointer that points to the next slot in this shell that uses the same &amp;quot;GetState&amp;quot; method as the current slot. This enables SFX to collects status information for several slots at once when a complete update is requested. In general the shell code allows to group slots together in Exec/GetState methods and have more than one per shell for clarity reasons.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The last line in each block also contains an offset and a count. These attributes point to the arguments of the slot (of course only for methods). All possible arguments of all slots inside a shell are grouped into a single array, arguments that belong to the same slot of course beneath each other. The offset points to the first argument of a slot:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_ARGUMENTMAP(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_NAME,&amp;quot;URL&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILTER_NAME,&amp;quot;FilterName&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_PASSWORD,&amp;quot;Password&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,&amp;quot;FilterOptions&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_COMMENTS,&amp;quot;VersionComment&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_AUTHOR,&amp;quot;VersionAuthor&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_OVERWRITE,&amp;quot;Overwrite&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_UNPACK,&amp;quot;Unpacked&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_SAVETO,&amp;quot;SaveTo&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_SAVE,&amp;quot;SaveChanges&amp;quot;,SfxBoolItem),    // &amp;lt;---- here args for SID_CLOSEDOC start&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_FILENAME,&amp;quot;FileName&amp;quot;,SfxStringItem), // &amp;quot;count&amp;quot; is 2, so this is the second one&lt;br /&gt;
&lt;br /&gt;
    // ... to be continued ...&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In each module one header file containing all shells is created. It must be included in the source file of each shell class that contains the SFX_IMPL_INTERFACE macro. To avoid multiple definitions of the slot arrays by this multiple inclusion each code block assigned to a particular shell is framed by an &amp;quot;#ifdef ClassName&amp;quot; block, so in the source file the typical code sequence is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define SfxObjectShell&lt;br /&gt;
#include &amp;quot;sfxslots.hxx&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Other parts of the header file are framed by &amp;quot;#ifdef SFX_TYPEMAP&amp;quot; and this part mustbe activated only once also so each module contains one file that includes the generated header file and defined SFX_TYPEMAP before. This can be on e of the shell files that also defines its shell interface or it can be a different one. The part of the generated header file that is activated here is not necessary for the SFX core (the slot dispatching), but was necessary in former times for the type information of the old Basic API and for macro recording. Today it is used for the wrapper that mediates between SFX dispatching and the Dispatch API and thus also for macro recording because the current macro recorder also uses the Dispatch API.&lt;br /&gt;
&lt;br /&gt;
=== Items and UNO structs ===&lt;br /&gt;
&lt;br /&gt;
The old SFX based Basic API was made up by the property and method slot defined in the sdi files. All types are specified as SfxPoolItems and this was fine for StarBasic because internally these types are used also (for Sbx classes). For recording purposes it was necessary to know the &amp;quot;real&amp;quot; types behind a particular SfxPoolItem type and especially structured items needed to be split up into basic types because StarBasic doesn&amp;#039;t support structs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The mapping from a SfxPoolItem to an atomar or structured type is done by using a mapping table in another sdi file. Here&amp;#039;s an example for atomar types from the SFX module:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
item void     SfxVoidItem&lt;br /&gt;
item BOOL     SfxBoolItem&lt;br /&gt;
item INT32    SfxUInt16Item&lt;br /&gt;
item INT16    SfxInt16Item&lt;br /&gt;
item INT32    SfxUInt32Item&lt;br /&gt;
item INT32    SfxInt32Item&lt;br /&gt;
item String   SfxStringItem&lt;br /&gt;
item BYTE     SfxByteItem&lt;br /&gt;
item INT16    SfxEnumItem&lt;br /&gt;
item INT16    SfxAllEnumItem&lt;br /&gt;
item INT16    TbxImageItem&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
It&amp;#039;s pretty straightforward: &amp;quot;item&amp;quot; declares the type to be atomar and it is followed by the Basic (or better: UNO) type and the Item representing it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Structured types are a little bit more complicated:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
struct Point&lt;br /&gt;
{&lt;br /&gt;
    INT32    X    MID_X;&lt;br /&gt;
    INT32    Y    MID_Y;&lt;br /&gt;
};&lt;br /&gt;
item Point SfxPointItem;&lt;br /&gt;
&lt;br /&gt;
struct Rectangle&lt;br /&gt;
{&lt;br /&gt;
    INT32    Left    MID_RECT_LEFT;&lt;br /&gt;
    INT32    Top     MID_RECT_TOP;&lt;br /&gt;
    INT32    Width   MID_WIDTH;&lt;br /&gt;
    INT32    Height  MID_HEIGHT;&lt;br /&gt;
};&lt;br /&gt;
item Rectangle SfxRectangleItem;&lt;br /&gt;
&lt;br /&gt;
struct DocInfo&lt;br /&gt;
{&lt;br /&gt;
    BOOL    UseUserData    MID_DOCINFO_USEUSERDATA;&lt;br /&gt;
    BOOL    DeleteUserData MID_DOCINFO_DELETEUSERDATA;&lt;br /&gt;
    String  Title          MID_DOCINFO_TITLE;&lt;br /&gt;
    String  Subject        MID_DOCINFO_SUBJECT;&lt;br /&gt;
    String  KeyWords       MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    String  Description    MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    BOOL    AutoReload     MID_DOCINFO_AUTOLOADENABLED;&lt;br /&gt;
};&lt;br /&gt;
item DocInfo SfxDocumentInfoItem;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The examples show simple structs like a Point or more complex structs like a DocInfo. Structs can be nested, a DocInfo could contain a Point also. In the old StarBasic and also in todays macro recording each number of a struct was represented by an individual item (so an ID was needed that is unique in the complete argument set) and the names of these arguments where assembled from the name of the struct parameter name and the member name in the obvious from ArgName.MemberName.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For some items that are used only internally SFX based code (but not for recording purposes) no mapping was necessary and for syntactical completeness they are mapped to any atomar type, but his mapping is never used:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
item String    SbxItem;                //! Dummy&lt;br /&gt;
item String    SfxObjectItem;          //! Dummy&lt;br /&gt;
item String    SfxTemplateItem;        //! Dummy&lt;br /&gt;
item String    SfxMacroInfoItem;       //! Dummy&lt;br /&gt;
item String    SfxImageItem;           //! Dummy&lt;br /&gt;
item String    SfxFrameItem;           //! Dummy&lt;br /&gt;
item String    SfxObjectShellItem;     //! Dummy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The svidl compiler creates the type mappings into the following form:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
// example for an atomar type&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType0 aSfxStringItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxStringItem), 0&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
// example for a struct with 4 members&lt;br /&gt;
extern SfxType4 aSfxRectangleItem_Impl;&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType4 aSfxRectangleItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxRectangleItem}, 4, { {MID_RECT_LEFT,&amp;quot;Left&amp;quot;}, {MID_RECT_TOP,&amp;quot;Top&amp;quot;}, {MID_WIDTH,&amp;quot;Width&amp;quot;},&lt;br /&gt;
{MID_HEIGHT,&amp;quot;Height&amp;quot;} }&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
It utilizes the TOOLS based RTTI that allows to offer a static factory method by using one of the TYPEINIT_AUTOFACTORY macros. This factory that can be used to create an item of the particular class. This is very important for the conversion routines that match items to UNO structs and vice versa. An item that does not offer a factory can&amp;#039;t be converted properly and so macro recording and Dispatch API are broken for this item.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The conversion between an item and a UNO type uses the virtual PutValue and QueryValue methods of the items. In the case of macro recording (where only atomar types are allowed) the &amp;quot;MemberID&amp;quot; parameter of these calls is used always in case of structured items and so it is important that the MIDs in the sdi file match the MIDs used in the implementation of the item. As an example, an SfxRectangleItem is recorded as two integer values.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The matching we use for the Dispatch API in our controllers on the other hand always converts to complete structs, not to atomar members, so the SfxRectangleItem is converted to a com.sun.star.awt.Rectangle. The rect Put/QueryValue in this case is called with MID=0. It&amp;#039;s vital for this process that &amp;#039;&amp;#039;&amp;#039;&amp;quot;0&amp;quot; is an invalid MID&amp;#039;&amp;#039;&amp;#039; that must not be used for any member.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Article]]&lt;br /&gt;
[[Category:Framework]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137237</id>
		<title>Framework/Article/Implementation of the Dispatch API In SFX2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137237"/>
		<updated>2009-08-11T16:33:13Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: fix formatting of examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementation of the Dispatch API in SFX2 ==&lt;br /&gt;
&lt;br /&gt;
The Dispatch API as described in chapter 7.1.6 of the Developer&amp;#039;s Guide is the backbone of our communication between &amp;quot;generic&amp;quot; UI elements and the document core implementations.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Traditionally SFX based components implemented this communication with a much older framework based on the so called &amp;#039;&amp;#039;slots&amp;#039;&amp;#039; and their organization into &amp;#039;&amp;#039;shells&amp;#039;&amp;#039;. While up to OpenOffice.org 1.1 our generic UI elements (menus, toolbars, etc.) still used the SFX based API directly to a large degree in OpenOffice.org 2.0 we changed this to using the Dispatch API exclusively, thus enabling us to share the UI components with other, not SFX based components. This paper describes how the old SFX implementation is matched to the &amp;#039;&amp;#039;DispatchProvider&amp;#039;&amp;#039; implementation that the component provides to the outside to make this happen.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The basic entity in the dispatch API is a command, and it&amp;#039;s represented by a &amp;#039;&amp;#039;CommandURL&amp;#039;&amp;#039;. For simplifications we suppose that this CommandURL is a string (though the API transport it as a pre-parsed struct). All commands supported by our components have the form &amp;#039;&amp;#039;.uno:xxxxx&amp;#039;&amp;#039; for historical reasons, where &amp;#039;&amp;#039;xxxxx&amp;#039;&amp;#039; represents an internal command name. Examples are “.uno:Print” or “.uno:Paste”. The functionality provided by the Dispatch API is support to execute such commands and getting status information for them (enabled/disabled or explicit information if the commands represents something type, a boolean, a string etc.).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As explained in the Developer&amp;#039;s Guide the Dispatch API builds on the idea that such commands can be passed along a chain of Dispatch Provider objects. Every object in this chain is free to decide whether it will handle a command or wants to pass it to the next chain member. Each document window and the Frame object managing it has such a chain of Dispatch providers and at least one object in this chain belongs to the document model/view pair bound to this window. It&amp;#039;s the so called Controller object that amongst other interfaces supports the XDispatchProvider interface. &lt;br /&gt;
&lt;br /&gt;
=== Controller objects in SFX2 ===&lt;br /&gt;
&lt;br /&gt;
SFX2 based components share a common base class for their Controller object implementation, SfxBaseController. It has a queryDispatch() implementation of the XDispatchProvider interface where the received CommandURLs are compared with the CommandURLs in the set of commands the particular component supports. It uses some comparable functionality in the old SFX2 framework that also is able to execute commands and give status information about them. The main difference between the old SFX2 base framework and the UNO framework is that the latter defines commands by strings (CommandURLs) and the former does it by integer values (SlotID, see below). So the main job of the queryDispatch() implementation in the SfxBaseController is to match a commandURL to the corresponding SlotID and then proceed using the internal old SFX2 implementation.&lt;br /&gt;
&lt;br /&gt;
SFX2 organizes functionality in contexts that can be merged together and exposed to the outside world by a single point of contact. This contact point is an SfxDispatcher object that every SfxBaseController owns. [Remark: this ownership is indirect as the real owner of the SfxDispatcher is an SfxViewFrame; but there is always a 1:1 relationship between an SfxViewFrame and an SfxBaseController.]&lt;br /&gt;
The SfxDispatcher internally maintains a stack of objects, each representing a context. Examples for these contexts are “document”, “view”, “text”, “table”, “cell” etc. All these objects are derived from a common base class “SfxShell”. The complete stack of all contextual objects available in a particular situation, the “merged context”, represents the function set applicable to the current selection or cursor position in a document. Context changes inside the document&amp;#039;s editing window cause pushing and popping of shell objects to and from the stack. &lt;br /&gt;
&lt;br /&gt;
This is how a typical stack in Writer looks when the cursor is in a normal text paragraph:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The same stack when the cursor is in a text paragraph in a table:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* Table&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
Another stack when a graphic is selected:&lt;br /&gt;
&lt;br /&gt;
* Graphic&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Frame&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Application&amp;#039;&amp;#039; contexts are there for historical reasons, we are still in the process of moving their functionality to the framework where other &amp;#039;&amp;#039;DispatchProviders&amp;#039;&amp;#039; outside of the component take over. I omitted the &amp;quot;Form&amp;quot; context here because it&amp;#039;s somewhat confusing.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slots and Interfaces ==&lt;br /&gt;
&lt;br /&gt;
Each SfxShell class has a static member called SfxInterface. It is an object containing an array of SfxSlot structs. Each “slot” represents a command supported by the context (shell) it is assigned to. So the complete SfxInterface defines the functionality an instance of the particular SfxShell class using this interface provides.&lt;br /&gt;
&lt;br /&gt;
=== The SfxSlot struct ===&lt;br /&gt;
&lt;br /&gt;
The “slot” struct contains all necessary information that the SfxDispatcher needs to work together with the Shell object containing the slot. The slot contains function pointers that the dispatcher can call to either execute the command represented by the slot or get status information about it. Thus the dispatcher doesn&amp;#039;t need to know the concrete implementation classes of the shells, it can work with them through their base class (SfxShell) interface.&lt;br /&gt;
&lt;br /&gt;
Other important parts of the SfxSlot struct are the “name” of the slot and the numerical ID of it, its so called SlotID. Slot names have been chosen so that they match the part after the colon in “.uno:...” CommandURLs. Mapping between CommandURLs and SlotIDs to then need a simple lookup in all SfxInterfaces of the SfxShells on the shell stack of the SfxDispatcher. More about slots can be found below. &lt;br /&gt;
&lt;br /&gt;
When the SfxDispatcher is asked for support of a particular command it searches for a slot with the given internal command name starting with the top most shell on the stack and then proceeding with the next one until success. This way “higher prioritized” contexts can overrule functionality from “lower prioritized” contexts. As an example, the “document” context has a generic implementation of the “Print” command, but each particular “view” context can overrule the generic behavior and define a specific way of printing. &lt;br /&gt;
&lt;br /&gt;
=== The SfxInterface class ===&lt;br /&gt;
&lt;br /&gt;
The slot arrays aka SfxInterfaces are static to each shell class and so each interface is a part of the data segment of the library that contains the shell code assigned to this interface. The data for these arrays needs to be predefined in source files. Writing huge arrays into C++ source files is a very tedious work and so we use a different kind of source file that is easier to edit and have a compiler (“svidl”) that takes these files and compiles them into a generated header file containing the definition of the arrays. These idl files are located in the sdi sub folders of each SFX based project and have the extension “sdi”. The generated header file contains the definitions (not only declarations) of all “interfaces” of the library and some “#define” magic allows to have each interface generated only once. More about this process below.&lt;br /&gt;
&lt;br /&gt;
=== Slots, interfaces, shells, dispatchers ===&lt;br /&gt;
&lt;br /&gt;
In OOo1.x the SfxBaseController utilized its SfxDispatcher and its stack to provide a generic Dispatch object for every supported command. It gets the CommandURL in the queryDispatch call, looks for a slot on the dispatcher stack with a suitable internal command name and in case of success creates a dispatch object and returns it. There is a drawback in this approach: if the context changes (means: shells are pushed or popped) slots might appear or disappear from the stack so commands that had been supported aren&amp;#039;t any longer or the other way around. This forces the DispatchProvider to request a complete refetching of all dispatch objects and so can be time consuming.&lt;br /&gt;
&lt;br /&gt;
In OOo2.x we utilize the “slot pool” of the SFX based modules. This is the entirety of all “interfaces” (slot arrays) the module supports. On startup all interfaces register at the module class (SfxModule base class) so it is easy to iterate through its interfaces. Now a Dispatch Object is returned when the slot is found anywhere in the slot pool, even if the interface is not on the stack, but in this case the Dispatch Object reports its slots as disabled everytime it is used. This can be determined dynamically so context changes don&amp;#039;t need external updates, it&amp;#039;s enough to update the internal status of the already created Dispatch Objects. This approach also enables some future optimizations for the representation of slot arrays that will be discussed later.&lt;br /&gt;
&lt;br /&gt;
== Slot Processing ==&lt;br /&gt;
&lt;br /&gt;
In former (Pre-UNO) time the slots where not only used for command dispatching but also for the implementation of our Basic API (up to StarOffice 5.2), so the slot arrays where &amp;quot;real&amp;quot; &amp;#039;&amp;#039;interfaces&amp;#039;&amp;#039;. There are a lot residues of the in the sdi files (see below), but they aren&amp;#039;t used anymore.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slot definitions ===&lt;br /&gt;
&lt;br /&gt;
The use case explains why there are two different kinds of slots, property slots and method slots, and the difference between them can be spotted easily from the definition of a slot in the sdi file. Here are two examples, the first one describing a method slot and the second one describing a property slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem About SID_ABOUT&lt;br /&gt;
()&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxBoolItem DesignerDialog SID_STYLE_DESIGNER&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = TRUE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = TRUE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    Readyonly = FALSE,&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_FORMAT;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each slot is a block in rectangular bracket filled with attributes that is preceded by two lines that identify the slot and define its nature. The exact meaning of all the attributes is explained below, the most notable difference is seen in the second line of each block: the paranthesis of the &amp;quot;About&amp;quot; slot classify it as a method while the other one (without paranthesis) is a property. As explained above, this classification goes back to the old Basic API but besides that it&amp;#039;s important for the implementation of macro recording that is also based on the Dispatch API (and for SFX component it&amp;#039;s implemented using slots). &amp;quot;Method&amp;quot; and &amp;quot;property&amp;quot; slots are recorded differently.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The name in the middle of each first line of a block was used as the name of the property or method in the Basic API and today this name is the internal command name that is matched to any &amp;quot;.uno:xxx&amp;quot; CommandURLs of the Dispatch API. As an example, the slot named &amp;quot;Undo&amp;quot; is assigned to the &amp;quot;.uno:Undo&amp;quot; command. This matching requires that the internal command names have to be unique in the complete module. This uniqueness is verified by the svidl compiler that breaks in case if name clashes in a module.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last part of each first line is the so called SlotID that in former times was the real identifier (not as today the internal command name) and it was also used inside the GUI element configuration files where today CommandURLs are used. So this SlotID had to be unique for the module at least, currently it&amp;#039;s even globally unique but at least theoretically it is now obsolete. Inside the slot processing only the textual representation of the SlotID is relevant , not its numerical value.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Property slots have a type specified by the first part of the first line. The same data in a method slot specifies the return value of the associated method. Method slots also can gave parameters (non empty paranthesis) and a return value that could be used in the old Basic API of StarOffice, but also in internal methods of the SfxDispatcher. Strictly speaking the latter is still possible but we try to get rid of this. Here are two examples for slots with arguments, with and without return value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem Undo SID_UNDO&lt;br /&gt;
( SfxUInt16Item Undo SID_UNDO )&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Volatile,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* status */&lt;br /&gt;
    SlotType = SfxStringItem&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_EDIT;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxObjectItem Open SID_OPENDOC&lt;br /&gt;
(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, SfxStringItem OpenFlags SID_OPTIONS,&lt;br /&gt;
SfxStringItem Password SID_PASSWORD, SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS, SfxInt16Item Version SID_VERSION,&lt;br /&gt;
SfxStringItem Referer SID_REFERER)&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = TRUE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Asynchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As shown in the examples, property types and return values are given as &amp;#039;&amp;#039;Items&amp;#039;&amp;#039;, the whole slot &amp;quot;API&amp;quot; is based on SfxPoolItems, each identified by its ID. These IDs must be unique only in the context of the method.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Slots are used to bind their functionality to UI elements. In former times this was done by writing the SlotIDs into the UI element configuration files, today we use CommandURLs. Binding slots to UI elements (today indirectly through the &amp;#039;&amp;#039;Dispatch Object&amp;#039;&amp;#039;) means that the binding client wants to get status information from it and/or possibly wants to execute it, in most cases (means: the standard controllers) without any parameters.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The type of the status update information is given by the &amp;#039;&amp;#039;SlotType&amp;#039;&amp;#039; attribute. For property slots like &amp;quot;DesignerDialog&amp;quot; this is identical with its property type (and so this attribute is not explictly assigned in the block), for method slots it must be specified like shown in the &amp;quot;Undo&amp;quot; example. If a method slot doesn&amp;#039;t specify a SlotType it has no status (except &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; or &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;). So in the examples &amp;quot;Undo&amp;quot; is of type String, &amp;quot;DesignerDialog&amp;quot; of type Boolean while the other slots don&amp;#039;t have a status.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A menu controller will reflect this by showing status of the &amp;quot;Undo&amp;quot; entry as its title and setting or unsetting a check mark in front of the &amp;quot;DesignerDialof&amp;quot; entry reflecting its boolean status, a toolbar controller reflects the latter one in a pressed/unpressed state, the former in different button titles (or quick help texts that replace the button title if it&amp;#039;s switched off). Other types of status information need speccialized controller that know how to deal with this kind of information.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All the other attributes inside the block of a slot are &amp;#039;&amp;#039;flags&amp;#039;&amp;#039; that define the behavior of the slot at runtime. Some of the attributes are contradicting (like synchron or asynchron) and so of course only one of them can be set. The table below sums them up in one line.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;80%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!width=&amp;quot;40%&amp;quot;|Attribute&lt;br /&gt;
!width=&amp;quot;60%&amp;quot;|Meaning&lt;br /&gt;
|-&lt;br /&gt;
||Cachable (Volatile)|| Slot status is cached, sending a new status to controllers need an &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call that forces SFX to fetch a new status. Volatile slots are not cached and SFX permanently asks for status information based on a timer.&lt;br /&gt;
|-&lt;br /&gt;
|AutoUpdate || TRUE: After execution of the slot SFX automatically fetches the new status, no &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call necessary&lt;br /&gt;
|-&lt;br /&gt;
|FastCall || TRUE: SFX doesn&amp;#039;t check &amp;quot;enable&amp;quot; status before executing a slot&lt;br /&gt;
|-&lt;br /&gt;
|Toggle || Execute without parameters automatically toggles the current status. Works for property slots with boolean or enum type.&lt;br /&gt;
|-&lt;br /&gt;
|HasCoreId || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|HasDialog || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|ReadOnlyDoc || FALSE: SFX automatically disables this slot if the document is read only&lt;br /&gt;
|-&lt;br /&gt;
|Container || TRUE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the object.&amp;lt;br/&amp;gt;FALSE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the container.&lt;br /&gt;
|-&lt;br /&gt;
|RecordAbsolute || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|RecordPerSet (RecordPerItem, NoRecord) || See explanation for Recording.&lt;br /&gt;
|-&lt;br /&gt;
|Synchron (Asynchron) || Asynchron: SFX execute the slot by posting a user event instead of directly calling the execute function of the slot&lt;br /&gt;
|-&lt;br /&gt;
|Readonly || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|AccelConfig || Slot may be offered in the configuration dialog for keyboard shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|MenuConfig || Slot may be offered in the configuration dialog for menus&lt;br /&gt;
|-&lt;br /&gt;
|StatusBarConfig || Slot may be offered in the configuration dialog for status bar&lt;br /&gt;
|-&lt;br /&gt;
|ToolboxConfig || Slot may be offered in the configuration dialog for toolbars&lt;br /&gt;
|-&lt;br /&gt;
|GroupId || Assign the slot to a function group in the configuration dialogs (module is free to define categories)&lt;br /&gt;
|-&lt;br /&gt;
|ImageRotation || Toolbar images are rotated in case of writing direction from right to left&lt;br /&gt;
|-&lt;br /&gt;
|ImageReflection || Toolbar images are rotated in case of vertical text orientation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interface definitions ===&lt;br /&gt;
&lt;br /&gt;
As already mentioned, slots are bundled to interfaces and interfaces are used by shells. SDI files know both terms. Here&amp;#039;s an example how this looks. For clarity only a few slots are shown, the read file contains much more of them.&lt;br /&gt;
&amp;lt;script lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
interface Document : Object&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE ;&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_CLOSEDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface OfficeDocument : Document&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_DOC_MODIFIED&lt;br /&gt;
    [&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    SID_PRINTDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = PrintExec_Impl ;&lt;br /&gt;
        StateMethod = NoState ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
shell SfxObjectShell&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    import OfficeDocument [AUTOMATION];&lt;br /&gt;
&lt;br /&gt;
    SID_DOCINFO&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
The interface term is used slightly different in the sdi files that it is used by SFX, so now we use the name &amp;quot;slot arrays&amp;quot; for what the SFX itself calls &amp;quot;interfaces&amp;quot; to avoid confusion.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As a residue of the old Basic API sdi files define interfaces and shells separately, thus differentiating between slots for both Basic and UI usage and slots only used for UI purposes. This is obsolete today, but still used. Additionally sdi files define base and derived interfaces and shells in a granularity we don&amp;#039;t need anymore, but this is also a residue of the StarBasic support. This might change in the near future. Some interfaces even contained real basic properties that are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; represented by slots at all (like the &amp;quot;object&amp;quot; interface referenced in the example) but they are not used anymore.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;shell&amp;quot; defined in the file references a C++ implementation class SfxObjectShell. This part of the sdi file defines the complete slot interface of this class. The &amp;quot;import&amp;quot; statement tells the svidl compiler that it should add all slots of the interface &amp;quot;OfficeDocument&amp;quot; here (and of course all slots of its &amp;quot;base class&amp;quot; interfaces).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;Automation&amp;quot; attribute that is assigned to both interfaces and shells tells the svidl compiler whether it should generate a slot array definition for this interface/shell or not. We only generate arrays for shell, not for interfaces (because we don&amp;#039;t need them anymore). In former times we also generated arrays for interfaces, and the &amp;quot;Automation&amp;quot; attribute allowed us to prevent svidl from generating them for base class interfaces also. The &amp;quot;Automation&amp;quot; attribute will become obsolete pretty soon.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the interface/shell definition block slots are referenced by their SlotID. Svidl will get all attributes of the slot it needs to generate the array definition from the slot definition (that of course needs to be included and processed before svidl gets to the shell definition). In the block below this identifier (again with rectangular brackets) two additional attributes are specified: the names of one or two methods can be defined that SFX calls to get status information or execute the slot. These methods have a prescribed signature:&lt;br /&gt;
&amp;lt;script lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Class::StateMethod( SfxItemSet&amp;amp; );&lt;br /&gt;
void Class::ExecMethod( SfxRequest&amp;amp; );&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
The ItemSet is used to collect the status information, the SfxRequest contains everything necessary for the execution of a slot.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The svidl compiler takes the shell class name and the method name and generates an inline stub function that calls the C++ member. A pointer to each stub is generated into the slot definitions. The stubs are generated into the same header file that contains the generated arrays. Here is an example for the first slot of the interface &amp;quot;Document&amp;quot; shown above:&lt;br /&gt;
&amp;lt;script lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_EXEC_STUB( SfxObjectShell, ExecFile_Impl )&lt;br /&gt;
SFX_STATE_STUB( SfxObjectShell, GetState_Impl )&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
We use function stubs here because pointer to member functions don&amp;#039;t have a fixed size and so we can&amp;#039;t store them inside a struct like SfxSlot. A pointer to a C function always has the same size as normal pointer on the machine.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The slots in our example show that both pointers can be set or only one of them. A slot without an &amp;quot;Exec&amp;quot; function is a slot that only has a status, execution is done by another slot. A slot without a &amp;quot;GetState&amp;quot; function is always enabled and has no status. SFX automatically generates empty stub in these cases.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the block defining the functions theoretically all slot attributes of the referenced slot can be overwritten and sometimes this can be found. This should be seen as exceptional cases and it might happen in the near future that this overwriting will become forbidden for more and more attributes. The benefit of this is very limited but the risk of dangerous inconsistencies is high.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Here&amp;#039;s an exerpt of the generated header file that belongs to the SID_CLOSEDOC slot shown above:&lt;br /&gt;
&amp;lt;script lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_SLOTMAP_ARG(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
// Slot Nr. 0 : 5502&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_SAVEASDOC,SID_SAVEASDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[1] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                0/*Offset*/, 9/*Count*/,&amp;quot;.SaveAs&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;SaveAs&amp;quot; ),&lt;br /&gt;
// Slot Nr.1 : 5503&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_CLOSEDOC,SID_CLOSEDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[3] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                9/*Offset*/, 2/*Count*/,&amp;quot;.CloseDoc&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;CloseDoc&amp;quot; ),&lt;br /&gt;
// Slot Nr.2 : 5504&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_PRINTDOC,SID_PRINTDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[2] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR_NONE,&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                11/*Offset*/, 10/*Count*/,&amp;quot;.Print&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;Print&amp;quot; ),&lt;br /&gt;
&lt;br /&gt;
         // ... to be continued ...&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
The SFX_NEW_SLOT_ARG macro initializes a complete slot. Most of it should be pretty obvious from what was described already, please note the macros for the generated stubs (and especially SFX_STUB_PTR_STATE_NONE for the empty stub).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An interesting addition is the second line of each block, it contains an &amp;quot;Offset Next&amp;quot;. It is a pointer that points to the next slot in this shell that uses the same &amp;quot;GetState&amp;quot; method as the current slot. This enables SFX to collects status information for several slots at once when a complete update is requested. In general the shell code allows to group slots together in Exec/GetState methods and have more than one per shell for clarity reasons.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The last line in each block also contains an offset and a count. These attributes point to the arguments of the slot (of course only for methods). All possible arguments of all slots inside a shell are grouped into a single array, arguments that belong to the same slot of course beneath each other. The offset points to the first argument of a slot:&lt;br /&gt;
&amp;lt;script lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SFX_ARGUMENTMAP(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_NAME,&amp;quot;URL&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILTER_NAME,&amp;quot;FilterName&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_PASSWORD,&amp;quot;Password&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,&amp;quot;FilterOptions&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_COMMENTS,&amp;quot;VersionComment&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_AUTHOR,&amp;quot;VersionAuthor&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_OVERWRITE,&amp;quot;Overwrite&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_UNPACK,&amp;quot;Unpacked&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_SAVETO,&amp;quot;SaveTo&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_SAVE,&amp;quot;SaveChanges&amp;quot;,SfxBoolItem),    // &amp;lt;---- here args for SID_CLOSEDOC start&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_FILENAME,&amp;quot;FileName&amp;quot;,SfxStringItem), // &amp;quot;count&amp;quot; is 2, so this is the second one&lt;br /&gt;
&lt;br /&gt;
    // ... to be continued ...&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
In each module one header file containing all shells is created. It must be included in the source file of each shell class that contains the SFX_IMPL_INTERFACE macro. To avoid multiple definitions of the slot arrays by this multiple inclusion each code block assigned to a particular shell is framed by an &amp;quot;#ifdef ClassName&amp;quot; block, so in the source file the typical code sequence is&lt;br /&gt;
&amp;lt;script lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define SfxObjectShell&lt;br /&gt;
#include &amp;quot;sfxslots.hxx&amp;quot;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
Other parts of the header file are framed by &amp;quot;#ifdef SFX_TYPEMAP&amp;quot; and this part mustbe activated only once also so each module contains one file that includes the generated header file and defined SFX_TYPEMAP before. This can be on e of the shell files that also defines its shell interface or it can be a different one. The part of the generated header file that is activated here is not necessary for the SFX core (the slot dispatching), but was necessary in former times for the type information of the old Basic API and for macro recording. Today it is used for the wrapper that mediates between SFX dispatching and the Dispatch API and thus also for macro recording because the current macro recorder also uses the Dispatch API.&lt;br /&gt;
&lt;br /&gt;
=== Items and UNO structs ===&lt;br /&gt;
&lt;br /&gt;
The old SFX based Basic API was made up by the property and method slot defined in the sdi files. All types are specified as SfxPoolItems and this was fine for StarBasic because internally these types are used also (for Sbx classes). For recording purposes it was necessary to know the &amp;quot;real&amp;quot; types behind a particular SfxPoolItem type and especially structured items needed to be split up into basic types because StarBasic doesn&amp;#039;t support structs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The mapping from a SfxPoolItem to an atomar or structured type is done by using a mapping table in another sdi file. Here&amp;#039;s an example for atomar types from the SFX module:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
item void     SfxVoidItem&lt;br /&gt;
item BOOL     SfxBoolItem&lt;br /&gt;
item INT32    SfxUInt16Item&lt;br /&gt;
item INT16    SfxInt16Item&lt;br /&gt;
item INT32    SfxUInt32Item&lt;br /&gt;
item INT32    SfxInt32Item&lt;br /&gt;
item String   SfxStringItem&lt;br /&gt;
item BYTE     SfxByteItem&lt;br /&gt;
item INT16    SfxEnumItem&lt;br /&gt;
item INT16    SfxAllEnumItem&lt;br /&gt;
item INT16    TbxImageItem&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
It&amp;#039;s pretty straightforward: &amp;quot;item&amp;quot; declares the type to be atomar and it is followed by the Basic (or better: UNO) type and the Item representing it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Structured types are a little bit more complicated:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
struct Point&lt;br /&gt;
{&lt;br /&gt;
    INT32    X    MID_X;&lt;br /&gt;
    INT32    Y    MID_Y;&lt;br /&gt;
};&lt;br /&gt;
item Point SfxPointItem;&lt;br /&gt;
&lt;br /&gt;
struct Rectangle&lt;br /&gt;
{&lt;br /&gt;
    INT32    Left    MID_RECT_LEFT;&lt;br /&gt;
    INT32    Top     MID_RECT_TOP;&lt;br /&gt;
    INT32    Width   MID_WIDTH;&lt;br /&gt;
    INT32    Height  MID_HEIGHT;&lt;br /&gt;
};&lt;br /&gt;
item Rectangle SfxRectangleItem;&lt;br /&gt;
&lt;br /&gt;
struct DocInfo&lt;br /&gt;
{&lt;br /&gt;
    BOOL    UseUserData    MID_DOCINFO_USEUSERDATA;&lt;br /&gt;
    BOOL    DeleteUserData MID_DOCINFO_DELETEUSERDATA;&lt;br /&gt;
    String  Title          MID_DOCINFO_TITLE;&lt;br /&gt;
    String  Subject        MID_DOCINFO_SUBJECT;&lt;br /&gt;
    String  KeyWords       MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    String  Description    MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    BOOL    AutoReload     MID_DOCINFO_AUTOLOADENABLED;&lt;br /&gt;
};&lt;br /&gt;
item DocInfo SfxDocumentInfoItem;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The examples show simple structs like a Point or more complex structs like a DocInfo. Structs can be nested, a DocInfo could contain a Point also. In the old StarBasic and also in todays macro recording each number of a struct was represented by an individual item (so an ID was needed that is unique in the complete argument set) and the names of these arguments where assembled from the name of the struct parameter name and the member name in the obvious from ArgName.MemberName.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For some items that are used only internally SFX based code (but not for recording purposes) no mapping was necessary and for syntactical completeness they are mapped to any atomar type, but his mapping is never used:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
item String    SbxItem;                //! Dummy&lt;br /&gt;
item String    SfxObjectItem;          //! Dummy&lt;br /&gt;
item String    SfxTemplateItem;        //! Dummy&lt;br /&gt;
item String    SfxMacroInfoItem;       //! Dummy&lt;br /&gt;
item String    SfxImageItem;           //! Dummy&lt;br /&gt;
item String    SfxFrameItem;           //! Dummy&lt;br /&gt;
item String    SfxObjectShellItem;     //! Dummy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The svidl compiler creates the type mappings into the following form:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
// example for an atomar type&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType0 aSfxStringItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxStringItem), 0&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
// example for a struct with 4 members&lt;br /&gt;
extern SfxType4 aSfxRectangleItem_Impl;&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType4 aSfxRectangleItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxRectangleItem}, 4, { {MID_RECT_LEFT,&amp;quot;Left&amp;quot;}, {MID_RECT_TOP,&amp;quot;Top&amp;quot;}, {MID_WIDTH,&amp;quot;Width&amp;quot;},&lt;br /&gt;
{MID_HEIGHT,&amp;quot;Height&amp;quot;} }&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
It utilizes the TOOLS based RTTI that allows to offer a static factory method by using one of the TYPEINIT_AUTOFACTORY macros. This factory that can be used to create an item of the particular class. This is very important for the conversion routines that match items to UNO structs and vice versa. An item that does not offer a factory can&amp;#039;t be converted properly and so macro recording and Dispatch API are broken for this item.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The conversion between an item and a UNO type uses the virtual PutValue and QueryValue methods of the items. In the case of macro recording (where only atomar types are allowed) the &amp;quot;MemberID&amp;quot; parameter of these calls is used always in case of structured items and so it is important that the MIDs in the sdi file match the MIDs used in the implementation of the item. As an example, an SfxRectangleItem is recorded as two integer values.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The matching we use for the Dispatch API in our controllers on the other hand always converts to complete structs, not to atomar members, so the SfxRectangleItem is converted to a com.sun.star.awt.Rectangle. The rect Put/QueryValue in this case is called with MID=0. It&amp;#039;s vital for this process that &amp;#039;&amp;#039;&amp;#039;&amp;quot;0&amp;quot; is an invalid MID&amp;#039;&amp;#039;&amp;#039; that must not be used for any member.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Article]]&lt;br /&gt;
[[Category:Framework]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137236</id>
		<title>Framework/Article/Implementation of the Dispatch API In SFX2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2&amp;diff=137236"/>
		<updated>2009-08-11T16:26:40Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: fix formatting of slot definitions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementation of the Dispatch API in SFX2 ==&lt;br /&gt;
&lt;br /&gt;
The Dispatch API as described in chapter 7.1.6 of the Developer&amp;#039;s Guide is the backbone of our communication between &amp;quot;generic&amp;quot; UI elements and the document core implementations.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Traditionally SFX based components implemented this communication with a much older framework based on the so called &amp;#039;&amp;#039;slots&amp;#039;&amp;#039; and their organization into &amp;#039;&amp;#039;shells&amp;#039;&amp;#039;. While up to OpenOffice.org 1.1 our generic UI elements (menus, toolbars, etc.) still used the SFX based API directly to a large degree in OpenOffice.org 2.0 we changed this to using the Dispatch API exclusively, thus enabling us to share the UI components with other, not SFX based components. This paper describes how the old SFX implementation is matched to the &amp;#039;&amp;#039;DispatchProvider&amp;#039;&amp;#039; implementation that the component provides to the outside to make this happen.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The basic entity in the dispatch API is a command, and it&amp;#039;s represented by a &amp;#039;&amp;#039;CommandURL&amp;#039;&amp;#039;. For simplifications we suppose that this CommandURL is a string (though the API transport it as a pre-parsed struct). All commands supported by our components have the form &amp;#039;&amp;#039;.uno:xxxxx&amp;#039;&amp;#039; for historical reasons, where &amp;#039;&amp;#039;xxxxx&amp;#039;&amp;#039; represents an internal command name. Examples are “.uno:Print” or “.uno:Paste”. The functionality provided by the Dispatch API is support to execute such commands and getting status information for them (enabled/disabled or explicit information if the commands represents something type, a boolean, a string etc.).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As explained in the Developer&amp;#039;s Guide the Dispatch API builds on the idea that such commands can be passed along a chain of Dispatch Provider objects. Every object in this chain is free to decide whether it will handle a command or wants to pass it to the next chain member. Each document window and the Frame object managing it has such a chain of Dispatch providers and at least one object in this chain belongs to the document model/view pair bound to this window. It&amp;#039;s the so called Controller object that amongst other interfaces supports the XDispatchProvider interface. &lt;br /&gt;
&lt;br /&gt;
=== Controller objects in SFX2 ===&lt;br /&gt;
&lt;br /&gt;
SFX2 based components share a common base class for their Controller object implementation, SfxBaseController. It has a queryDispatch() implementation of the XDispatchProvider interface where the received CommandURLs are compared with the CommandURLs in the set of commands the particular component supports. It uses some comparable functionality in the old SFX2 framework that also is able to execute commands and give status information about them. The main difference between the old SFX2 base framework and the UNO framework is that the latter defines commands by strings (CommandURLs) and the former does it by integer values (SlotID, see below). So the main job of the queryDispatch() implementation in the SfxBaseController is to match a commandURL to the corresponding SlotID and then proceed using the internal old SFX2 implementation.&lt;br /&gt;
&lt;br /&gt;
SFX2 organizes functionality in contexts that can be merged together and exposed to the outside world by a single point of contact. This contact point is an SfxDispatcher object that every SfxBaseController owns. [Remark: this ownership is indirect as the real owner of the SfxDispatcher is an SfxViewFrame; but there is always a 1:1 relationship between an SfxViewFrame and an SfxBaseController.]&lt;br /&gt;
The SfxDispatcher internally maintains a stack of objects, each representing a context. Examples for these contexts are “document”, “view”, “text”, “table”, “cell” etc. All these objects are derived from a common base class “SfxShell”. The complete stack of all contextual objects available in a particular situation, the “merged context”, represents the function set applicable to the current selection or cursor position in a document. Context changes inside the document&amp;#039;s editing window cause pushing and popping of shell objects to and from the stack. &lt;br /&gt;
&lt;br /&gt;
This is how a typical stack in Writer looks when the cursor is in a normal text paragraph:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The same stack when the cursor is in a text paragraph in a table:&lt;br /&gt;
&lt;br /&gt;
* Text&lt;br /&gt;
* Table&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
Another stack when a graphic is selected:&lt;br /&gt;
&lt;br /&gt;
* Graphic&lt;br /&gt;
* View&lt;br /&gt;
* Document&lt;br /&gt;
* Frame&lt;br /&gt;
* Module&lt;br /&gt;
* Application&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Frame&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Application&amp;#039;&amp;#039; contexts are there for historical reasons, we are still in the process of moving their functionality to the framework where other &amp;#039;&amp;#039;DispatchProviders&amp;#039;&amp;#039; outside of the component take over. I omitted the &amp;quot;Form&amp;quot; context here because it&amp;#039;s somewhat confusing.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slots and Interfaces ==&lt;br /&gt;
&lt;br /&gt;
Each SfxShell class has a static member called SfxInterface. It is an object containing an array of SfxSlot structs. Each “slot” represents a command supported by the context (shell) it is assigned to. So the complete SfxInterface defines the functionality an instance of the particular SfxShell class using this interface provides.&lt;br /&gt;
&lt;br /&gt;
=== The SfxSlot struct ===&lt;br /&gt;
&lt;br /&gt;
The “slot” struct contains all necessary information that the SfxDispatcher needs to work together with the Shell object containing the slot. The slot contains function pointers that the dispatcher can call to either execute the command represented by the slot or get status information about it. Thus the dispatcher doesn&amp;#039;t need to know the concrete implementation classes of the shells, it can work with them through their base class (SfxShell) interface.&lt;br /&gt;
&lt;br /&gt;
Other important parts of the SfxSlot struct are the “name” of the slot and the numerical ID of it, its so called SlotID. Slot names have been chosen so that they match the part after the colon in “.uno:...” CommandURLs. Mapping between CommandURLs and SlotIDs to then need a simple lookup in all SfxInterfaces of the SfxShells on the shell stack of the SfxDispatcher. More about slots can be found below. &lt;br /&gt;
&lt;br /&gt;
When the SfxDispatcher is asked for support of a particular command it searches for a slot with the given internal command name starting with the top most shell on the stack and then proceeding with the next one until success. This way “higher prioritized” contexts can overrule functionality from “lower prioritized” contexts. As an example, the “document” context has a generic implementation of the “Print” command, but each particular “view” context can overrule the generic behavior and define a specific way of printing. &lt;br /&gt;
&lt;br /&gt;
=== The SfxInterface class ===&lt;br /&gt;
&lt;br /&gt;
The slot arrays aka SfxInterfaces are static to each shell class and so each interface is a part of the data segment of the library that contains the shell code assigned to this interface. The data for these arrays needs to be predefined in source files. Writing huge arrays into C++ source files is a very tedious work and so we use a different kind of source file that is easier to edit and have a compiler (“svidl”) that takes these files and compiles them into a generated header file containing the definition of the arrays. These idl files are located in the sdi sub folders of each SFX based project and have the extension “sdi”. The generated header file contains the definitions (not only declarations) of all “interfaces” of the library and some “#define” magic allows to have each interface generated only once. More about this process below.&lt;br /&gt;
&lt;br /&gt;
=== Slots, interfaces, shells, dispatchers ===&lt;br /&gt;
&lt;br /&gt;
In OOo1.x the SfxBaseController utilized its SfxDispatcher and its stack to provide a generic Dispatch object for every supported command. It gets the CommandURL in the queryDispatch call, looks for a slot on the dispatcher stack with a suitable internal command name and in case of success creates a dispatch object and returns it. There is a drawback in this approach: if the context changes (means: shells are pushed or popped) slots might appear or disappear from the stack so commands that had been supported aren&amp;#039;t any longer or the other way around. This forces the DispatchProvider to request a complete refetching of all dispatch objects and so can be time consuming.&lt;br /&gt;
&lt;br /&gt;
In OOo2.x we utilize the “slot pool” of the SFX based modules. This is the entirety of all “interfaces” (slot arrays) the module supports. On startup all interfaces register at the module class (SfxModule base class) so it is easy to iterate through its interfaces. Now a Dispatch Object is returned when the slot is found anywhere in the slot pool, even if the interface is not on the stack, but in this case the Dispatch Object reports its slots as disabled everytime it is used. This can be determined dynamically so context changes don&amp;#039;t need external updates, it&amp;#039;s enough to update the internal status of the already created Dispatch Objects. This approach also enables some future optimizations for the representation of slot arrays that will be discussed later.&lt;br /&gt;
&lt;br /&gt;
== Slot Processing ==&lt;br /&gt;
&lt;br /&gt;
In former (Pre-UNO) time the slots where not only used for command dispatching but also for the implementation of our Basic API (up to StarOffice 5.2), so the slot arrays where &amp;quot;real&amp;quot; &amp;#039;&amp;#039;interfaces&amp;#039;&amp;#039;. There are a lot residues of the in the sdi files (see below), but they aren&amp;#039;t used anymore.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slot definitions ===&lt;br /&gt;
&lt;br /&gt;
The use case explains why there are two different kinds of slots, property slots and method slots, and the difference between them can be spotted easily from the definition of a slot in the sdi file. Here are two examples, the first one describing a method slot and the second one describing a property slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem About SID_ABOUT&lt;br /&gt;
()&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxBoolItem DesignerDialog SID_STYLE_DESIGNER&lt;br /&gt;
&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = TRUE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = TRUE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    Readyonly = FALSE,&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_FORMAT;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Each slot is a block in rectangular bracket filled with attributes that is preceded by two lines that identify the slot and define its nature. The exact meaning of all the attributes is explained below, the most notable difference is seen in the second line of each block: the paranthesis of the &amp;quot;About&amp;quot; slot classify it as a method while the other one (without paranthesis) is a property. As explained above, this classification goes back to the old Basic API but besides that it&amp;#039;s important for the implementation of macro recording that is also based on the Dispatch API (and for SFX component it&amp;#039;s implemented using slots). &amp;quot;Method&amp;quot; and &amp;quot;property&amp;quot; slots are recorded differently.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The name in the middle of each first line of a block was used as the name of the property or method in the Basic API and today this name is the internal command name that is matched to any &amp;quot;.uno:xxx&amp;quot; CommandURLs of the Dispatch API. As an example, the slot named &amp;quot;Undo&amp;quot; is assigned to the &amp;quot;.uno:Undo&amp;quot; command. This matching requires that the internal command names have to be unique in the complete module. This uniqueness is verified by the svidl compiler that breaks in case if name clashes in a module.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The last part of each first line is the so called SlotID that in former times was the real identifier (not as today the internal command name) and it was also used inside the GUI element configuration files where today CommandURLs are used. So this SlotID had to be unique for the module at least, currently it&amp;#039;s even globally unique but at least theoretically it is now obsolete. Inside the slot processing only the textual representation of the SlotID is relevant , not its numerical value.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Property slots have a type specified by the first part of the first line. The same data in a method slot specifies the return value of the associated method. Method slots also can gave parameters (non empty paranthesis) and a return value that could be used in the old Basic API of StarOffice, but also in internal methods of the SfxDispatcher. Strictly speaking the latter is still possible but we try to get rid of this. Here are two examples for slots with arguments, with and without return value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
SfxVoidItem Undo SID_UNDO&lt;br /&gt;
( SfxUInt16Item Undo SID_UNDO )&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Volatile,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = FALSE,&lt;br /&gt;
    ReadyOnlyDoc = FALSE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = FALSE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Synchron;&lt;br /&gt;
&lt;br /&gt;
    /* status */&lt;br /&gt;
    SlotType = SfxStringItem&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_EDIT;&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
SfxObjectItem Open SID_OPENDOC&lt;br /&gt;
(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, SfxStringItem OpenFlags SID_OPTIONS,&lt;br /&gt;
SfxStringItem Password SID_PASSWORD, SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS, SfxInt16Item Version SID_VERSION,&lt;br /&gt;
SfxStringItem Referer SID_REFERER)&lt;br /&gt;
[&lt;br /&gt;
    /* flags: */&lt;br /&gt;
    AutoUpdate = FALSE,&lt;br /&gt;
    Cachable = Cachable,&lt;br /&gt;
    FastCall = FALSE,&lt;br /&gt;
    HasCoreId = FALSE,&lt;br /&gt;
    HasDialog = TRUE,&lt;br /&gt;
    ReadyOnlyDoc = TRUE,&lt;br /&gt;
    Toggle = FALSE,&lt;br /&gt;
    Container = TRUE,&lt;br /&gt;
    RecordAbsolute = FALSE,&lt;br /&gt;
    RecordPerSet;&lt;br /&gt;
    Asynchron;&lt;br /&gt;
&lt;br /&gt;
    /* config */&lt;br /&gt;
    AccelConfig = TRUE,&lt;br /&gt;
    MenuConfig = TRUE,&lt;br /&gt;
    StatusBarConfig = FALSE,&lt;br /&gt;
    ToolBoxConfig = TRUE,&lt;br /&gt;
    GroupId = GID_APPLICATION;&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As shown in the examples, property types and return values are given as &amp;#039;&amp;#039;Items&amp;#039;&amp;#039;, the whole slot &amp;quot;API&amp;quot; is based on SfxPoolItems, each identified by its ID. These IDs must be unique only in the context of the method.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Slots are used to bind their functionality to UI elements. In former times this was done by writing the SlotIDs into the UI element configuration files, today we use CommandURLs. Binding slots to UI elements (today indirectly through the &amp;#039;&amp;#039;Dispatch Object&amp;#039;&amp;#039;) means that the binding client wants to get status information from it and/or possibly wants to execute it, in most cases (means: the standard controllers) without any parameters.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The type of the status update information is given by the &amp;#039;&amp;#039;SlotType&amp;#039;&amp;#039; attribute. For property slots like &amp;quot;DesignerDialog&amp;quot; this is identical with its property type (and so this attribute is not explictly assigned in the block), for method slots it must be specified like shown in the &amp;quot;Undo&amp;quot; example. If a method slot doesn&amp;#039;t specify a SlotType it has no status (except &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; or &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;). So in the examples &amp;quot;Undo&amp;quot; is of type String, &amp;quot;DesignerDialog&amp;quot; of type Boolean while the other slots don&amp;#039;t have a status.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A menu controller will reflect this by showing status of the &amp;quot;Undo&amp;quot; entry as its title and setting or unsetting a check mark in front of the &amp;quot;DesignerDialof&amp;quot; entry reflecting its boolean status, a toolbar controller reflects the latter one in a pressed/unpressed state, the former in different button titles (or quick help texts that replace the button title if it&amp;#039;s switched off). Other types of status information need speccialized controller that know how to deal with this kind of information.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All the other attributes inside the block of a slot are &amp;#039;&amp;#039;flags&amp;#039;&amp;#039; that define the behavior of the slot at runtime. Some of the attributes are contradicting (like synchron or asynchron) and so of course only one of them can be set. The table below sums them up in one line.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;80%&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!width=&amp;quot;40%&amp;quot;|Attribute&lt;br /&gt;
!width=&amp;quot;60%&amp;quot;|Meaning&lt;br /&gt;
|-&lt;br /&gt;
||Cachable (Volatile)|| Slot status is cached, sending a new status to controllers need an &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call that forces SFX to fetch a new status. Volatile slots are not cached and SFX permanently asks for status information based on a timer.&lt;br /&gt;
|-&lt;br /&gt;
|AutoUpdate || TRUE: After execution of the slot SFX automatically fetches the new status, no &amp;#039;&amp;#039;Invalidate()&amp;#039;&amp;#039; call necessary&lt;br /&gt;
|-&lt;br /&gt;
|FastCall || TRUE: SFX doesn&amp;#039;t check &amp;quot;enable&amp;quot; status before executing a slot&lt;br /&gt;
|-&lt;br /&gt;
|Toggle || Execute without parameters automatically toggles the current status. Works for property slots with boolean or enum type.&lt;br /&gt;
|-&lt;br /&gt;
|HasCoreId || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|HasDialog || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|ReadOnlyDoc || FALSE: SFX automatically disables this slot if the document is read only&lt;br /&gt;
|-&lt;br /&gt;
|Container || TRUE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the object.&amp;lt;br/&amp;gt;FALSE: in case of OLE inplace editing this slot is automatically disabled by SFX if the component is the container.&lt;br /&gt;
|-&lt;br /&gt;
|RecordAbsolute || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|RecordPerSet (RecordPerItem, NoRecord) || See explanation for Recording.&lt;br /&gt;
|-&lt;br /&gt;
|Synchron (Asynchron) || Asynchron: SFX execute the slot by posting a user event instead of directly calling the execute function of the slot&lt;br /&gt;
|-&lt;br /&gt;
|Readonly || Obsolete&lt;br /&gt;
|-&lt;br /&gt;
|AccelConfig || Slot may be offered in the configuration dialog for keyboard shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|MenuConfig || Slot may be offered in the configuration dialog for menus&lt;br /&gt;
|-&lt;br /&gt;
|StatusBarConfig || Slot may be offered in the configuration dialog for status bar&lt;br /&gt;
|-&lt;br /&gt;
|ToolboxConfig || Slot may be offered in the configuration dialog for toolbars&lt;br /&gt;
|-&lt;br /&gt;
|GroupId || Assign the slot to a function group in the configuration dialogs (module is free to define categories)&lt;br /&gt;
|-&lt;br /&gt;
|ImageRotation || Toolbar images are rotated in case of writing direction from right to left&lt;br /&gt;
|-&lt;br /&gt;
|ImageReflection || Toolbar images are rotated in case of vertical text orientation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interface definitions ===&lt;br /&gt;
&lt;br /&gt;
As already mentioned, slots are bundled to interfaces and interfaces are used by shells. SDI files know both terms. Here&amp;#039;s an example how this looks. For clarity only a few slots are shown, the read file contains much more of them.&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
interface Document : Object&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE ;&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_CLOSEDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
interface OfficeDocument : Document&lt;br /&gt;
[&lt;br /&gt;
    Automation = FALSE&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
    SID_DOC_MODIFIED&lt;br /&gt;
    [&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
    SID_PRINTDOC&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = PrintExec_Impl ;&lt;br /&gt;
        StateMethod = NoState ;&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
shell SfxObjectShell&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    import OfficeDocument [AUTOMATION];&lt;br /&gt;
&lt;br /&gt;
    SID_DOCINFO&lt;br /&gt;
    [&lt;br /&gt;
        ExecMethod = ExecFile_Impl ;&lt;br /&gt;
        StateMethod = GetState_Impl ;&lt;br /&gt;
    ]&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The interface term is used slightly different in the sdi files that it is used by SFX, so now we use the name &amp;quot;slot arrays&amp;quot; for what the SFX itself calls &amp;quot;interfaces&amp;quot; to avoid confusion.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
As a residue of the old Basic API sdi files define interfaces and shells separately, thus differentiating between slots for both Basic and UI usage and slots only used for UI purposes. This is obsolete today, but still used. Additionally sdi files define base and derived interfaces and shells in a granularity we don&amp;#039;t need anymore, but this is also a residue of the StarBasic support. This might change in the near future. Some interfaces even contained real basic properties that are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; represented by slots at all (like the &amp;quot;object&amp;quot; interface referenced in the example) but they are not used anymore.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;shell&amp;quot; defined in the file references a C++ implementation class SfxObjectShell. This part of the sdi file defines the complete slot interface of this class. The &amp;quot;import&amp;quot; statement tells the svidl compiler that it should add all slots of the interface &amp;quot;OfficeDocument&amp;quot; here (and of course all slots of its &amp;quot;base class&amp;quot; interfaces).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The &amp;quot;Automation&amp;quot; attribute that is assigned to both interfaces and shells tells the svidl compiler whether it should generate a slot array definition for this interface/shell or not. We only generate arrays for shell, not for interfaces (because we don&amp;#039;t need them anymore). In former times we also generated arrays for interfaces, and the &amp;quot;Automation&amp;quot; attribute allowed us to prevent svidl from generating them for base class interfaces also. The &amp;quot;Automation&amp;quot; attribute will become obsolete pretty soon.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the interface/shell definition block slots are referenced by their SlotID. Svidl will get all attributes of the slot it needs to generate the array definition from the slot definition (that of course needs to be included and processed before svidl gets to the shell definition). In the block below this identifier (again with rectangular brackets) two additional attributes are specified: the names of one or two methods can be defined that SFX calls to get status information or execute the slot. These methods have a prescribed signature:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
void Class::StateMethod( SfxItemSet&amp;amp; );&lt;br /&gt;
void Class::ExecMethod( SfxRequest&amp;amp; );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The ItemSet is used to collect the status information, the SfxRequest contains everything necessary for the execution of a slot.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The svidl compiler takes the shell class name and the method name and generates an inline stub function that calls the C++ member. A pointer to each stub is generated into the slot definitions. The stubs are generated into the same header file that contains the generated arrays. Here is an example for the first slot of the interface &amp;quot;Document&amp;quot; shown above:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
SFX_EXEC_STUB( SfxObjectShell, ExecFile_Impl )&lt;br /&gt;
SFX_STATE_STUB( SfxObjectShell, GetState_Impl )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
We use function stubs here because pointer to member functions don&amp;#039;t have a fixed size and so we can&amp;#039;t store them inside a struct like SfxSlot. A pointer to a C function always has the same size as normal pointer on the machine.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The slots in our example show that both pointers can be set or only one of them. A slot without an &amp;quot;Exec&amp;quot; function is a slot that only has a status, execution is done by another slot. A slot without a &amp;quot;GetState&amp;quot; function is always enabled and has no status. SFX automatically generates empty stub in these cases.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside the block defining the functions theoretically all slot attributes of the referenced slot can be overwritten and sometimes this can be found. This should be seen as exceptional cases and it might happen in the near future that this overwriting will become forbidden for more and more attributes. The benefit of this is very limited but the risk of dangerous inconsistencies is high.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Here&amp;#039;s an exerpt of the generated header file that belongs to the SID_CLOSEDOC slot shown above:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
SFX_SLOTMAP_ARG(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
// Slot Nr. 0 : 5502&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_SAVEASDOC,SID_SAVEASDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[1] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                0/*Offset*/, 9/*Count*/,&amp;quot;.SaveAs&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;SaveAs&amp;quot; ),&lt;br /&gt;
// Slot Nr.1 : 5503&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_CLOSEDOC,SID_CLOSEDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[3] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR(SfxObjectShell,GetState_Impl),&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                9/*Offset*/, 2/*Count*/,&amp;quot;.CloseDoc&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;CloseDoc&amp;quot; ),&lt;br /&gt;
// Slot Nr.2 : 5504&lt;br /&gt;
    SFX_NEW_SLOT_ARG( SfxObjectShell,SID_PRINTDOC,SID_PRINTDOC,GID_DOCUMENT,&lt;br /&gt;
                0,&amp;amp;aSfxObjectShellSlots_Impl[2] /* Offset Next*/,&lt;br /&gt;
                SFX_STUB_PTR(SfxObjectShell,ExecFile_Impl),SFX_STUB_PTR_NONE,&lt;br /&gt;
                SFX_SLOT_CACHABLE|SFX_SLOT_ASYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_HASDIALOG|SFX_SLOT_MENUCONFIG|&lt;br /&gt;
                SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_CONTAINER|SFX_SLOT_READONLYDOC|0,&lt;br /&gt;
                0,&lt;br /&gt;
                SfxStringItem,&lt;br /&gt;
                11/*Offset*/, 10/*Count*/,&amp;quot;.Print&amp;quot;,SFX_SLOT_METHOD|0,&amp;quot;Print&amp;quot; ),&lt;br /&gt;
&lt;br /&gt;
         // ... to be continued ...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The SFX_NEW_SLOT_ARG macro initializes a complete slot. Most of it should be pretty obvious from what was described already, please note the macros for the generated stubs (and especially SFX_STUB_PTR_STATE_NONE for the empty stub).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
An interesting addition is the second line of each block, it contains an &amp;quot;Offset Next&amp;quot;. It is a pointer that points to the next slot in this shell that uses the same &amp;quot;GetState&amp;quot; method as the current slot. This enables SFX to collects status information for several slots at once when a complete update is requested. In general the shell code allows to group slots together in Exec/GetState methods and have more than one per shell for clarity reasons.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The last line in each block also contains an offset and a count. These attributes point to the arguments of the slot (of course only for methods). All possible arguments of all slots inside a shell are grouped into a single array, arguments that belong to the same slot of course beneath each other. The offset points to the first argument of a slot:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
SFX_ARGUMENTMAP(SfxObjectShell)&lt;br /&gt;
{&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_NAME,&amp;quot;URL&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILTER_NAME,&amp;quot;FilterName&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_PASSWORD,&amp;quot;Password&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,&amp;quot;FilterOptions&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_COMMENTS,&amp;quot;VersionComment&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_DOCINFO_AUTHOR,&amp;quot;VersionAuthor&amp;quot;,SfxStringItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_OVERWRITE,&amp;quot;Overwrite&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_UNPACK,&amp;quot;Unpacked&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_SAVETO,&amp;quot;SaveTo&amp;quot;,SfxBoolItem),&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_SAVE,&amp;quot;SaveChanges&amp;quot;,SfxBoolItem),    // &amp;lt;---- here args for SID_CLOSEDOC start&lt;br /&gt;
    SFX_ARGUMENT(SID_CLOSEDOC_FILENAME,&amp;quot;FileName&amp;quot;,SfxStringItem), // &amp;quot;count&amp;quot; is 2, so this is the second one&lt;br /&gt;
&lt;br /&gt;
    // ... to be continued ...&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
In each module one header file containing all shells is created. It must be included in the source file of each shell class that contains the SFX_IMPL_INTERFACE macro. To avoid multiple definitions of the slot arrays by this multiple inclusion each code block assigned to a particular shell is framed by an &amp;quot;#ifdef ClassName&amp;quot; block, so in the source file the typical code sequence is&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
#define SfxObjectShell&lt;br /&gt;
#include &amp;quot;sfxslots.hxx&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Other parts of the header file are framed by &amp;quot;#ifdef SFX_TYPEMAP&amp;quot; and this part mustbe activated only once also so each module contains one file that includes the generated header file and defined SFX_TYPEMAP before. This can be on e of the shell files that also defines its shell interface or it can be a different one. The part of the generated header file that is activated here is not necessary for the SFX core (the slot dispatching), but was necessary in former times for the type information of the old Basic API and for macro recording. Today it is used for the wrapper that mediates between SFX dispatching and the Dispatch API and thus also for macro recording because the current macro recorder also uses the Dispatch API.&lt;br /&gt;
&lt;br /&gt;
=== Items and UNO structs ===&lt;br /&gt;
&lt;br /&gt;
The old SFX based Basic API was made up by the property and method slot defined in the sdi files. All types are specified as SfxPoolItems and this was fine for StarBasic because internally these types are used also (for Sbx classes). For recording purposes it was necessary to know the &amp;quot;real&amp;quot; types behind a particular SfxPoolItem type and especially structured items needed to be split up into basic types because StarBasic doesn&amp;#039;t support structs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The mapping from a SfxPoolItem to an atomar or structured type is done by using a mapping table in another sdi file. Here&amp;#039;s an example for atomar types from the SFX module:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
item void     SfxVoidItem&lt;br /&gt;
item BOOL     SfxBoolItem&lt;br /&gt;
item INT32    SfxUInt16Item&lt;br /&gt;
item INT16    SfxInt16Item&lt;br /&gt;
item INT32    SfxUInt32Item&lt;br /&gt;
item INT32    SfxInt32Item&lt;br /&gt;
item String   SfxStringItem&lt;br /&gt;
item BYTE     SfxByteItem&lt;br /&gt;
item INT16    SfxEnumItem&lt;br /&gt;
item INT16    SfxAllEnumItem&lt;br /&gt;
item INT16    TbxImageItem&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
It&amp;#039;s pretty straightforward: &amp;quot;item&amp;quot; declares the type to be atomar and it is followed by the Basic (or better: UNO) type and the Item representing it.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Structured types are a little bit more complicated:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
struct Point&lt;br /&gt;
{&lt;br /&gt;
    INT32    X    MID_X;&lt;br /&gt;
    INT32    Y    MID_Y;&lt;br /&gt;
};&lt;br /&gt;
item Point SfxPointItem;&lt;br /&gt;
&lt;br /&gt;
struct Rectangle&lt;br /&gt;
{&lt;br /&gt;
    INT32    Left    MID_RECT_LEFT;&lt;br /&gt;
    INT32    Top     MID_RECT_TOP;&lt;br /&gt;
    INT32    Width   MID_WIDTH;&lt;br /&gt;
    INT32    Height  MID_HEIGHT;&lt;br /&gt;
};&lt;br /&gt;
item Rectangle SfxRectangleItem;&lt;br /&gt;
&lt;br /&gt;
struct DocInfo&lt;br /&gt;
{&lt;br /&gt;
    BOOL    UseUserData    MID_DOCINFO_USEUSERDATA;&lt;br /&gt;
    BOOL    DeleteUserData MID_DOCINFO_DELETEUSERDATA;&lt;br /&gt;
    String  Title          MID_DOCINFO_TITLE;&lt;br /&gt;
    String  Subject        MID_DOCINFO_SUBJECT;&lt;br /&gt;
    String  KeyWords       MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    String  Description    MID_DOCINFO_KEYWORDS;&lt;br /&gt;
    BOOL    AutoReload     MID_DOCINFO_AUTOLOADENABLED;&lt;br /&gt;
};&lt;br /&gt;
item DocInfo SfxDocumentInfoItem;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The examples show simple structs like a Point or more complex structs like a DocInfo. Structs can be nested, a DocInfo could contain a Point also. In the old StarBasic and also in todays macro recording each number of a struct was represented by an individual item (so an ID was needed that is unique in the complete argument set) and the names of these arguments where assembled from the name of the struct parameter name and the member name in the obvious from ArgName.MemberName.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For some items that are used only internally SFX based code (but not for recording purposes) no mapping was necessary and for syntactical completeness they are mapped to any atomar type, but his mapping is never used:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
item String    SbxItem;                //! Dummy&lt;br /&gt;
item String    SfxObjectItem;          //! Dummy&lt;br /&gt;
item String    SfxTemplateItem;        //! Dummy&lt;br /&gt;
item String    SfxMacroInfoItem;       //! Dummy&lt;br /&gt;
item String    SfxImageItem;           //! Dummy&lt;br /&gt;
item String    SfxFrameItem;           //! Dummy&lt;br /&gt;
item String    SfxObjectShellItem;     //! Dummy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The svidl compiler creates the type mappings into the following form:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
// example for an atomar type&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType0 aSfxStringItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxStringItem), 0&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
// example for a struct with 4 members&lt;br /&gt;
extern SfxType4 aSfxRectangleItem_Impl;&lt;br /&gt;
#ifdef SFX_TYPEMAP&lt;br /&gt;
SfxType4 aSfxRectangleItem_Impl =&lt;br /&gt;
{&lt;br /&gt;
    TYPE(SfxRectangleItem}, 4, { {MID_RECT_LEFT,&amp;quot;Left&amp;quot;}, {MID_RECT_TOP,&amp;quot;Top&amp;quot;}, {MID_WIDTH,&amp;quot;Width&amp;quot;},&lt;br /&gt;
{MID_HEIGHT,&amp;quot;Height&amp;quot;} }&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
It utilizes the TOOLS based RTTI that allows to offer a static factory method by using one of the TYPEINIT_AUTOFACTORY macros. This factory that can be used to create an item of the particular class. This is very important for the conversion routines that match items to UNO structs and vice versa. An item that does not offer a factory can&amp;#039;t be converted properly and so macro recording and Dispatch API are broken for this item.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The conversion between an item and a UNO type uses the virtual PutValue and QueryValue methods of the items. In the case of macro recording (where only atomar types are allowed) the &amp;quot;MemberID&amp;quot; parameter of these calls is used always in case of structured items and so it is important that the MIDs in the sdi file match the MIDs used in the implementation of the item. As an example, an SfxRectangleItem is recorded as two integer values.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The matching we use for the Dispatch API in our controllers on the other hand always converts to complete structs, not to atomar members, so the SfxRectangleItem is converted to a com.sun.star.awt.Rectangle. The rect Put/QueryValue in this case is called with MID=0. It&amp;#039;s vital for this process that &amp;#039;&amp;#039;&amp;#039;&amp;quot;0&amp;quot; is an invalid MID&amp;#039;&amp;#039;&amp;#039; that must not be used for any member.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Article]]&lt;br /&gt;
[[Category:Framework]]&lt;br /&gt;
[[Category:Framework:Article]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117026</id>
		<title>Drawing framework</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117026"/>
		<updated>2009-03-24T09:21:13Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Providing a New Resource */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The drawing framework is a framework used by [[Impress]] and [[Draw]] for the coordinated activation and deactivation of resources like views, panes, and tool bars.&lt;br /&gt;
&lt;br /&gt;
The primary goal in designing the drawing framework was to turn Impress and Draw into modular applications that can easily be extended by additional features.&lt;br /&gt;
This should be possible dynamically through extensions, not only statically at compile time.  The drawing framework is accessible to extensions that are deployed via the extension manager (menu entry Tools-&amp;gt;ExtensionManager...).  This allows an extension to provide for instance a new view and to control when to show this view and in which pane to display it.  This can be done in any programming language for which there is UNO API support.  The [Presenter Screen|Presenter Screen extension] is one example for this.&lt;br /&gt;
&lt;br /&gt;
The design of the drawing framework addresses the following goals:&lt;br /&gt;
&lt;br /&gt;
*ease of use&lt;br /&gt;
&lt;br /&gt;
*flexibility&lt;br /&gt;
&lt;br /&gt;
*extensibility&lt;br /&gt;
&lt;br /&gt;
*abstraction from underlying frameworks&lt;br /&gt;
&lt;br /&gt;
The drawing framework can be seen as a resource management system, where the resources are panes, views, tool bars, commands (slots).  The configuration controller synchronizes activation and deactivation of resources.  It has its name from the configuration, which describes the set of active resources, i.e. the set of visible panes, views, and tool bars.  Synchronization means that when two or more resources are to be activated or deactivated at the same time then the configuration controller&lt;br /&gt;
*orders activations and deactivations according to dependencies between resources (e.g. when a viewand a pane are to be activated then the pane is activated before the view so that the view has access to the pane),&lt;br /&gt;
*tries to minimize the overall time and&lt;br /&gt;
*reduces visual artifacts, i.e. flickering.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is implemented on top of and abstracts from existing framework functionality provides mostly by the SFX2 and [[Framework]] projects.&lt;br /&gt;
&lt;br /&gt;
There is a [[Drawing Framework Glossary|glossary]] for the drawing framework.  The API of the drawing framework is documented [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/module-ix.html here].&lt;br /&gt;
&lt;br /&gt;
==Current State==&lt;br /&gt;
With the experience from the implementation of the [[Presenter_Screen|Presenter Screen extension]] the first incarnation of the drawing framework (that is described by older versions of this page, see history for [http://wiki.services.openoffice.org/w/index.php?title=Drawing_framework&amp;amp;oldid=45696 this] or older versions) has been cleaned up and simplified into its current form.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is used by [[Impress]] and [[Draw]] for managing views, panes, and one or two toolbars.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Framework Design==&lt;br /&gt;
&lt;br /&gt;
The following sections describe the inner structure of the drawing framework in more detail.&lt;br /&gt;
It starts with the set of supported resources, the ResourceIds that identify resources, and configurations that describe the set of active or requested resources.&lt;br /&gt;
Last comes a description of the update process that involves the actual activation and deactivation of resources.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
The drawing framework has been desinged for four types of resources:&lt;br /&gt;
&lt;br /&gt;
* Panes&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
&lt;br /&gt;
* Tool Bars&lt;br /&gt;
&lt;br /&gt;
* Command groups&lt;br /&gt;
&lt;br /&gt;
While the first three need little explanation (the little explanation is done in the API documentation) the concept of [[Drawing Framework Glossary#Command Groups|command groups]] is not used (yet) anywhere else.  A command group is a collection of commands realized by a module that implements at least the com::sun::star::frame::XDispatch interface and implements one or more commands (that to some are known as slots).&lt;br /&gt;
&lt;br /&gt;
A resource is identified by a non-empty set of URLs that describe the actual resource and its dependency on other resources.  One URL is called the resource URL and defines the type of the resource.  A possibly empty set of anchor URLs specifies a set of resources to which the one in question is anchored.  Panes for example act as containers for views and thus are their anchors: the resource URL of the left slide sorter in the left pane is &amp;lt;pre&amp;gt;private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;.  Its anchor is the left pane with the URL being &amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane&amp;lt;/pre&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here, the first part after private:resource/ specifies the type of resource:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;pane&amp;#039;&amp;#039;&amp;#039; for panes&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;view&amp;#039;&amp;#039;&amp;#039; for views&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;toolbar&amp;#039;&amp;#039;&amp;#039; for tool bars&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;#039; for command groups&lt;br /&gt;
The final part of the URL defines the actual resource.&lt;br /&gt;
&lt;br /&gt;
===ResourceId===&lt;br /&gt;
Each resource is identified by an object that implements the&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/ResourceId.html com::sun::star::drawing::framework::ResourceId] service with its [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XResourceId.html com::sun::star::drawing::framework::XResourceId] interface.  The XResourceId interface gives access to a set of URLs which specify the resource.  There is one URL returned by the getResourceURL() function that defines the type of the resource.  A possibly empty set of URLs returned by getAnchorURLs() specifies the anchor resource.&lt;br /&gt;
&lt;br /&gt;
Each resource in a configuration has to have a unique resource id.  Two resource ids may have the same resource URLs but then their anchors must not be the same.  An example for this would be the slide sorter being shown in two different panes.  Alternatively two resource may have the same anchor but then must not have the same resource URL.  An example for this is the view tab bar and the view in the center pane.  The anchor of both is the center pane.&lt;br /&gt;
&lt;br /&gt;
Lets take the slide sorter as an example for this.  In the left pane, the slide sorter bar is described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
The slide sorter view in the center pane id described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Panes are the typical anchor resources.  They do not have an anchor, therefore getAnchorURLs() returns an empty list for them.  An example for an anchor that is not a pane is the view tab bar.  It is linked to the center pane.  It is the anchor for its tabs that each represent one view that may by displayed in the center pane.  The resource ids of the two left most tabs are for example&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/ImpressView&lt;br /&gt;
private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/OutlineView&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ResourceId service provides four functions for creating ResourceId objects.  These are createEmpty() and create() for creating an empty resource id and one that has no anchor.  The createWithAnchor() variant creates a resource whose anchor is given as ResourceId object.  When the later is empty then the resulting resource could have been created with create().  Finally createWithAnchorURL takes two URLs, one for the actual resource and one for its anchor.  These four variants cover the most common usages but it may be extended in the future (note drawing framework API is not yet marked as published and may be modified.)&lt;br /&gt;
&lt;br /&gt;
===Known Resources===&lt;br /&gt;
A list of known resources can be found [[Drawing Framework Resources|here]].&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
&lt;br /&gt;
A [[Drawing Framework Glossary#Configuration|configuration]] describes a set&lt;br /&gt;
of resources.  There are two important configurations, which ideally are&lt;br /&gt;
identical:&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Current Configuration|current configuration]] describes the set of currently active resources. The term &amp;#039;&amp;#039;active&amp;#039;&amp;#039; can mean different things for different types of resources.  For panes, views, and tool bars it means that they are visible. For a command group it means that that group is ready to process incoming slot calls.&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Requested Configuration|requested configuration]] describes the set of  resources that have been requested to be active either directly by the user or by the application in response to some user input.&lt;br /&gt;
&lt;br /&gt;
Usually the two configurations differ only temporarily after a&lt;br /&gt;
new request for the activation or deactivation of a resource has been made&lt;br /&gt;
but not yet been processed.  Eventually the current configuration is updated to&lt;br /&gt;
reflect the requested configuration.  There may, however, be circumstances,&lt;br /&gt;
that do not allow a resource to be activated or (less likely) to be deactivated.&lt;br /&gt;
One reason for this is that some resources are created asynchronously and&lt;br /&gt;
become available only after a little time.&lt;br /&gt;
&lt;br /&gt;
See the  [[Drawing Framework Glossary#Configuration|configuration]] glossary&lt;br /&gt;
entry for examples.&lt;br /&gt;
&lt;br /&gt;
It is possible obtain a copy of the requested configuration and restore it&lt;br /&gt;
later.  This allows to undo temporary changes.  For example, the in-place&lt;br /&gt;
slide show uses this feature to temporarily hide the side panes and to&lt;br /&gt;
restore them when the show ends.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Three layer design===&lt;br /&gt;
&lt;br /&gt;
The drawing framework consists of controllers, factories, and application&lt;br /&gt;
logic modules.  These  are located on three layers.  The assignment to the&lt;br /&gt;
different layers depends on the knowledge about different aspects of the&lt;br /&gt;
resource management:&lt;br /&gt;
&lt;br /&gt;
;Application Layer:The [[Drawing Framework Glossary#Application Layer|application layer]] controls &amp;#039;&amp;#039;&amp;#039;when&amp;#039;&amp;#039;&amp;#039; to activate or deactivate a resource.  This layer contains the application logic.  For example the Impress application uses a module that is responsible for activating or deactivating the slide sorter bar depending on the view that is displayed in the center pane.&lt;br /&gt;
&lt;br /&gt;
;Synchronization Layer:The [[Drawing Framework Glossary#Synchronization Layer|synchronization layer]] uses the XConfigurationController to &amp;#039;&amp;#039;&amp;#039;synchronize&amp;#039;&amp;#039;&amp;#039; the requests from the application layer with the resource controllers in the resource layer. It has no detailed knowledge about individual resources nor about the application logic.&lt;br /&gt;
&lt;br /&gt;
;Resource Layer:The resource factories in the [[Drawing Framework Glossary#Resource Layer|resource layer]] know &amp;#039;&amp;#039;&amp;#039;how&amp;#039;&amp;#039;&amp;#039; to activate or deactivate resources.  The XResourceControllers are called by the XConfigurationController to update the the current configuration so that it looks like the requested configuration.&lt;br /&gt;
&lt;br /&gt;
[[image:DrawingFrameworkDesign.png|The different parts of the drawing framework are organized in three layers]]&lt;br /&gt;
&lt;br /&gt;
The image illustrates the three layer design for the Impress application.  The ImpressModule is created by the ImpressViewShell when the user creates a new Impress document.  The ImpressModule creates the other modules in the application layer that control different aspect of the application.  For example they watch for user input and switch to different views in ther center pane accordingly.&lt;br /&gt;
&lt;br /&gt;
The modules in the application layer communicate with the XConfgurationController in the synchronization layer to make requests for the activation or deactivation of panes and views.  The XConfigurationController modifies the RequestedConfiguration accordingly. &lt;br /&gt;
&lt;br /&gt;
Eventually the CurrentConfiguration is updated.  The XConfigurationController then determines the order in which to activate and deactivate resources and calls the resource factories in that order to create resources that are activated or to release resources that are deactivated.&lt;br /&gt;
&lt;br /&gt;
Resource factories can implement a cache to store deactivated resources.  Some resources like the slide sorter bar are activated and deactivated frequently.  Caching it may speed this up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Two phase updates===&lt;br /&gt;
&lt;br /&gt;
The drawing framework negotiates between modules implementing application&lt;br /&gt;
logic that want to show or hide a resource on one side and the resource&lt;br /&gt;
factories on the other side.  The negotiation process is iterative: the&lt;br /&gt;
activation request of a resource made by one application logic module may&lt;br /&gt;
cause the activation request of another resource made by a second module.&lt;br /&gt;
For example, when the user switches the view in the center pane to the&lt;br /&gt;
outline view, then the task pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
The negation process is split into two phases, one&lt;br /&gt;
for collecting a list of all the necessary changes and the second for&lt;br /&gt;
updating the GUI to reflect these changes.&lt;br /&gt;
&lt;br /&gt;
;Negotiation Phase: The negotiation phase is triggered by the initial request, for example the switch of the view in the center pane.  In this phase only the requested configuration is modified.  The requested change is stored in the requested configuration and then is broadcasted.  Listeners may react by making further requests for activation or deactivation of other resources.  These are again stored in the requested configuration and broadcasted and may lead to even more requests.  All requests are put into a queue which is processed until there are no more pending requests.&lt;br /&gt;
&lt;br /&gt;
;Update Phase:When all requests have been processed and the requested configuration describes a new consistent state of the GUI then the second, the &amp;#039;&amp;#039;&amp;#039;update phase&amp;#039;&amp;#039;&amp;#039; is started.  In this phase only the current configuration is modified.&lt;br /&gt;
:That is, the requested configuration is not modified directly in this phase.  The application can of course request the activation or deactivation of resources.  Therefore, in the update phase a copy of the requested configuration is used which remains unchanged during the update.&lt;br /&gt;
:The different resource factories are asked to create or relase resources so that eventually the current configuration looks like the requested configuration.  Every activation and deactivation is broadcasted like the requests for the activations and deactivations were.&lt;br /&gt;
&lt;br /&gt;
It is the task of the configuration controller to order the activations and deactivations according to dependencies between affected resources and to optimize the update&lt;br /&gt;
phase with respect to time and visual artifacts/flickering.&lt;br /&gt;
&lt;br /&gt;
==Extensibility==&lt;br /&gt;
The drawing framework is designed to be extensible with regard to the set of known resources and to the application logic.&lt;br /&gt;
&lt;br /&gt;
For a new resource you have to provide a factory and register it at the configuration manager.  An example could be a new view or a new tool bar.&lt;br /&gt;
&lt;br /&gt;
For a new piece of application logic add a listener to the configuration controller and react to activations or deactivations of relevant resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation and Examples==&lt;br /&gt;
The examples in the following sections show how to use the drawing framework to request and access resources and how to react to changes of the current configuration.  Note that the code is C++ like pseudo code that can not be compiled as is.&lt;br /&gt;
&lt;br /&gt;
===FrameworkHelper===&lt;br /&gt;
The ::sd::framework::FrameworkHelper class provides two things&lt;br /&gt;
* the most frequently used resource URLs so that you do not have to remember them, have trouble with resource allocation, or be able to misspell resource names, and&lt;br /&gt;
* some helper functions that simplify the work with the UNO based drawing framework from inside core code.&lt;br /&gt;
The FrameworkHelper is a multi singleton.  Its Instance() method returns for a ViewShellBase object the associated FrameworkHelper object.  The functions provided cover&lt;br /&gt;
* mapping between sd::ViewShell::ShellType and view resource URL,&lt;br /&gt;
* obtain view objects for their URLs or ResourceIds,&lt;br /&gt;
* making requests for the activation or deactivation of resources,&lt;br /&gt;
* locking configuration updates,&lt;br /&gt;
* waiting for certain events to make asynchronous requests synchronous.&lt;br /&gt;
&lt;br /&gt;
One example for that is a request for the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
FrameworkHelper::Instance(GetViewShellBase()).RequestView(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Drawing Framework API===&lt;br /&gt;
The following subsections provide a short introduction of the UNO API of the drawing framework.  For details please refer to the API documentation (not yet available.)&lt;br /&gt;
&lt;br /&gt;
====Getting Access to the Drawing Framework====&lt;br /&gt;
Using the UNO API of the drawing framework to access active resources or to request the activation or deactivation of resources starts with the [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XController.html XController] of an [[Impress]] or a [[Draw]] document.  From this you can obtain the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XControllerManager.html XControllerManager] and from that the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XConfigurationController.html XConfigurationController].  The XConfigurationController is the main access point for making requests and for accessing resources. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
using ::com::sun::star::uno;&lt;br /&gt;
using ::com::sun::star::frame;&lt;br /&gt;
using ::com::sun::star::drawing::framework;&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XController&amp;gt; xController;              // This is regarded as given.&lt;br /&gt;
Reference&amp;lt;XComponentContext&amp;gt; xComponentContext;  // This also is regarded as given.&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Requesting a Resource Activation====&lt;br /&gt;
Once you have obtained access to the XConfigurationController, making requests to activate or deactivate resources is simple.  The following code requests the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you compare this to the code bove that uses the FrameworkHelper to accomplish&lt;br /&gt;
the same thing then you see, that the FrameworkHelper only hides the&lt;br /&gt;
connection from the ViewShellBase to the XConfigurationController.  The rest&lt;br /&gt;
of the call is basically the same.&lt;br /&gt;
&lt;br /&gt;
However, the drawing framework does not provide too many automatisms on this&lt;br /&gt;
layer (that is the task of the modules in the application layer) so the pane&lt;br /&gt;
in which to show the slide sorter has to be requested as well.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note the use of ResourceId::create() instead of ResourceId::createWithAnchorURL(). This is because a pane, in contrast to the view that was requested earlier, is not bound to any other resource.&lt;br /&gt;
&lt;br /&gt;
The two requests should be executed together.  An intermediate update of the&lt;br /&gt;
current configuration is not necessary and would lead to an annoying display&lt;br /&gt;
of an empty window before the slide sorter bar is properly shown.  The&lt;br /&gt;
probability that this happens is low but not zero.  Therefore it is good&lt;br /&gt;
practice to lock the XConfigurationController while the two requests are&lt;br /&gt;
made.  This prevents unwanted updates.  You can call the lock() and unlock()&lt;br /&gt;
methods directly but it is safer to use the ConfigurationController::Lock&lt;br /&gt;
inner class to do that.  Adding this and bringing the two requests into the&lt;br /&gt;
logical order you get&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    ::sd::framework::ConfigurationController::Lock(xCC);&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::create(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::createWithAnchorURL(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Accessing a Resource====&lt;br /&gt;
If you want to access an active resource directly then you have to ask the&lt;br /&gt;
XConfigurationController for it.  Suppose you are interested in accessing the window of the left&lt;br /&gt;
pane that shows the slide sorter bar:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL),&lt;br /&gt;
    UNO_QUERY);&lt;br /&gt;
if (xPane.is())&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
    if (xWindow-&amp;gt;is())&lt;br /&gt;
    {&lt;br /&gt;
        // Do something with the window.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reacting to Modifications of the Configuration====&lt;br /&gt;
When you want to implement application logic then you have to react to user input by requesting changes to the current configuration.  User input can come in many ways.  Here we cover only the indirect way of (requested) changes of the current configuration made by others.&lt;br /&gt;
&lt;br /&gt;
The following code turns on the slide sorter bar when the center pane is switched to&lt;br /&gt;
the edit view, outline view, or notes view and turns it off for all other views.  The drawing framework contains a module in the application layer that does essentially the same.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SlideSorterBarManager : public XConfigurationChangeListener&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; mxCC;&lt;br /&gt;
&lt;br /&gt;
void SlideSorterBarManager (const Reference&amp;lt;XConfigurationController&amp;gt;&amp;amp; rxCC)&lt;br /&gt;
    : mxCC(rxCC)&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XConfigurationControllerBroadcaster&amp;gt; xCCB (mxCC, UNO_QUERY);&lt;br /&gt;
    xCCB-&amp;gt;addConfigurationChangeListener(&lt;br /&gt;
        this,&lt;br /&gt;
        FramworkHelper::msResourceActivationRequestEvent,&lt;br /&gt;
        Any());&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
virtual void notifyConfigurationChange (const ConfigurationChangeEvent&amp;amp; rEvent)&lt;br /&gt;
{&lt;br /&gt;
    if (rEvent.Type.equals(FrameworkHelper::msResourceActivationRequestEvent))&lt;br /&gt;
    {&lt;br /&gt;
        if (rEvent.ResourceId.is())&lt;br /&gt;
         &amp;amp;&amp;amp; rEvent.ResourceId-&amp;gt;isBoundToURL(FrameworkHelper::msCenterPaneURL,DIRECT))&lt;br /&gt;
        {&lt;br /&gt;
            // A resource has been requested for the center pane.&lt;br /&gt;
            ::rtl::OUString sResourceURL (rEvent.ResourceId-&amp;gt;getResourceURL());&lt;br /&gt;
            if (sResourceURL.equals(FrameworkHelper::msImpressViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msOutlineViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msNotesViewURL))&lt;br /&gt;
            {&lt;br /&gt;
                // Show the slide sorter bar.&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::create(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Hide the slide sorter bar for the handout view, the slide&lt;br /&gt;
                // sorter view, and all views that where not handled above.&lt;br /&gt;
                mxCC-&amp;gt;requestResourceDeactivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
There are three things to note in this code:&lt;br /&gt;
# The first &amp;#039;&amp;#039;&amp;#039;if&amp;#039;&amp;#039;&amp;#039; statement in the notifyConfigurationChange() method is not really necessary because the listener is registered only for this one event type and thus will not be called for other event types.&lt;br /&gt;
# There is no update lock surrounding the activation requests for the slide sorter bar.  This is not necessary   here, because the listener is only called during the negotiation phase.  During this whole phase the update is locked.&lt;br /&gt;
# There is only one deactivation request, the one for the view.  The request for the pane is missing.  This is because there might be other resources bound to the pane.  However, this is one of a few places where an automatism is active: when there are no resources bound to a pane when the negotiation phase ends, then the pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
====Providing a New Resource====&lt;br /&gt;
To provide a new resource, say a SingleColorView that fills a window with a&lt;br /&gt;
single color, you have to&lt;br /&gt;
*Provide the actual view&lt;br /&gt;
*Provide a factory that creates a view object for a given XPane object&lt;br /&gt;
*Register the factory&lt;br /&gt;
*Request the new view&lt;br /&gt;
&lt;br /&gt;
A view has to support the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XView.html css::drawing::framework::XView] interface which is&lt;br /&gt;
derived from the XResource interface.  Both interfaces are extremely simple&lt;br /&gt;
because the drawing framework does not need to know much about its&lt;br /&gt;
resources.&lt;br /&gt;
&lt;br /&gt;
The knowledge is concentrated only in the factory and of course in the&lt;br /&gt;
implementation of the new view.  Both a new resource and its factory are&lt;br /&gt;
typically deployed together so they can use private and implementation&lt;br /&gt;
language dependent means to communicate with each other and share information.&lt;br /&gt;
&lt;br /&gt;
The factory is given a ResourceId when asked for a new resource object.  For&lt;br /&gt;
the SingleColorView the ResourceId is used to look up the corresponding&lt;br /&gt;
XPane object from which the XWindow reference is obtained.  For the standard&lt;br /&gt;
panes the XPane object supports the XUnoTunnel interface which gives access&lt;br /&gt;
to the VCL Window pointer, but that is not used here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SingleColorViewFactory : XResourceFactory&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    virtual Reference&amp;lt;XView&amp;gt; createResource (&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        Reference&amp;lt;XResource&amp;gt; xView;&lt;br /&gt;
&lt;br /&gt;
        // Get the XWindow object fort the AnchorURL of the given ResourceId.&lt;br /&gt;
        Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
        Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
        Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(rxViewId-&amp;gt;getAnchor()), UNO_QUERY);&lt;br /&gt;
        if (xPane.is())&lt;br /&gt;
        {&lt;br /&gt;
            // Create the view for the XWindow object.&lt;br /&gt;
            Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
            if (xWindow.is())&lt;br /&gt;
                xView = new SingleColorView(rxViewId, xWindow);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return xView;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void releaseView (&lt;br /&gt;
        const Reference&amp;lt;XResource&amp;gt;&amp;amp; rxView)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing.  When the caller releases its reference to the view,&lt;br /&gt;
        // then the view will be destroyed.&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SingleColorView : drawing::framework::XView, awt::XPaintListener&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    SingleColorView(&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId,&lt;br /&gt;
        const Reference&amp;lt;XWindow&amp;gt;&amp;amp; rxWindow)&lt;br /&gt;
        : mxViewId(rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        rxWindow-&amp;gt;addPaintListener(this);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual ResourceId getResourceId (void)&lt;br /&gt;
    {&lt;br /&gt;
        return maId;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void windowPaint (const awt::PaintEvent&amp;amp; rEvent)&lt;br /&gt;
    {&lt;br /&gt;
        // Paint the area specified by the event.&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
    Reference&amp;lt;XResourceId&amp;gt; mxViewId;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The factory can be registered in two ways.&lt;br /&gt;
#Dynamically by calling XViewController::addViewFactory()&lt;br /&gt;
#Statically by adding an entry to the configuration.&lt;br /&gt;
&lt;br /&gt;
For the latter you have to provide a UNO service for the view factory, say com.sun.star.drawing.framework.SingleColorViewFactory.  With&lt;br /&gt;
this, merge the following entry into the Impress.xcu file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MultiPaneGUI&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;Framework&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;ResourceFactories&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;F0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ServiceName&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;com.sun.star.drawing.framework.SingleColorViewFactory&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;ResourceList&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;R0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;private:resource/view/SingleColorView&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
All what remains to be done is to request the view.  To show it in the right&lt;br /&gt;
pane, instead of the task panel, make this call:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        ::rtl::OUString::createFromAscii(&amp;quot;private:resource/view/SingleColorView&amp;quot;),&lt;br /&gt;
        FrameworkHelper::msRightPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Impress]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117025</id>
		<title>Drawing framework</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117025"/>
		<updated>2009-03-24T09:09:01Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Reacting to Modifications of the Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The drawing framework is a framework used by [[Impress]] and [[Draw]] for the coordinated activation and deactivation of resources like views, panes, and tool bars.&lt;br /&gt;
&lt;br /&gt;
The primary goal in designing the drawing framework was to turn Impress and Draw into modular applications that can easily be extended by additional features.&lt;br /&gt;
This should be possible dynamically through extensions, not only statically at compile time.  The drawing framework is accessible to extensions that are deployed via the extension manager (menu entry Tools-&amp;gt;ExtensionManager...).  This allows an extension to provide for instance a new view and to control when to show this view and in which pane to display it.  This can be done in any programming language for which there is UNO API support.  The [Presenter Screen|Presenter Screen extension] is one example for this.&lt;br /&gt;
&lt;br /&gt;
The design of the drawing framework addresses the following goals:&lt;br /&gt;
&lt;br /&gt;
*ease of use&lt;br /&gt;
&lt;br /&gt;
*flexibility&lt;br /&gt;
&lt;br /&gt;
*extensibility&lt;br /&gt;
&lt;br /&gt;
*abstraction from underlying frameworks&lt;br /&gt;
&lt;br /&gt;
The drawing framework can be seen as a resource management system, where the resources are panes, views, tool bars, commands (slots).  The configuration controller synchronizes activation and deactivation of resources.  It has its name from the configuration, which describes the set of active resources, i.e. the set of visible panes, views, and tool bars.  Synchronization means that when two or more resources are to be activated or deactivated at the same time then the configuration controller&lt;br /&gt;
*orders activations and deactivations according to dependencies between resources (e.g. when a viewand a pane are to be activated then the pane is activated before the view so that the view has access to the pane),&lt;br /&gt;
*tries to minimize the overall time and&lt;br /&gt;
*reduces visual artifacts, i.e. flickering.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is implemented on top of and abstracts from existing framework functionality provides mostly by the SFX2 and [[Framework]] projects.&lt;br /&gt;
&lt;br /&gt;
There is a [[Drawing Framework Glossary|glossary]] for the drawing framework.  The API of the drawing framework is documented [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/module-ix.html here].&lt;br /&gt;
&lt;br /&gt;
==Current State==&lt;br /&gt;
With the experience from the implementation of the [[Presenter_Screen|Presenter Screen extension]] the first incarnation of the drawing framework (that is described by older versions of this page, see history for [http://wiki.services.openoffice.org/w/index.php?title=Drawing_framework&amp;amp;oldid=45696 this] or older versions) has been cleaned up and simplified into its current form.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is used by [[Impress]] and [[Draw]] for managing views, panes, and one or two toolbars.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Framework Design==&lt;br /&gt;
&lt;br /&gt;
The following sections describe the inner structure of the drawing framework in more detail.&lt;br /&gt;
It starts with the set of supported resources, the ResourceIds that identify resources, and configurations that describe the set of active or requested resources.&lt;br /&gt;
Last comes a description of the update process that involves the actual activation and deactivation of resources.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
The drawing framework has been desinged for four types of resources:&lt;br /&gt;
&lt;br /&gt;
* Panes&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
&lt;br /&gt;
* Tool Bars&lt;br /&gt;
&lt;br /&gt;
* Command groups&lt;br /&gt;
&lt;br /&gt;
While the first three need little explanation (the little explanation is done in the API documentation) the concept of [[Drawing Framework Glossary#Command Groups|command groups]] is not used (yet) anywhere else.  A command group is a collection of commands realized by a module that implements at least the com::sun::star::frame::XDispatch interface and implements one or more commands (that to some are known as slots).&lt;br /&gt;
&lt;br /&gt;
A resource is identified by a non-empty set of URLs that describe the actual resource and its dependency on other resources.  One URL is called the resource URL and defines the type of the resource.  A possibly empty set of anchor URLs specifies a set of resources to which the one in question is anchored.  Panes for example act as containers for views and thus are their anchors: the resource URL of the left slide sorter in the left pane is &amp;lt;pre&amp;gt;private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;.  Its anchor is the left pane with the URL being &amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane&amp;lt;/pre&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here, the first part after private:resource/ specifies the type of resource:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;pane&amp;#039;&amp;#039;&amp;#039; for panes&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;view&amp;#039;&amp;#039;&amp;#039; for views&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;toolbar&amp;#039;&amp;#039;&amp;#039; for tool bars&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;#039; for command groups&lt;br /&gt;
The final part of the URL defines the actual resource.&lt;br /&gt;
&lt;br /&gt;
===ResourceId===&lt;br /&gt;
Each resource is identified by an object that implements the&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/ResourceId.html com::sun::star::drawing::framework::ResourceId] service with its [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XResourceId.html com::sun::star::drawing::framework::XResourceId] interface.  The XResourceId interface gives access to a set of URLs which specify the resource.  There is one URL returned by the getResourceURL() function that defines the type of the resource.  A possibly empty set of URLs returned by getAnchorURLs() specifies the anchor resource.&lt;br /&gt;
&lt;br /&gt;
Each resource in a configuration has to have a unique resource id.  Two resource ids may have the same resource URLs but then their anchors must not be the same.  An example for this would be the slide sorter being shown in two different panes.  Alternatively two resource may have the same anchor but then must not have the same resource URL.  An example for this is the view tab bar and the view in the center pane.  The anchor of both is the center pane.&lt;br /&gt;
&lt;br /&gt;
Lets take the slide sorter as an example for this.  In the left pane, the slide sorter bar is described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
The slide sorter view in the center pane id described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Panes are the typical anchor resources.  They do not have an anchor, therefore getAnchorURLs() returns an empty list for them.  An example for an anchor that is not a pane is the view tab bar.  It is linked to the center pane.  It is the anchor for its tabs that each represent one view that may by displayed in the center pane.  The resource ids of the two left most tabs are for example&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/ImpressView&lt;br /&gt;
private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/OutlineView&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ResourceId service provides four functions for creating ResourceId objects.  These are createEmpty() and create() for creating an empty resource id and one that has no anchor.  The createWithAnchor() variant creates a resource whose anchor is given as ResourceId object.  When the later is empty then the resulting resource could have been created with create().  Finally createWithAnchorURL takes two URLs, one for the actual resource and one for its anchor.  These four variants cover the most common usages but it may be extended in the future (note drawing framework API is not yet marked as published and may be modified.)&lt;br /&gt;
&lt;br /&gt;
===Known Resources===&lt;br /&gt;
A list of known resources can be found [[Drawing Framework Resources|here]].&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
&lt;br /&gt;
A [[Drawing Framework Glossary#Configuration|configuration]] describes a set&lt;br /&gt;
of resources.  There are two important configurations, which ideally are&lt;br /&gt;
identical:&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Current Configuration|current configuration]] describes the set of currently active resources. The term &amp;#039;&amp;#039;active&amp;#039;&amp;#039; can mean different things for different types of resources.  For panes, views, and tool bars it means that they are visible. For a command group it means that that group is ready to process incoming slot calls.&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Requested Configuration|requested configuration]] describes the set of  resources that have been requested to be active either directly by the user or by the application in response to some user input.&lt;br /&gt;
&lt;br /&gt;
Usually the two configurations differ only temporarily after a&lt;br /&gt;
new request for the activation or deactivation of a resource has been made&lt;br /&gt;
but not yet been processed.  Eventually the current configuration is updated to&lt;br /&gt;
reflect the requested configuration.  There may, however, be circumstances,&lt;br /&gt;
that do not allow a resource to be activated or (less likely) to be deactivated.&lt;br /&gt;
One reason for this is that some resources are created asynchronously and&lt;br /&gt;
become available only after a little time.&lt;br /&gt;
&lt;br /&gt;
See the  [[Drawing Framework Glossary#Configuration|configuration]] glossary&lt;br /&gt;
entry for examples.&lt;br /&gt;
&lt;br /&gt;
It is possible obtain a copy of the requested configuration and restore it&lt;br /&gt;
later.  This allows to undo temporary changes.  For example, the in-place&lt;br /&gt;
slide show uses this feature to temporarily hide the side panes and to&lt;br /&gt;
restore them when the show ends.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Three layer design===&lt;br /&gt;
&lt;br /&gt;
The drawing framework consists of controllers, factories, and application&lt;br /&gt;
logic modules.  These  are located on three layers.  The assignment to the&lt;br /&gt;
different layers depends on the knowledge about different aspects of the&lt;br /&gt;
resource management:&lt;br /&gt;
&lt;br /&gt;
;Application Layer:The [[Drawing Framework Glossary#Application Layer|application layer]] controls &amp;#039;&amp;#039;&amp;#039;when&amp;#039;&amp;#039;&amp;#039; to activate or deactivate a resource.  This layer contains the application logic.  For example the Impress application uses a module that is responsible for activating or deactivating the slide sorter bar depending on the view that is displayed in the center pane.&lt;br /&gt;
&lt;br /&gt;
;Synchronization Layer:The [[Drawing Framework Glossary#Synchronization Layer|synchronization layer]] uses the XConfigurationController to &amp;#039;&amp;#039;&amp;#039;synchronize&amp;#039;&amp;#039;&amp;#039; the requests from the application layer with the resource controllers in the resource layer. It has no detailed knowledge about individual resources nor about the application logic.&lt;br /&gt;
&lt;br /&gt;
;Resource Layer:The resource factories in the [[Drawing Framework Glossary#Resource Layer|resource layer]] know &amp;#039;&amp;#039;&amp;#039;how&amp;#039;&amp;#039;&amp;#039; to activate or deactivate resources.  The XResourceControllers are called by the XConfigurationController to update the the current configuration so that it looks like the requested configuration.&lt;br /&gt;
&lt;br /&gt;
[[image:DrawingFrameworkDesign.png|The different parts of the drawing framework are organized in three layers]]&lt;br /&gt;
&lt;br /&gt;
The image illustrates the three layer design for the Impress application.  The ImpressModule is created by the ImpressViewShell when the user creates a new Impress document.  The ImpressModule creates the other modules in the application layer that control different aspect of the application.  For example they watch for user input and switch to different views in ther center pane accordingly.&lt;br /&gt;
&lt;br /&gt;
The modules in the application layer communicate with the XConfgurationController in the synchronization layer to make requests for the activation or deactivation of panes and views.  The XConfigurationController modifies the RequestedConfiguration accordingly. &lt;br /&gt;
&lt;br /&gt;
Eventually the CurrentConfiguration is updated.  The XConfigurationController then determines the order in which to activate and deactivate resources and calls the resource factories in that order to create resources that are activated or to release resources that are deactivated.&lt;br /&gt;
&lt;br /&gt;
Resource factories can implement a cache to store deactivated resources.  Some resources like the slide sorter bar are activated and deactivated frequently.  Caching it may speed this up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Two phase updates===&lt;br /&gt;
&lt;br /&gt;
The drawing framework negotiates between modules implementing application&lt;br /&gt;
logic that want to show or hide a resource on one side and the resource&lt;br /&gt;
factories on the other side.  The negotiation process is iterative: the&lt;br /&gt;
activation request of a resource made by one application logic module may&lt;br /&gt;
cause the activation request of another resource made by a second module.&lt;br /&gt;
For example, when the user switches the view in the center pane to the&lt;br /&gt;
outline view, then the task pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
The negation process is split into two phases, one&lt;br /&gt;
for collecting a list of all the necessary changes and the second for&lt;br /&gt;
updating the GUI to reflect these changes.&lt;br /&gt;
&lt;br /&gt;
;Negotiation Phase: The negotiation phase is triggered by the initial request, for example the switch of the view in the center pane.  In this phase only the requested configuration is modified.  The requested change is stored in the requested configuration and then is broadcasted.  Listeners may react by making further requests for activation or deactivation of other resources.  These are again stored in the requested configuration and broadcasted and may lead to even more requests.  All requests are put into a queue which is processed until there are no more pending requests.&lt;br /&gt;
&lt;br /&gt;
;Update Phase:When all requests have been processed and the requested configuration describes a new consistent state of the GUI then the second, the &amp;#039;&amp;#039;&amp;#039;update phase&amp;#039;&amp;#039;&amp;#039; is started.  In this phase only the current configuration is modified.&lt;br /&gt;
:That is, the requested configuration is not modified directly in this phase.  The application can of course request the activation or deactivation of resources.  Therefore, in the update phase a copy of the requested configuration is used which remains unchanged during the update.&lt;br /&gt;
:The different resource factories are asked to create or relase resources so that eventually the current configuration looks like the requested configuration.  Every activation and deactivation is broadcasted like the requests for the activations and deactivations were.&lt;br /&gt;
&lt;br /&gt;
It is the task of the configuration controller to order the activations and deactivations according to dependencies between affected resources and to optimize the update&lt;br /&gt;
phase with respect to time and visual artifacts/flickering.&lt;br /&gt;
&lt;br /&gt;
==Extensibility==&lt;br /&gt;
The drawing framework is designed to be extensible with regard to the set of known resources and to the application logic.&lt;br /&gt;
&lt;br /&gt;
For a new resource you have to provide a factory and register it at the configuration manager.  An example could be a new view or a new tool bar.&lt;br /&gt;
&lt;br /&gt;
For a new piece of application logic add a listener to the configuration controller and react to activations or deactivations of relevant resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation and Examples==&lt;br /&gt;
The examples in the following sections show how to use the drawing framework to request and access resources and how to react to changes of the current configuration.  Note that the code is C++ like pseudo code that can not be compiled as is.&lt;br /&gt;
&lt;br /&gt;
===FrameworkHelper===&lt;br /&gt;
The ::sd::framework::FrameworkHelper class provides two things&lt;br /&gt;
* the most frequently used resource URLs so that you do not have to remember them, have trouble with resource allocation, or be able to misspell resource names, and&lt;br /&gt;
* some helper functions that simplify the work with the UNO based drawing framework from inside core code.&lt;br /&gt;
The FrameworkHelper is a multi singleton.  Its Instance() method returns for a ViewShellBase object the associated FrameworkHelper object.  The functions provided cover&lt;br /&gt;
* mapping between sd::ViewShell::ShellType and view resource URL,&lt;br /&gt;
* obtain view objects for their URLs or ResourceIds,&lt;br /&gt;
* making requests for the activation or deactivation of resources,&lt;br /&gt;
* locking configuration updates,&lt;br /&gt;
* waiting for certain events to make asynchronous requests synchronous.&lt;br /&gt;
&lt;br /&gt;
One example for that is a request for the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
FrameworkHelper::Instance(GetViewShellBase()).RequestView(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Drawing Framework API===&lt;br /&gt;
The following subsections provide a short introduction of the UNO API of the drawing framework.  For details please refer to the API documentation (not yet available.)&lt;br /&gt;
&lt;br /&gt;
====Getting Access to the Drawing Framework====&lt;br /&gt;
Using the UNO API of the drawing framework to access active resources or to request the activation or deactivation of resources starts with the [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XController.html XController] of an [[Impress]] or a [[Draw]] document.  From this you can obtain the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XControllerManager.html XControllerManager] and from that the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XConfigurationController.html XConfigurationController].  The XConfigurationController is the main access point for making requests and for accessing resources. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
using ::com::sun::star::uno;&lt;br /&gt;
using ::com::sun::star::frame;&lt;br /&gt;
using ::com::sun::star::drawing::framework;&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XController&amp;gt; xController;              // This is regarded as given.&lt;br /&gt;
Reference&amp;lt;XComponentContext&amp;gt; xComponentContext;  // This also is regarded as given.&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Requesting a Resource Activation====&lt;br /&gt;
Once you have obtained access to the XConfigurationController, making requests to activate or deactivate resources is simple.  The following code requests the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you compare this to the code bove that uses the FrameworkHelper to accomplish&lt;br /&gt;
the same thing then you see, that the FrameworkHelper only hides the&lt;br /&gt;
connection from the ViewShellBase to the XConfigurationController.  The rest&lt;br /&gt;
of the call is basically the same.&lt;br /&gt;
&lt;br /&gt;
However, the drawing framework does not provide too many automatisms on this&lt;br /&gt;
layer (that is the task of the modules in the application layer) so the pane&lt;br /&gt;
in which to show the slide sorter has to be requested as well.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note the use of ResourceId::create() instead of ResourceId::createWithAnchorURL(). This is because a pane, in contrast to the view that was requested earlier, is not bound to any other resource.&lt;br /&gt;
&lt;br /&gt;
The two requests should be executed together.  An intermediate update of the&lt;br /&gt;
current configuration is not necessary and would lead to an annoying display&lt;br /&gt;
of an empty window before the slide sorter bar is properly shown.  The&lt;br /&gt;
probability that this happens is low but not zero.  Therefore it is good&lt;br /&gt;
practice to lock the XConfigurationController while the two requests are&lt;br /&gt;
made.  This prevents unwanted updates.  You can call the lock() and unlock()&lt;br /&gt;
methods directly but it is safer to use the ConfigurationController::Lock&lt;br /&gt;
inner class to do that.  Adding this and bringing the two requests into the&lt;br /&gt;
logical order you get&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    ::sd::framework::ConfigurationController::Lock(xCC);&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::create(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::createWithAnchorURL(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Accessing a Resource====&lt;br /&gt;
If you want to access an active resource directly then you have to ask the&lt;br /&gt;
XConfigurationController for it.  Suppose you are interested in accessing the window of the left&lt;br /&gt;
pane that shows the slide sorter bar:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL),&lt;br /&gt;
    UNO_QUERY);&lt;br /&gt;
if (xPane.is())&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
    if (xWindow-&amp;gt;is())&lt;br /&gt;
    {&lt;br /&gt;
        // Do something with the window.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reacting to Modifications of the Configuration====&lt;br /&gt;
When you want to implement application logic then you have to react to user input by requesting changes to the current configuration.  User input can come in many ways.  Here we cover only the indirect way of (requested) changes of the current configuration made by others.&lt;br /&gt;
&lt;br /&gt;
The following code turns on the slide sorter bar when the center pane is switched to&lt;br /&gt;
the edit view, outline view, or notes view and turns it off for all other views.  The drawing framework contains a module in the application layer that does essentially the same.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SlideSorterBarManager : public XConfigurationChangeListener&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; mxCC;&lt;br /&gt;
&lt;br /&gt;
void SlideSorterBarManager (const Reference&amp;lt;XConfigurationController&amp;gt;&amp;amp; rxCC)&lt;br /&gt;
    : mxCC(rxCC)&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XConfigurationControllerBroadcaster&amp;gt; xCCB (mxCC, UNO_QUERY);&lt;br /&gt;
    xCCB-&amp;gt;addConfigurationChangeListener(&lt;br /&gt;
        this,&lt;br /&gt;
        FramworkHelper::msResourceActivationRequestEvent,&lt;br /&gt;
        Any());&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
virtual void notifyConfigurationChange (const ConfigurationChangeEvent&amp;amp; rEvent)&lt;br /&gt;
{&lt;br /&gt;
    if (rEvent.Type.equals(FrameworkHelper::msResourceActivationRequestEvent))&lt;br /&gt;
    {&lt;br /&gt;
        if (rEvent.ResourceId.is())&lt;br /&gt;
         &amp;amp;&amp;amp; rEvent.ResourceId-&amp;gt;isBoundToURL(FrameworkHelper::msCenterPaneURL,DIRECT))&lt;br /&gt;
        {&lt;br /&gt;
            // A resource has been requested for the center pane.&lt;br /&gt;
            ::rtl::OUString sResourceURL (rEvent.ResourceId-&amp;gt;getResourceURL());&lt;br /&gt;
            if (sResourceURL.equals(FrameworkHelper::msImpressViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msOutlineViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msNotesViewURL))&lt;br /&gt;
            {&lt;br /&gt;
                // Show the slide sorter bar.&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::create(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Hide the slide sorter bar for the handout view, the slide&lt;br /&gt;
                // sorter view, and all views that where not handled above.&lt;br /&gt;
                mxCC-&amp;gt;requestResourceDeactivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
There are three things to note in this code:&lt;br /&gt;
# The first &amp;#039;&amp;#039;&amp;#039;if&amp;#039;&amp;#039;&amp;#039; statement in the notifyConfigurationChange() method is not really necessary because the listener is registered only for this one event type and thus will not be called for other event types.&lt;br /&gt;
# There is no update lock surrounding the activation requests for the slide sorter bar.  This is not necessary   here, because the listener is only called during the negotiation phase.  During this whole phase the update is locked.&lt;br /&gt;
# There is only one deactivation request, the one for the view.  The request for the pane is missing.  This is because there might be other resources bound to the pane.  However, this is one of a few places where an automatism is active: when there are no resources bound to a pane when the negotiation phase ends, then the pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
====Providing a New Resource====&lt;br /&gt;
To provide a new resource, say a SingleColorView that fills a window with a&lt;br /&gt;
single color, you have to&lt;br /&gt;
*Provide the actual view&lt;br /&gt;
*Provide a factory that creates a view object for a given XPane object&lt;br /&gt;
*Register the factory&lt;br /&gt;
*Request the new view&lt;br /&gt;
&lt;br /&gt;
A view has to support the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XView.html css::drawing::framework::XView] interface which is&lt;br /&gt;
derived from the XResource interface.  Both interfaces are extremely simple&lt;br /&gt;
because the drawing framework does not need to know much about its&lt;br /&gt;
resources.&lt;br /&gt;
&lt;br /&gt;
The knowledge is concentrated only in the factory and of course in the&lt;br /&gt;
implementation of the new view.  Both a new resource and its factory are&lt;br /&gt;
typically deployed together so they can use private and implementation&lt;br /&gt;
language dependent means to communicate with each other and share information.&lt;br /&gt;
&lt;br /&gt;
The factory is given a ResourceId when asked for a new resource object.  For&lt;br /&gt;
the SingleColorView the ResourceId is used to look up the corresponding&lt;br /&gt;
XPane object from which the XWindow reference is obtained.  For the standard&lt;br /&gt;
panes the XPane object supports the XUnoTunnel interface which gives access&lt;br /&gt;
to the VCL Window pointer, but that is not used here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SingleColorViewFactory : XResourceFactory&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    virtual Reference&amp;lt;XView&amp;gt; createResource (&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        Reference&amp;lt;XResource&amp;gt; xView;&lt;br /&gt;
&lt;br /&gt;
        // Get the XWindow object fort the AnchorURL of the given ResourceId.&lt;br /&gt;
        Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
        Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
        Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(rxViewId-&amp;gt;getAnchor()), UNO_QUERY);&lt;br /&gt;
        if (xPane.is())&lt;br /&gt;
        {&lt;br /&gt;
            // Create the view for the XWindow object.&lt;br /&gt;
            Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
            if (xWindow.is())&lt;br /&gt;
                xView = new SingleColorView(rxViewId, xWindow);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return xView;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void releaseView (&lt;br /&gt;
        const Reference&amp;lt;XResource&amp;gt;&amp;amp; rxView)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing.  When the caller releases its reference to the view,&lt;br /&gt;
        // then the view will be destroyed.&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SingleColorView : drawing::framework::XView, awt::XPaintListener&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    SingleColorView(&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId,&lt;br /&gt;
        const Reference&amp;lt;XWindow&amp;gt;&amp;amp; rxWindow)&lt;br /&gt;
        : mxViewId(rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        rxWindow-&amp;gt;addPaintListener(this);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual ResourceId getResourceId (void)&lt;br /&gt;
    {&lt;br /&gt;
        return maId;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void windowPaint (const awt::PaintEvent&amp;amp; rEvent)&lt;br /&gt;
    {&lt;br /&gt;
        // Paint the area specified by the event.&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
    Reference&amp;lt;XResourceId&amp;gt; mxViewId;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The factory can be registered in two ways.&lt;br /&gt;
#Dynamically by calling XViewController::addViewFactory()&lt;br /&gt;
#Statically by adding an entry to the configuration.&lt;br /&gt;
&lt;br /&gt;
For the latter you have to provide a UNO service for the view factory, say com.sun.star.drawing.framework.SingleColorViewFactory.  With&lt;br /&gt;
this, merge the following entry into the Impress.xcu file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MultiPaneGUI&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;Framework&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;ResourceFactories&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;F0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ServiceName&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;com.sun.star.drawing.framework.SingleColorViewFactory&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;ResourceList&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;R0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;private:resource/view/SingleColorView&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
All what remains to be done is to request the view.  To show it in the right&lt;br /&gt;
pane, instead of the task panel, make this call:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        ::rtl::OUString::createFromAscii(&amp;quot;private:resource/view/SingleColorView&amp;quot;),&lt;br /&gt;
        FameworkHelper::msRightPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Impress]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117020</id>
		<title>Drawing framework</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117020"/>
		<updated>2009-03-24T08:36:26Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: Marked the code listings as source code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The drawing framework is a framework used by [[Impress]] and [[Draw]] for the coordinated activation and deactivation of resources like views, panes, and tool bars.&lt;br /&gt;
&lt;br /&gt;
The primary goal in designing the drawing framework was to turn Impress and Draw into modular applications that can easily be extended by additional features.&lt;br /&gt;
This should be possible dynamically through extensions, not only statically at compile time.  The drawing framework is accessible to extensions that are deployed via the extension manager (menu entry Tools-&amp;gt;ExtensionManager...).  This allows an extension to provide for instance a new view and to control when to show this view and in which pane to display it.  This can be done in any programming language for which there is UNO API support.  The [Presenter Screen|Presenter Screen extension] is one example for this.&lt;br /&gt;
&lt;br /&gt;
The design of the drawing framework addresses the following goals:&lt;br /&gt;
&lt;br /&gt;
*ease of use&lt;br /&gt;
&lt;br /&gt;
*flexibility&lt;br /&gt;
&lt;br /&gt;
*extensibility&lt;br /&gt;
&lt;br /&gt;
*abstraction from underlying frameworks&lt;br /&gt;
&lt;br /&gt;
The drawing framework can be seen as a resource management system, where the resources are panes, views, tool bars, commands (slots).  The configuration controller synchronizes activation and deactivation of resources.  It has its name from the configuration, which describes the set of active resources, i.e. the set of visible panes, views, and tool bars.  Synchronization means that when two or more resources are to be activated or deactivated at the same time then the configuration controller&lt;br /&gt;
*orders activations and deactivations according to dependencies between resources (e.g. when a viewand a pane are to be activated then the pane is activated before the view so that the view has access to the pane),&lt;br /&gt;
*tries to minimize the overall time and&lt;br /&gt;
*reduces visual artifacts, i.e. flickering.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is implemented on top of and abstracts from existing framework functionality provides mostly by the SFX2 and [[Framework]] projects.&lt;br /&gt;
&lt;br /&gt;
There is a [[Drawing Framework Glossary|glossary]] for the drawing framework.  The API of the drawing framework is documented [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/module-ix.html here].&lt;br /&gt;
&lt;br /&gt;
==Current State==&lt;br /&gt;
With the experience from the implementation of the [[Presenter_Screen|Presenter Screen extension]] the first incarnation of the drawing framework (that is described by older versions of this page, see history for [http://wiki.services.openoffice.org/w/index.php?title=Drawing_framework&amp;amp;oldid=45696 this] or older versions) has been cleaned up and simplified into its current form.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is used by [[Impress]] and [[Draw]] for managing views, panes, and one or two toolbars.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Framework Design==&lt;br /&gt;
&lt;br /&gt;
The following sections describe the inner structure of the drawing framework in more detail.&lt;br /&gt;
It starts with the set of supported resources, the ResourceIds that identify resources, and configurations that describe the set of active or requested resources.&lt;br /&gt;
Last comes a description of the update process that involves the actual activation and deactivation of resources.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
The drawing framework has been desinged for four types of resources:&lt;br /&gt;
&lt;br /&gt;
* Panes&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
&lt;br /&gt;
* Tool Bars&lt;br /&gt;
&lt;br /&gt;
* Command groups&lt;br /&gt;
&lt;br /&gt;
While the first three need little explanation (the little explanation is done in the API documentation) the concept of [[Drawing Framework Glossary#Command Groups|command groups]] is not used (yet) anywhere else.  A command group is a collection of commands realized by a module that implements at least the com::sun::star::frame::XDispatch interface and implements one or more commands (that to some are known as slots).&lt;br /&gt;
&lt;br /&gt;
A resource is identified by a non-empty set of URLs that describe the actual resource and its dependency on other resources.  One URL is called the resource URL and defines the type of the resource.  A possibly empty set of anchor URLs specifies a set of resources to which the one in question is anchored.  Panes for example act as containers for views and thus are their anchors: the resource URL of the left slide sorter in the left pane is &amp;lt;pre&amp;gt;private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;.  Its anchor is the left pane with the URL being &amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane&amp;lt;/pre&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here, the first part after private:resource/ specifies the type of resource:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;pane&amp;#039;&amp;#039;&amp;#039; for panes&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;view&amp;#039;&amp;#039;&amp;#039; for views&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;toolbar&amp;#039;&amp;#039;&amp;#039; for tool bars&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;#039; for command groups&lt;br /&gt;
The final part of the URL defines the actual resource.&lt;br /&gt;
&lt;br /&gt;
===ResourceId===&lt;br /&gt;
Each resource is identified by an object that implements the&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/ResourceId.html com::sun::star::drawing::framework::ResourceId] service with its [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XResourceId.html com::sun::star::drawing::framework::XResourceId] interface.  The XResourceId interface gives access to a set of URLs which specify the resource.  There is one URL returned by the getResourceURL() function that defines the type of the resource.  A possibly empty set of URLs returned by getAnchorURLs() specifies the anchor resource.&lt;br /&gt;
&lt;br /&gt;
Each resource in a configuration has to have a unique resource id.  Two resource ids may have the same resource URLs but then their anchors must not be the same.  An example for this would be the slide sorter being shown in two different panes.  Alternatively two resource may have the same anchor but then must not have the same resource URL.  An example for this is the view tab bar and the view in the center pane.  The anchor of both is the center pane.&lt;br /&gt;
&lt;br /&gt;
Lets take the slide sorter as an example for this.  In the left pane, the slide sorter bar is described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
The slide sorter view in the center pane id described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Panes are the typical anchor resources.  They do not have an anchor, therefore getAnchorURLs() returns an empty list for them.  An example for an anchor that is not a pane is the view tab bar.  It is linked to the center pane.  It is the anchor for its tabs that each represent one view that may by displayed in the center pane.  The resource ids of the two left most tabs are for example&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/ImpressView&lt;br /&gt;
private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/OutlineView&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ResourceId service provides four functions for creating ResourceId objects.  These are createEmpty() and create() for creating an empty resource id and one that has no anchor.  The createWithAnchor() variant creates a resource whose anchor is given as ResourceId object.  When the later is empty then the resulting resource could have been created with create().  Finally createWithAnchorURL takes two URLs, one for the actual resource and one for its anchor.  These four variants cover the most common usages but it may be extended in the future (note drawing framework API is not yet marked as published and may be modified.)&lt;br /&gt;
&lt;br /&gt;
===Known Resources===&lt;br /&gt;
A list of known resources can be found [[Drawing Framework Resources|here]].&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
&lt;br /&gt;
A [[Drawing Framework Glossary#Configuration|configuration]] describes a set&lt;br /&gt;
of resources.  There are two important configurations, which ideally are&lt;br /&gt;
identical:&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Current Configuration|current configuration]] describes the set of currently active resources. The term &amp;#039;&amp;#039;active&amp;#039;&amp;#039; can mean different things for different types of resources.  For panes, views, and tool bars it means that they are visible. For a command group it means that that group is ready to process incoming slot calls.&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Requested Configuration|requested configuration]] describes the set of  resources that have been requested to be active either directly by the user or by the application in response to some user input.&lt;br /&gt;
&lt;br /&gt;
Usually the two configurations differ only temporarily after a&lt;br /&gt;
new request for the activation or deactivation of a resource has been made&lt;br /&gt;
but not yet been processed.  Eventually the current configuration is updated to&lt;br /&gt;
reflect the requested configuration.  There may, however, be circumstances,&lt;br /&gt;
that do not allow a resource to be activated or (less likely) to be deactivated.&lt;br /&gt;
One reason for this is that some resources are created asynchronously and&lt;br /&gt;
become available only after a little time.&lt;br /&gt;
&lt;br /&gt;
See the  [[Drawing Framework Glossary#Configuration|configuration]] glossary&lt;br /&gt;
entry for examples.&lt;br /&gt;
&lt;br /&gt;
It is possible obtain a copy of the requested configuration and restore it&lt;br /&gt;
later.  This allows to undo temporary changes.  For example, the in-place&lt;br /&gt;
slide show uses this feature to temporarily hide the side panes and to&lt;br /&gt;
restore them when the show ends.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Three layer design===&lt;br /&gt;
&lt;br /&gt;
The drawing framework consists of controllers, factories, and application&lt;br /&gt;
logic modules.  These  are located on three layers.  The assignment to the&lt;br /&gt;
different layers depends on the knowledge about different aspects of the&lt;br /&gt;
resource management:&lt;br /&gt;
&lt;br /&gt;
;Application Layer:The [[Drawing Framework Glossary#Application Layer|application layer]] controls &amp;#039;&amp;#039;&amp;#039;when&amp;#039;&amp;#039;&amp;#039; to activate or deactivate a resource.  This layer contains the application logic.  For example the Impress application uses a module that is responsible for activating or deactivating the slide sorter bar depending on the view that is displayed in the center pane.&lt;br /&gt;
&lt;br /&gt;
;Synchronization Layer:The [[Drawing Framework Glossary#Synchronization Layer|synchronization layer]] uses the XConfigurationController to &amp;#039;&amp;#039;&amp;#039;synchronize&amp;#039;&amp;#039;&amp;#039; the requests from the application layer with the resource controllers in the resource layer. It has no detailed knowledge about individual resources nor about the application logic.&lt;br /&gt;
&lt;br /&gt;
;Resource Layer:The resource factories in the [[Drawing Framework Glossary#Resource Layer|resource layer]] know &amp;#039;&amp;#039;&amp;#039;how&amp;#039;&amp;#039;&amp;#039; to activate or deactivate resources.  The XResourceControllers are called by the XConfigurationController to update the the current configuration so that it looks like the requested configuration.&lt;br /&gt;
&lt;br /&gt;
[[image:DrawingFrameworkDesign.png|The different parts of the drawing framework are organized in three layers]]&lt;br /&gt;
&lt;br /&gt;
The image illustrates the three layer design for the Impress application.  The ImpressModule is created by the ImpressViewShell when the user creates a new Impress document.  The ImpressModule creates the other modules in the application layer that control different aspect of the application.  For example they watch for user input and switch to different views in ther center pane accordingly.&lt;br /&gt;
&lt;br /&gt;
The modules in the application layer communicate with the XConfgurationController in the synchronization layer to make requests for the activation or deactivation of panes and views.  The XConfigurationController modifies the RequestedConfiguration accordingly. &lt;br /&gt;
&lt;br /&gt;
Eventually the CurrentConfiguration is updated.  The XConfigurationController then determines the order in which to activate and deactivate resources and calls the resource factories in that order to create resources that are activated or to release resources that are deactivated.&lt;br /&gt;
&lt;br /&gt;
Resource factories can implement a cache to store deactivated resources.  Some resources like the slide sorter bar are activated and deactivated frequently.  Caching it may speed this up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Two phase updates===&lt;br /&gt;
&lt;br /&gt;
The drawing framework negotiates between modules implementing application&lt;br /&gt;
logic that want to show or hide a resource on one side and the resource&lt;br /&gt;
factories on the other side.  The negotiation process is iterative: the&lt;br /&gt;
activation request of a resource made by one application logic module may&lt;br /&gt;
cause the activation request of another resource made by a second module.&lt;br /&gt;
For example, when the user switches the view in the center pane to the&lt;br /&gt;
outline view, then the task pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
The negation process is split into two phases, one&lt;br /&gt;
for collecting a list of all the necessary changes and the second for&lt;br /&gt;
updating the GUI to reflect these changes.&lt;br /&gt;
&lt;br /&gt;
;Negotiation Phase: The negotiation phase is triggered by the initial request, for example the switch of the view in the center pane.  In this phase only the requested configuration is modified.  The requested change is stored in the requested configuration and then is broadcasted.  Listeners may react by making further requests for activation or deactivation of other resources.  These are again stored in the requested configuration and broadcasted and may lead to even more requests.  All requests are put into a queue which is processed until there are no more pending requests.&lt;br /&gt;
&lt;br /&gt;
;Update Phase:When all requests have been processed and the requested configuration describes a new consistent state of the GUI then the second, the &amp;#039;&amp;#039;&amp;#039;update phase&amp;#039;&amp;#039;&amp;#039; is started.  In this phase only the current configuration is modified.&lt;br /&gt;
:That is, the requested configuration is not modified directly in this phase.  The application can of course request the activation or deactivation of resources.  Therefore, in the update phase a copy of the requested configuration is used which remains unchanged during the update.&lt;br /&gt;
:The different resource factories are asked to create or relase resources so that eventually the current configuration looks like the requested configuration.  Every activation and deactivation is broadcasted like the requests for the activations and deactivations were.&lt;br /&gt;
&lt;br /&gt;
It is the task of the configuration controller to order the activations and deactivations according to dependencies between affected resources and to optimize the update&lt;br /&gt;
phase with respect to time and visual artifacts/flickering.&lt;br /&gt;
&lt;br /&gt;
==Extensibility==&lt;br /&gt;
The drawing framework is designed to be extensible with regard to the set of known resources and to the application logic.&lt;br /&gt;
&lt;br /&gt;
For a new resource you have to provide a factory and register it at the configuration manager.  An example could be a new view or a new tool bar.&lt;br /&gt;
&lt;br /&gt;
For a new piece of application logic add a listener to the configuration controller and react to activations or deactivations of relevant resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation and Examples==&lt;br /&gt;
The examples in the following sections show how to use the drawing framework to request and access resources and how to react to changes of the current configuration.  Note that the code is C++ like pseudo code that can not be compiled as is.&lt;br /&gt;
&lt;br /&gt;
===FrameworkHelper===&lt;br /&gt;
The ::sd::framework::FrameworkHelper class provides two things&lt;br /&gt;
* the most frequently used resource URLs so that you do not have to remember them, have trouble with resource allocation, or be able to misspell resource names, and&lt;br /&gt;
* some helper functions that simplify the work with the UNO based drawing framework from inside core code.&lt;br /&gt;
The FrameworkHelper is a multi singleton.  Its Instance() method returns for a ViewShellBase object the associated FrameworkHelper object.  The functions provided cover&lt;br /&gt;
* mapping between sd::ViewShell::ShellType and view resource URL,&lt;br /&gt;
* obtain view objects for their URLs or ResourceIds,&lt;br /&gt;
* making requests for the activation or deactivation of resources,&lt;br /&gt;
* locking configuration updates,&lt;br /&gt;
* waiting for certain events to make asynchronous requests synchronous.&lt;br /&gt;
&lt;br /&gt;
One example for that is a request for the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
FrameworkHelper::Instance(GetViewShellBase()).RequestView(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Drawing Framework API===&lt;br /&gt;
The following subsections provide a short introduction of the UNO API of the drawing framework.  For details please refer to the API documentation (not yet available.)&lt;br /&gt;
&lt;br /&gt;
====Getting Access to the Drawing Framework====&lt;br /&gt;
Using the UNO API of the drawing framework to access active resources or to request the activation or deactivation of resources starts with the [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XController.html XController] of an [[Impress]] or a [[Draw]] document.  From this you can obtain the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XControllerManager.html XControllerManager] and from that the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XConfigurationController.html XConfigurationController].  The XConfigurationController is the main access point for making requests and for accessing resources. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
using ::com::sun::star::uno;&lt;br /&gt;
using ::com::sun::star::frame;&lt;br /&gt;
using ::com::sun::star::drawing::framework;&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XController&amp;gt; xController;              // This is regarded as given.&lt;br /&gt;
Reference&amp;lt;XComponentContext&amp;gt; xComponentContext;  // This also is regarded as given.&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Requesting a Resource Activation====&lt;br /&gt;
Once you have obtained access to the XConfigurationController, making requests to activate or deactivate resources is simple.  The following code requests the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you compare this to the code bove that uses the FrameworkHelper to accomplish&lt;br /&gt;
the same thing then you see, that the FrameworkHelper only hides the&lt;br /&gt;
connection from the ViewShellBase to the XConfigurationController.  The rest&lt;br /&gt;
of the call is basically the same.&lt;br /&gt;
&lt;br /&gt;
However, the drawing framework does not provide too many automatisms on this&lt;br /&gt;
layer (that is the task of the modules in the application layer) so the pane&lt;br /&gt;
in which to show the slide sorter has to be requested as well.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note the use of ResourceId::create() instead of ResourceId::createWithAnchorURL(). This is because a pane, in contrast to the view that was requested earlier, is not bound to any other resource.&lt;br /&gt;
&lt;br /&gt;
The two requests should be executed together.  An intermediate update of the&lt;br /&gt;
current configuration is not necessary and would lead to an annoying display&lt;br /&gt;
of an empty window before the slide sorter bar is properly shown.  The&lt;br /&gt;
probability that this happens is low but not zero.  Therefore it is good&lt;br /&gt;
practice to lock the XConfigurationController while the two requests are&lt;br /&gt;
made.  This prevents unwanted updates.  You can call the lock() and unlock()&lt;br /&gt;
methods directly but it is safer to use the ConfigurationController::Lock&lt;br /&gt;
inner class to do that.  Adding this and bringing the two requests into the&lt;br /&gt;
logical order you get&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    ::sd::framework::ConfigurationController::Lock(xCC);&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::create(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::createWithAnchorURL(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Accessing a Resource====&lt;br /&gt;
If you want to access an active resource directly then you have to ask the&lt;br /&gt;
XConfigurationController for it.  Suppose you are interested in accessing the window of the left&lt;br /&gt;
pane that shows the slide sorter bar:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL),&lt;br /&gt;
    UNO_QUERY);&lt;br /&gt;
if (xPane.is())&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
    if (xWindow-&amp;gt;is())&lt;br /&gt;
    {&lt;br /&gt;
        // Do something with the window.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reacting to Modifications of the Configuration====&lt;br /&gt;
When you want to implement application logic then you have to react to user input by requesting changes to the current configuration.  User input can come in many ways.  Here we cover only the indirect way of (requested) changes of the current configuration made by others.&lt;br /&gt;
&lt;br /&gt;
The following code turns on the slide sorter bar when the center pane is switched to&lt;br /&gt;
the edit view, outline view, or notes view and turns it off for all other views.  The drawing framework contains a module in the application layer that does essentially the same.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SlideSorterBarManager : public XConfigurationChangeListener {&lt;br /&gt;
public:&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; mxCC;&lt;br /&gt;
&lt;br /&gt;
void SlideSorterBarManager (const Reference&amp;lt;XConfigurationController&amp;gt;&amp;amp; rxCC)&lt;br /&gt;
    : mxCC(rxCC)&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XConfigurationControllerBroadcaster&amp;gt; xCCB (mxCC, UNO_QUERY);&lt;br /&gt;
    xCCB-&amp;gt;addConfigurationChangeListener(&lt;br /&gt;
        this,&lt;br /&gt;
        FramworkHelper::msResourceActivationRequestEvent,&lt;br /&gt;
        Any());&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
virtual void notifyConfigurationChange (const ConfigurationChangeEvent&amp;amp; rEvent)&lt;br /&gt;
{&lt;br /&gt;
    if (rEvent.Type.equals(FrameworkHelper::msResourceActivationRequestEvent))&lt;br /&gt;
    {&lt;br /&gt;
        if (rEvent.ResourceId.is())&lt;br /&gt;
         &amp;amp;&amp;amp; rEvent.ResourceId-&amp;gt;isBoundToURL(FrameworkHelper::msCenterPaneURL,DIRECT))&lt;br /&gt;
        {&lt;br /&gt;
            // A resource has been requested for the center pane.&lt;br /&gt;
            ::rtl::OUString sResourceURL (rEvent.ResourceId-&amp;gt;getResourceURL());&lt;br /&gt;
            if (sResourceURL.equals(FrameworkHelper::msImpressViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msOutlineViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msNotesViewURL))&lt;br /&gt;
            {&lt;br /&gt;
                // Show the slide sorter bar.&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::create(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Hide the slide sorter bar for the handout view, the slide&lt;br /&gt;
                // sorter view, and all views that where not handled above.&lt;br /&gt;
                mxCC-&amp;gt;requestResourceDeactivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
There are three things to note in this code:&lt;br /&gt;
# The first &amp;#039;&amp;#039;&amp;#039;if&amp;#039;&amp;#039;&amp;#039; statement in the notifyConfigurationChange() method is not really necessary because the listener is registered only for this one event type and thus will not be called for other event types.&lt;br /&gt;
# There is no update lock surrounding the activation requests for the slide sorter bar.  This is not necessary   here, because the listener is only called during the negotiation phase.  During this whole phase the update is locked.&lt;br /&gt;
# There is only one deactivation request, the one for the view.  The request for the pane is missing.  This is because there might be other resources bound to the pane.  However, this is one of a few places where an automatism is active: when there are no resources bound to a pane when the negotiation phase ends, then the pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Providing a New Resource====&lt;br /&gt;
To provide a new resource, say a SingleColorView that fills a window with a&lt;br /&gt;
single color, you have to&lt;br /&gt;
*Provide the actual view&lt;br /&gt;
*Provide a factory that creates a view object for a given XPane object&lt;br /&gt;
*Register the factory&lt;br /&gt;
*Request the new view&lt;br /&gt;
&lt;br /&gt;
A view has to support the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XView.html css::drawing::framework::XView] interface which is&lt;br /&gt;
derived from the XResource interface.  Both interfaces are extremely simple&lt;br /&gt;
because the drawing framework does not need to know much about its&lt;br /&gt;
resources.&lt;br /&gt;
&lt;br /&gt;
The knowledge is concentrated only in the factory and of course in the&lt;br /&gt;
implementation of the new view.  Both a new resource and its factory are&lt;br /&gt;
typically deployed together so they can use private and implementation&lt;br /&gt;
language dependent means to communicate with each other and share information.&lt;br /&gt;
&lt;br /&gt;
The factory is given a ResourceId when asked for a new resource object.  For&lt;br /&gt;
the SingleColorView the ResourceId is used to look up the corresponding&lt;br /&gt;
XPane object from which the XWindow reference is obtained.  For the standard&lt;br /&gt;
panes the XPane object supports the XUnoTunnel interface which gives access&lt;br /&gt;
to the VCL Window pointer, but that is not used here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SingleColorViewFactory : XResourceFactory&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    virtual Reference&amp;lt;XView&amp;gt; createResource (&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        Reference&amp;lt;XResource&amp;gt; xView;&lt;br /&gt;
&lt;br /&gt;
        // Get the XWindow object fort the AnchorURL of the given ResourceId.&lt;br /&gt;
        Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
        Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
        Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(rxViewId-&amp;gt;getAnchor()), UNO_QUERY);&lt;br /&gt;
        if (xPane.is())&lt;br /&gt;
        {&lt;br /&gt;
            // Create the view for the XWindow object.&lt;br /&gt;
            Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
            if (xWindow.is())&lt;br /&gt;
                xView = new SingleColorView(rxViewId, xWindow);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return xView;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void releaseView (&lt;br /&gt;
        const Reference&amp;lt;XResource&amp;gt;&amp;amp; rxView)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing.  When the caller releases its reference to the view,&lt;br /&gt;
        // then the view will be destroyed.&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class SingleColorView : drawing::framework::XView, awt::XPaintListener&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    SingleColorView(&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId,&lt;br /&gt;
        const Reference&amp;lt;XWindow&amp;gt;&amp;amp; rxWindow)&lt;br /&gt;
        : mxViewId(rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        rxWindow-&amp;gt;addPaintListener(this);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual ResourceId getResourceId (void)&lt;br /&gt;
    {&lt;br /&gt;
        return maId;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void windowPaint (const awt::PaintEvent&amp;amp; rEvent)&lt;br /&gt;
    {&lt;br /&gt;
        // Paint the area specified by the event.&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
    Reference&amp;lt;XResourceId&amp;gt; mxViewId;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The factory can be registered in two ways.&lt;br /&gt;
#Dynamically by calling XViewController::addViewFactory()&lt;br /&gt;
#Statically by adding an entry to the configuration.&lt;br /&gt;
&lt;br /&gt;
For the latter you have to provide a UNO service for the view factory, say com.sun.star.drawing.framework.SingleColorViewFactory.  With&lt;br /&gt;
this, merge the following entry into the Impress.xcu file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MultiPaneGUI&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;Framework&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;ResourceFactories&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;F0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ServiceName&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;com.sun.star.drawing.framework.SingleColorViewFactory&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;ResourceList&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;R0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;private:resource/view/SingleColorView&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
All what remains to be done is to request the view.  To show it in the right&lt;br /&gt;
pane, instead of the task panel, make this call:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        ::rtl::OUString::createFromAscii(&amp;quot;private:resource/view/SingleColorView&amp;quot;),&lt;br /&gt;
        FameworkHelper::msRightPaneURL));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Impress]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117018</id>
		<title>Drawing framework</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117018"/>
		<updated>2009-03-24T07:33:35Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* FrameworkHelper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The drawing framework is a framework used by [[Impress]] and [[Draw]] for the coordinated activation and deactivation of resources like views, panes, and tool bars.&lt;br /&gt;
&lt;br /&gt;
The primary goal in designing the drawing framework was to turn Impress and Draw into modular applications that can easily be extended by additional features.&lt;br /&gt;
This should be possible dynamically through extensions, not only statically at compile time.  The drawing framework is accessible to extensions that are deployed via the extension manager (menu entry Tools-&amp;gt;ExtensionManager...).  This allows an extension to provide for instance a new view and to control when to show this view and in which pane to display it.  This can be done in any programming language for which there is UNO API support.  The [Presenter Screen|Presenter Screen extension] is one example for this.&lt;br /&gt;
&lt;br /&gt;
The design of the drawing framework addresses the following goals:&lt;br /&gt;
&lt;br /&gt;
*ease of use&lt;br /&gt;
&lt;br /&gt;
*flexibility&lt;br /&gt;
&lt;br /&gt;
*extensibility&lt;br /&gt;
&lt;br /&gt;
*abstraction from underlying frameworks&lt;br /&gt;
&lt;br /&gt;
The drawing framework can be seen as a resource management system, where the resources are panes, views, tool bars, commands (slots).  The configuration controller synchronizes activation and deactivation of resources.  It has its name from the configuration, which describes the set of active resources, i.e. the set of visible panes, views, and tool bars.  Synchronization means that when two or more resources are to be activated or deactivated at the same time then the configuration controller&lt;br /&gt;
*orders activations and deactivations according to dependencies between resources (e.g. when a viewand a pane are to be activated then the pane is activated before the view so that the view has access to the pane),&lt;br /&gt;
*tries to minimize the overall time and&lt;br /&gt;
*reduces visual artifacts, i.e. flickering.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is implemented on top of and abstracts from existing framework functionality provides mostly by the SFX2 and [[Framework]] projects.&lt;br /&gt;
&lt;br /&gt;
There is a [[Drawing Framework Glossary|glossary]] for the drawing framework.  The API of the drawing framework is documented [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/module-ix.html here].&lt;br /&gt;
&lt;br /&gt;
==Current State==&lt;br /&gt;
With the experience from the implementation of the [[Presenter_Screen|Presenter Screen extension]] the first incarnation of the drawing framework (that is described by older versions of this page, see history for [http://wiki.services.openoffice.org/w/index.php?title=Drawing_framework&amp;amp;oldid=45696 this] or older versions) has been cleaned up and simplified into its current form.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is used by [[Impress]] and [[Draw]] for managing views, panes, and one or two toolbars.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Framework Design==&lt;br /&gt;
&lt;br /&gt;
The following sections describe the inner structure of the drawing framework in more detail.&lt;br /&gt;
It starts with the set of supported resources, the ResourceIds that identify resources, and configurations that describe the set of active or requested resources.&lt;br /&gt;
Last comes a description of the update process that involves the actual activation and deactivation of resources.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
The drawing framework has been desinged for four types of resources:&lt;br /&gt;
&lt;br /&gt;
* Panes&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
&lt;br /&gt;
* Tool Bars&lt;br /&gt;
&lt;br /&gt;
* Command groups&lt;br /&gt;
&lt;br /&gt;
While the first three need little explanation (the little explanation is done in the API documentation) the concept of [[Drawing Framework Glossary#Command Groups|command groups]] is not used (yet) anywhere else.  A command group is a collection of commands realized by a module that implements at least the com::sun::star::frame::XDispatch interface and implements one or more commands (that to some are known as slots).&lt;br /&gt;
&lt;br /&gt;
A resource is identified by a non-empty set of URLs that describe the actual resource and its dependency on other resources.  One URL is called the resource URL and defines the type of the resource.  A possibly empty set of anchor URLs specifies a set of resources to which the one in question is anchored.  Panes for example act as containers for views and thus are their anchors: the resource URL of the left slide sorter in the left pane is &amp;lt;pre&amp;gt;private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;.  Its anchor is the left pane with the URL being &amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane&amp;lt;/pre&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here, the first part after private:resource/ specifies the type of resource:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;pane&amp;#039;&amp;#039;&amp;#039; for panes&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;view&amp;#039;&amp;#039;&amp;#039; for views&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;toolbar&amp;#039;&amp;#039;&amp;#039; for tool bars&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;#039; for command groups&lt;br /&gt;
The final part of the URL defines the actual resource.&lt;br /&gt;
&lt;br /&gt;
===ResourceId===&lt;br /&gt;
Each resource is identified by an object that implements the&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/ResourceId.html com::sun::star::drawing::framework::ResourceId] service with its [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XResourceId.html com::sun::star::drawing::framework::XResourceId] interface.  The XResourceId interface gives access to a set of URLs which specify the resource.  There is one URL returned by the getResourceURL() function that defines the type of the resource.  A possibly empty set of URLs returned by getAnchorURLs() specifies the anchor resource.&lt;br /&gt;
&lt;br /&gt;
Each resource in a configuration has to have a unique resource id.  Two resource ids may have the same resource URLs but then their anchors must not be the same.  An example for this would be the slide sorter being shown in two different panes.  Alternatively two resource may have the same anchor but then must not have the same resource URL.  An example for this is the view tab bar and the view in the center pane.  The anchor of both is the center pane.&lt;br /&gt;
&lt;br /&gt;
Lets take the slide sorter as an example for this.  In the left pane, the slide sorter bar is described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
The slide sorter view in the center pane id described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Panes are the typical anchor resources.  They do not have an anchor, therefore getAnchorURLs() returns an empty list for them.  An example for an anchor that is not a pane is the view tab bar.  It is linked to the center pane.  It is the anchor for its tabs that each represent one view that may by displayed in the center pane.  The resource ids of the two left most tabs are for example&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/ImpressView&lt;br /&gt;
private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/OutlineView&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ResourceId service provides four functions for creating ResourceId objects.  These are createEmpty() and create() for creating an empty resource id and one that has no anchor.  The createWithAnchor() variant creates a resource whose anchor is given as ResourceId object.  When the later is empty then the resulting resource could have been created with create().  Finally createWithAnchorURL takes two URLs, one for the actual resource and one for its anchor.  These four variants cover the most common usages but it may be extended in the future (note drawing framework API is not yet marked as published and may be modified.)&lt;br /&gt;
&lt;br /&gt;
===Known Resources===&lt;br /&gt;
A list of known resources can be found [[Drawing Framework Resources|here]].&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
&lt;br /&gt;
A [[Drawing Framework Glossary#Configuration|configuration]] describes a set&lt;br /&gt;
of resources.  There are two important configurations, which ideally are&lt;br /&gt;
identical:&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Current Configuration|current configuration]] describes the set of currently active resources. The term &amp;#039;&amp;#039;active&amp;#039;&amp;#039; can mean different things for different types of resources.  For panes, views, and tool bars it means that they are visible. For a command group it means that that group is ready to process incoming slot calls.&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Requested Configuration|requested configuration]] describes the set of  resources that have been requested to be active either directly by the user or by the application in response to some user input.&lt;br /&gt;
&lt;br /&gt;
Usually the two configurations differ only temporarily after a&lt;br /&gt;
new request for the activation or deactivation of a resource has been made&lt;br /&gt;
but not yet been processed.  Eventually the current configuration is updated to&lt;br /&gt;
reflect the requested configuration.  There may, however, be circumstances,&lt;br /&gt;
that do not allow a resource to be activated or (less likely) to be deactivated.&lt;br /&gt;
One reason for this is that some resources are created asynchronously and&lt;br /&gt;
become available only after a little time.&lt;br /&gt;
&lt;br /&gt;
See the  [[Drawing Framework Glossary#Configuration|configuration]] glossary&lt;br /&gt;
entry for examples.&lt;br /&gt;
&lt;br /&gt;
It is possible obtain a copy of the requested configuration and restore it&lt;br /&gt;
later.  This allows to undo temporary changes.  For example, the in-place&lt;br /&gt;
slide show uses this feature to temporarily hide the side panes and to&lt;br /&gt;
restore them when the show ends.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Three layer design===&lt;br /&gt;
&lt;br /&gt;
The drawing framework consists of controllers, factories, and application&lt;br /&gt;
logic modules.  These  are located on three layers.  The assignment to the&lt;br /&gt;
different layers depends on the knowledge about different aspects of the&lt;br /&gt;
resource management:&lt;br /&gt;
&lt;br /&gt;
;Application Layer:The [[Drawing Framework Glossary#Application Layer|application layer]] controls &amp;#039;&amp;#039;&amp;#039;when&amp;#039;&amp;#039;&amp;#039; to activate or deactivate a resource.  This layer contains the application logic.  For example the Impress application uses a module that is responsible for activating or deactivating the slide sorter bar depending on the view that is displayed in the center pane.&lt;br /&gt;
&lt;br /&gt;
;Synchronization Layer:The [[Drawing Framework Glossary#Synchronization Layer|synchronization layer]] uses the XConfigurationController to &amp;#039;&amp;#039;&amp;#039;synchronize&amp;#039;&amp;#039;&amp;#039; the requests from the application layer with the resource controllers in the resource layer. It has no detailed knowledge about individual resources nor about the application logic.&lt;br /&gt;
&lt;br /&gt;
;Resource Layer:The resource factories in the [[Drawing Framework Glossary#Resource Layer|resource layer]] know &amp;#039;&amp;#039;&amp;#039;how&amp;#039;&amp;#039;&amp;#039; to activate or deactivate resources.  The XResourceControllers are called by the XConfigurationController to update the the current configuration so that it looks like the requested configuration.&lt;br /&gt;
&lt;br /&gt;
[[image:DrawingFrameworkDesign.png|The different parts of the drawing framework are organized in three layers]]&lt;br /&gt;
&lt;br /&gt;
The image illustrates the three layer design for the Impress application.  The ImpressModule is created by the ImpressViewShell when the user creates a new Impress document.  The ImpressModule creates the other modules in the application layer that control different aspect of the application.  For example they watch for user input and switch to different views in ther center pane accordingly.&lt;br /&gt;
&lt;br /&gt;
The modules in the application layer communicate with the XConfgurationController in the synchronization layer to make requests for the activation or deactivation of panes and views.  The XConfigurationController modifies the RequestedConfiguration accordingly. &lt;br /&gt;
&lt;br /&gt;
Eventually the CurrentConfiguration is updated.  The XConfigurationController then determines the order in which to activate and deactivate resources and calls the resource factories in that order to create resources that are activated or to release resources that are deactivated.&lt;br /&gt;
&lt;br /&gt;
Resource factories can implement a cache to store deactivated resources.  Some resources like the slide sorter bar are activated and deactivated frequently.  Caching it may speed this up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Two phase updates===&lt;br /&gt;
&lt;br /&gt;
The drawing framework negotiates between modules implementing application&lt;br /&gt;
logic that want to show or hide a resource on one side and the resource&lt;br /&gt;
factories on the other side.  The negotiation process is iterative: the&lt;br /&gt;
activation request of a resource made by one application logic module may&lt;br /&gt;
cause the activation request of another resource made by a second module.&lt;br /&gt;
For example, when the user switches the view in the center pane to the&lt;br /&gt;
outline view, then the task pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
The negation process is split into two phases, one&lt;br /&gt;
for collecting a list of all the necessary changes and the second for&lt;br /&gt;
updating the GUI to reflect these changes.&lt;br /&gt;
&lt;br /&gt;
;Negotiation Phase: The negotiation phase is triggered by the initial request, for example the switch of the view in the center pane.  In this phase only the requested configuration is modified.  The requested change is stored in the requested configuration and then is broadcasted.  Listeners may react by making further requests for activation or deactivation of other resources.  These are again stored in the requested configuration and broadcasted and may lead to even more requests.  All requests are put into a queue which is processed until there are no more pending requests.&lt;br /&gt;
&lt;br /&gt;
;Update Phase:When all requests have been processed and the requested configuration describes a new consistent state of the GUI then the second, the &amp;#039;&amp;#039;&amp;#039;update phase&amp;#039;&amp;#039;&amp;#039; is started.  In this phase only the current configuration is modified.&lt;br /&gt;
:That is, the requested configuration is not modified directly in this phase.  The application can of course request the activation or deactivation of resources.  Therefore, in the update phase a copy of the requested configuration is used which remains unchanged during the update.&lt;br /&gt;
:The different resource factories are asked to create or relase resources so that eventually the current configuration looks like the requested configuration.  Every activation and deactivation is broadcasted like the requests for the activations and deactivations were.&lt;br /&gt;
&lt;br /&gt;
It is the task of the configuration controller to order the activations and deactivations according to dependencies between affected resources and to optimize the update&lt;br /&gt;
phase with respect to time and visual artifacts/flickering.&lt;br /&gt;
&lt;br /&gt;
==Extensibility==&lt;br /&gt;
The drawing framework is designed to be extensible with regard to the set of known resources and to the application logic.&lt;br /&gt;
&lt;br /&gt;
For a new resource you have to provide a factory and register it at the configuration manager.  An example could be a new view or a new tool bar.&lt;br /&gt;
&lt;br /&gt;
For a new piece of application logic add a listener to the configuration controller and react to activations or deactivations of relevant resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation and Examples==&lt;br /&gt;
The examples in the following sections show how to use the drawing framework to request and access resources and how to react to changes of the current configuration.  Note that the code is C++ like pseudo code that can not be compiled as is.&lt;br /&gt;
&lt;br /&gt;
===FrameworkHelper===&lt;br /&gt;
The ::sd::framework::FrameworkHelper class provides two things&lt;br /&gt;
* the most frequently used resource URLs so that you do not have to remember them, have trouble with resource allocation, or be able to misspell resource names, and&lt;br /&gt;
* some helper functions that simplify the work with the UNO based drawing framework from inside core code.&lt;br /&gt;
The FrameworkHelper is a multi singleton.  Its Instance() method returns for a ViewShellBase object the associated FrameworkHelper object.  The functions provided cover&lt;br /&gt;
* mapping between sd::ViewShell::ShellType and view resource URL,&lt;br /&gt;
* obtain view objects for their URLs or ResourceIds,&lt;br /&gt;
* making requests for the activation or deactivation of resources,&lt;br /&gt;
* locking configuration updates,&lt;br /&gt;
* waiting for certain events to make asynchronous requests synchronous.&lt;br /&gt;
&lt;br /&gt;
One example for that is a request for the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FrameworkHelper::Instance(GetViewShellBase()).RequestView(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Drawing Framework API===&lt;br /&gt;
The following subsections provide a short introduction of the UNO API of the drawing framework.  For details please refer to the API documentation (not yet available.)&lt;br /&gt;
&lt;br /&gt;
====Getting Access to the Drawing Framework====&lt;br /&gt;
Using the UNO API of the drawing framework to access active resources or to request the activation or deactivation of resources starts with the [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XController.html XController] of an [[Impress]] or a [[Draw]] document.  From this you can obtain the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XControllerManager.html XControllerManager] and from that the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XConfigurationController.html XConfigurationController].  The XConfigurationController is the main access point for making requests and for accessing resources. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
using ::com::sun::star::uno;&lt;br /&gt;
using ::com::sun::star::frame;&lt;br /&gt;
using ::com::sun::star::drawing::framework;&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XController&amp;gt; xController;              // This is regarded as given.&lt;br /&gt;
Reference&amp;lt;XComponentContext&amp;gt; xComponentContext;  // This also is regarded as given.&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Requesting a Resource Activation====&lt;br /&gt;
Once you have obtained access to the XConfigurationController, making requests to activate or deactivate resources is simple.  The following code requests the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you compare this to the code bove that uses the FrameworkHelper to accomplish&lt;br /&gt;
the same thing then you see, that the FrameworkHelper only hides the&lt;br /&gt;
connection from the ViewShellBase to the XConfigurationController.  The rest&lt;br /&gt;
of the call is basically the same.&lt;br /&gt;
&lt;br /&gt;
However, the drawing framework does not provide too many automatisms on this&lt;br /&gt;
layer (that is the task of the modules in the application layer) so the pane&lt;br /&gt;
in which to show the slide sorter has to be requested as well.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the use of ResourceId::create() instead of ResourceId::createWithAnchorURL(). This is because a pane, in contrast to the view that was requested earlier, is not bound to any other resource.&lt;br /&gt;
&lt;br /&gt;
The two requests should be executed together.  An intermediate update of the&lt;br /&gt;
current configuration is not necessary and would lead to an annoying display&lt;br /&gt;
of an empty window before the slide sorter bar is properly shown.  The&lt;br /&gt;
probability that this happens is low but not zero.  Therefore it is good&lt;br /&gt;
practice to lock the XConfigurationController while the two requests are&lt;br /&gt;
made.  This prevents unwanted updates.  You can call the lock() and unlock()&lt;br /&gt;
methods directly but it is safer to use the ConfigurationController::Lock&lt;br /&gt;
inner class to do that.  Adding this and bringing the two requests into the&lt;br /&gt;
logical order you get&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    ::sd::framework::ConfigurationController::Lock(xCC);&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::create(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::createWithAnchorURL(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Accessing a Resource====&lt;br /&gt;
If you want to access an active resource directly then you have to ask the&lt;br /&gt;
XConfigurationController for it.  Suppose you are interested in accessing the window of the left&lt;br /&gt;
pane that shows the slide sorter bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL),&lt;br /&gt;
    UNO_QUERY);&lt;br /&gt;
if (xPane.is())&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
    if (xWindow-&amp;gt;is())&lt;br /&gt;
    {&lt;br /&gt;
        // Do something with the window.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reacting to Modifications of the Configuration====&lt;br /&gt;
When you want to implement application logic then you have to react to user input by requesting changes to the current configuration.  User input can come in many ways.  Here we cover only the indirect way of (requested) changes of the current configuration made by others.&lt;br /&gt;
&lt;br /&gt;
The following code turns on the slide sorter bar when the center pane is switched to&lt;br /&gt;
the edit view, outline view, or notes view and turns it off for all other views.  The drawing framework contains a module in the application layer that does essentially the same.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SlideSorterBarManager : public XConfigurationChangeListener {&lt;br /&gt;
public:&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; mxCC;&lt;br /&gt;
&lt;br /&gt;
void SlideSorterBarManager (const Reference&amp;lt;XConfigurationController&amp;gt;&amp;amp; rxCC)&lt;br /&gt;
    : mxCC(rxCC)&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XConfigurationControllerBroadcaster&amp;gt; xCCB (mxCC, UNO_QUERY);&lt;br /&gt;
    xCCB-&amp;gt;addConfigurationChangeListener(&lt;br /&gt;
        this,&lt;br /&gt;
        FramworkHelper::msResourceActivationRequestEvent,&lt;br /&gt;
        Any());&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
virtual void notifyConfigurationChange (const ConfigurationChangeEvent&amp;amp; rEvent)&lt;br /&gt;
{&lt;br /&gt;
    if (rEvent.Type.equals(FrameworkHelper::msResourceActivationRequestEvent))&lt;br /&gt;
    {&lt;br /&gt;
        if (rEvent.ResourceId.is())&lt;br /&gt;
         &amp;amp;&amp;amp; rEvent.ResourceId-&amp;gt;isBoundToURL(FrameworkHelper::msCenterPaneURL,DIRECT))&lt;br /&gt;
        {&lt;br /&gt;
            // A resource has been requested for the center pane.&lt;br /&gt;
            ::rtl::OUString sResourceURL (rEvent.ResourceId-&amp;gt;getResourceURL());&lt;br /&gt;
            if (sResourceURL.equals(FrameworkHelper::msImpressViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msOutlineViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msNotesViewURL))&lt;br /&gt;
            {&lt;br /&gt;
                // Show the slide sorter bar.&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::create(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Hide the slide sorter bar for the handout view, the slide&lt;br /&gt;
                // sorter view, and all views that where not handled above.&lt;br /&gt;
                mxCC-&amp;gt;requestResourceDeactivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There are three things to note in this code:&lt;br /&gt;
# The first &amp;#039;&amp;#039;&amp;#039;if&amp;#039;&amp;#039;&amp;#039; statement in the notifyConfigurationChange() method is not really necessary because the listener is registered only for this one event type and thus will not be called for other event types.&lt;br /&gt;
# There is no update lock surrounding the activation requests for the slide sorter bar.  This is not necessary   here, because the listener is only called during the negotiation phase.  During this whole phase the update is locked.&lt;br /&gt;
# There is only one deactivation request, the one for the view.  The request for the pane is missing.  This is because there might be other resources bound to the pane.  However, this is one of a few places where an automatism is active: when there are no resources bound to a pane when the negotiation phase ends, then the pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Providing a New Resource====&lt;br /&gt;
To provide a new resource, say a SingleColorView that fills a window with a&lt;br /&gt;
single color, you have to&lt;br /&gt;
*Provide the actual view&lt;br /&gt;
*Provide a factory that creates a view object for a given XPane object&lt;br /&gt;
*Register the factory&lt;br /&gt;
*Request the new view&lt;br /&gt;
&lt;br /&gt;
A view has to support the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XView.html css::drawing::framework::XView] interface which is&lt;br /&gt;
derived from the XResource interface.  Both interfaces are extremely simple&lt;br /&gt;
because the drawing framework does not need to know much about its&lt;br /&gt;
resources.&lt;br /&gt;
&lt;br /&gt;
The knowledge is concentrated only in the factory and of course in the&lt;br /&gt;
implementation of the new view.  Both a new resource and its factory are&lt;br /&gt;
typically deployed together so they can use private and implementation&lt;br /&gt;
language dependent means to communicate with each other and share information.&lt;br /&gt;
&lt;br /&gt;
The factory is given a ResourceId when asked for a new resource object.  For&lt;br /&gt;
the SingleColorView the ResourceId is used to look up the corresponding&lt;br /&gt;
XPane object from which the XWindow reference is obtained.  For the standard&lt;br /&gt;
panes the XPane object supports the XUnoTunnel interface which gives access&lt;br /&gt;
to the VCL Window pointer, but that is not used here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SingleColorViewFactory : XResourceFactory&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    virtual Reference&amp;lt;XView&amp;gt; createResource (&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        Reference&amp;lt;XResource&amp;gt; xView;&lt;br /&gt;
&lt;br /&gt;
        // Get the XWindow object fort the AnchorURL of the given ResourceId.&lt;br /&gt;
        Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
        Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
        Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(rxViewId-&amp;gt;getAnchor()), UNO_QUERY);&lt;br /&gt;
        if (xPane.is())&lt;br /&gt;
        {&lt;br /&gt;
            // Create the view for the XWindow object.&lt;br /&gt;
            Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
            if (xWindow.is())&lt;br /&gt;
                xView = new SingleColorView(rxViewId, xWindow);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return xView;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void releaseView (&lt;br /&gt;
        const Reference&amp;lt;XResource&amp;gt;&amp;amp; rxView)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing.  When the caller releases its reference to the view,&lt;br /&gt;
        // then the view will be destroyed.&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SingleColorView : drawing::framework::XView, awt::XPaintListener&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    SingleColorView(&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId,&lt;br /&gt;
        const Reference&amp;lt;XWindow&amp;gt;&amp;amp; rxWindow)&lt;br /&gt;
        : mxViewId(rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        rxWindow-&amp;gt;addPaintListener(this);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual ResourceId getResourceId (void)&lt;br /&gt;
    {&lt;br /&gt;
        return maId;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void windowPaint (const awt::PaintEvent&amp;amp; rEvent)&lt;br /&gt;
    {&lt;br /&gt;
        // Paint the area specified by the event.&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
    Reference&amp;lt;XResourceId&amp;gt; mxViewId;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The factory can be registered in two ways.&lt;br /&gt;
#Dynamically by calling XViewController::addViewFactory()&lt;br /&gt;
#Statically by adding an entry to the configuration.&lt;br /&gt;
&lt;br /&gt;
For the latter you have to provide a UNO service for the view factory, say com.sun.star.drawing.framework.SingleColorViewFactory.  With&lt;br /&gt;
this, merge the following entry into the Impress.xcu file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MultiPaneGUI&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;Framework&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;ResourceFactories&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;F0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ServiceName&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;com.sun.star.drawing.framework.SingleColorViewFactory&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;ResourceList&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;R0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;private:resource/view/SingleColorView&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
All what remains to be done is to request the view.  To show it in the right&lt;br /&gt;
pane, instead of the task panel, make this call:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        ::rtl::OUString::createFromAscii(&amp;quot;private:resource/view/SingleColorView&amp;quot;),&lt;br /&gt;
        FameworkHelper::msRightPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Impress]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117013</id>
		<title>Drawing framework</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117013"/>
		<updated>2009-03-24T06:07:01Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Two phase updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The drawing framework is a framework used by [[Impress]] and [[Draw]] for the coordinated activation and deactivation of resources like views, panes, and tool bars.&lt;br /&gt;
&lt;br /&gt;
The primary goal in designing the drawing framework was to turn Impress and Draw into modular applications that can easily be extended by additional features.&lt;br /&gt;
This should be possible dynamically through extensions, not only statically at compile time.  The drawing framework is accessible to extensions that are deployed via the extension manager (menu entry Tools-&amp;gt;ExtensionManager...).  This allows an extension to provide for instance a new view and to control when to show this view and in which pane to display it.  This can be done in any programming language for which there is UNO API support.  The [Presenter Screen|Presenter Screen extension] is one example for this.&lt;br /&gt;
&lt;br /&gt;
The design of the drawing framework addresses the following goals:&lt;br /&gt;
&lt;br /&gt;
*ease of use&lt;br /&gt;
&lt;br /&gt;
*flexibility&lt;br /&gt;
&lt;br /&gt;
*extensibility&lt;br /&gt;
&lt;br /&gt;
*abstraction from underlying frameworks&lt;br /&gt;
&lt;br /&gt;
The drawing framework can be seen as a resource management system, where the resources are panes, views, tool bars, commands (slots).  The configuration controller synchronizes activation and deactivation of resources.  It has its name from the configuration, which describes the set of active resources, i.e. the set of visible panes, views, and tool bars.  Synchronization means that when two or more resources are to be activated or deactivated at the same time then the configuration controller&lt;br /&gt;
*orders activations and deactivations according to dependencies between resources (e.g. when a viewand a pane are to be activated then the pane is activated before the view so that the view has access to the pane),&lt;br /&gt;
*tries to minimize the overall time and&lt;br /&gt;
*reduces visual artifacts, i.e. flickering.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is implemented on top of and abstracts from existing framework functionality provides mostly by the SFX2 and [[Framework]] projects.&lt;br /&gt;
&lt;br /&gt;
There is a [[Drawing Framework Glossary|glossary]] for the drawing framework.  The API of the drawing framework is documented [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/module-ix.html here].&lt;br /&gt;
&lt;br /&gt;
==Current State==&lt;br /&gt;
With the experience from the implementation of the [[Presenter_Screen|Presenter Screen extension]] the first incarnation of the drawing framework (that is described by older versions of this page, see history for [http://wiki.services.openoffice.org/w/index.php?title=Drawing_framework&amp;amp;oldid=45696 this] or older versions) has been cleaned up and simplified into its current form.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is used by [[Impress]] and [[Draw]] for managing views, panes, and one or two toolbars.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Framework Design==&lt;br /&gt;
&lt;br /&gt;
The following sections describe the inner structure of the drawing framework in more detail.&lt;br /&gt;
It starts with the set of supported resources, the ResourceIds that identify resources, and configurations that describe the set of active or requested resources.&lt;br /&gt;
Last comes a description of the update process that involves the actual activation and deactivation of resources.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
The drawing framework has been desinged for four types of resources:&lt;br /&gt;
&lt;br /&gt;
* Panes&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
&lt;br /&gt;
* Tool Bars&lt;br /&gt;
&lt;br /&gt;
* Command groups&lt;br /&gt;
&lt;br /&gt;
While the first three need little explanation (the little explanation is done in the API documentation) the concept of [[Drawing Framework Glossary#Command Groups|command groups]] is not used (yet) anywhere else.  A command group is a collection of commands realized by a module that implements at least the com::sun::star::frame::XDispatch interface and implements one or more commands (that to some are known as slots).&lt;br /&gt;
&lt;br /&gt;
A resource is identified by a non-empty set of URLs that describe the actual resource and its dependency on other resources.  One URL is called the resource URL and defines the type of the resource.  A possibly empty set of anchor URLs specifies a set of resources to which the one in question is anchored.  Panes for example act as containers for views and thus are their anchors: the resource URL of the left slide sorter in the left pane is &amp;lt;pre&amp;gt;private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;.  Its anchor is the left pane with the URL being &amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane&amp;lt;/pre&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here, the first part after private:resource/ specifies the type of resource:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;pane&amp;#039;&amp;#039;&amp;#039; for panes&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;view&amp;#039;&amp;#039;&amp;#039; for views&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;toolbar&amp;#039;&amp;#039;&amp;#039; for tool bars&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;#039; for command groups&lt;br /&gt;
The final part of the URL defines the actual resource.&lt;br /&gt;
&lt;br /&gt;
===ResourceId===&lt;br /&gt;
Each resource is identified by an object that implements the&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/ResourceId.html com::sun::star::drawing::framework::ResourceId] service with its [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XResourceId.html com::sun::star::drawing::framework::XResourceId] interface.  The XResourceId interface gives access to a set of URLs which specify the resource.  There is one URL returned by the getResourceURL() function that defines the type of the resource.  A possibly empty set of URLs returned by getAnchorURLs() specifies the anchor resource.&lt;br /&gt;
&lt;br /&gt;
Each resource in a configuration has to have a unique resource id.  Two resource ids may have the same resource URLs but then their anchors must not be the same.  An example for this would be the slide sorter being shown in two different panes.  Alternatively two resource may have the same anchor but then must not have the same resource URL.  An example for this is the view tab bar and the view in the center pane.  The anchor of both is the center pane.&lt;br /&gt;
&lt;br /&gt;
Lets take the slide sorter as an example for this.  In the left pane, the slide sorter bar is described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
The slide sorter view in the center pane id described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Panes are the typical anchor resources.  They do not have an anchor, therefore getAnchorURLs() returns an empty list for them.  An example for an anchor that is not a pane is the view tab bar.  It is linked to the center pane.  It is the anchor for its tabs that each represent one view that may by displayed in the center pane.  The resource ids of the two left most tabs are for example&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/ImpressView&lt;br /&gt;
private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/OutlineView&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ResourceId service provides four functions for creating ResourceId objects.  These are createEmpty() and create() for creating an empty resource id and one that has no anchor.  The createWithAnchor() variant creates a resource whose anchor is given as ResourceId object.  When the later is empty then the resulting resource could have been created with create().  Finally createWithAnchorURL takes two URLs, one for the actual resource and one for its anchor.  These four variants cover the most common usages but it may be extended in the future (note drawing framework API is not yet marked as published and may be modified.)&lt;br /&gt;
&lt;br /&gt;
===Known Resources===&lt;br /&gt;
A list of known resources can be found [[Drawing Framework Resources|here]].&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
&lt;br /&gt;
A [[Drawing Framework Glossary#Configuration|configuration]] describes a set&lt;br /&gt;
of resources.  There are two important configurations, which ideally are&lt;br /&gt;
identical:&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Current Configuration|current configuration]] describes the set of currently active resources. The term &amp;#039;&amp;#039;active&amp;#039;&amp;#039; can mean different things for different types of resources.  For panes, views, and tool bars it means that they are visible. For a command group it means that that group is ready to process incoming slot calls.&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Requested Configuration|requested configuration]] describes the set of  resources that have been requested to be active either directly by the user or by the application in response to some user input.&lt;br /&gt;
&lt;br /&gt;
Usually the two configurations differ only temporarily after a&lt;br /&gt;
new request for the activation or deactivation of a resource has been made&lt;br /&gt;
but not yet been processed.  Eventually the current configuration is updated to&lt;br /&gt;
reflect the requested configuration.  There may, however, be circumstances,&lt;br /&gt;
that do not allow a resource to be activated or (less likely) to be deactivated.&lt;br /&gt;
One reason for this is that some resources are created asynchronously and&lt;br /&gt;
become available only after a little time.&lt;br /&gt;
&lt;br /&gt;
See the  [[Drawing Framework Glossary#Configuration|configuration]] glossary&lt;br /&gt;
entry for examples.&lt;br /&gt;
&lt;br /&gt;
It is possible obtain a copy of the requested configuration and restore it&lt;br /&gt;
later.  This allows to undo temporary changes.  For example, the in-place&lt;br /&gt;
slide show uses this feature to temporarily hide the side panes and to&lt;br /&gt;
restore them when the show ends.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Three layer design===&lt;br /&gt;
&lt;br /&gt;
The drawing framework consists of controllers, factories, and application&lt;br /&gt;
logic modules.  These  are located on three layers.  The assignment to the&lt;br /&gt;
different layers depends on the knowledge about different aspects of the&lt;br /&gt;
resource management:&lt;br /&gt;
&lt;br /&gt;
;Application Layer:The [[Drawing Framework Glossary#Application Layer|application layer]] controls &amp;#039;&amp;#039;&amp;#039;when&amp;#039;&amp;#039;&amp;#039; to activate or deactivate a resource.  This layer contains the application logic.  For example the Impress application uses a module that is responsible for activating or deactivating the slide sorter bar depending on the view that is displayed in the center pane.&lt;br /&gt;
&lt;br /&gt;
;Synchronization Layer:The [[Drawing Framework Glossary#Synchronization Layer|synchronization layer]] uses the XConfigurationController to &amp;#039;&amp;#039;&amp;#039;synchronize&amp;#039;&amp;#039;&amp;#039; the requests from the application layer with the resource controllers in the resource layer. It has no detailed knowledge about individual resources nor about the application logic.&lt;br /&gt;
&lt;br /&gt;
;Resource Layer:The resource factories in the [[Drawing Framework Glossary#Resource Layer|resource layer]] know &amp;#039;&amp;#039;&amp;#039;how&amp;#039;&amp;#039;&amp;#039; to activate or deactivate resources.  The XResourceControllers are called by the XConfigurationController to update the the current configuration so that it looks like the requested configuration.&lt;br /&gt;
&lt;br /&gt;
[[image:DrawingFrameworkDesign.png|The different parts of the drawing framework are organized in three layers]]&lt;br /&gt;
&lt;br /&gt;
The image illustrates the three layer design for the Impress application.  The ImpressModule is created by the ImpressViewShell when the user creates a new Impress document.  The ImpressModule creates the other modules in the application layer that control different aspect of the application.  For example they watch for user input and switch to different views in ther center pane accordingly.&lt;br /&gt;
&lt;br /&gt;
The modules in the application layer communicate with the XConfgurationController in the synchronization layer to make requests for the activation or deactivation of panes and views.  The XConfigurationController modifies the RequestedConfiguration accordingly. &lt;br /&gt;
&lt;br /&gt;
Eventually the CurrentConfiguration is updated.  The XConfigurationController then determines the order in which to activate and deactivate resources and calls the resource factories in that order to create resources that are activated or to release resources that are deactivated.&lt;br /&gt;
&lt;br /&gt;
Resource factories can implement a cache to store deactivated resources.  Some resources like the slide sorter bar are activated and deactivated frequently.  Caching it may speed this up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Two phase updates===&lt;br /&gt;
&lt;br /&gt;
The drawing framework negotiates between modules implementing application&lt;br /&gt;
logic that want to show or hide a resource on one side and the resource&lt;br /&gt;
factories on the other side.  The negotiation process is iterative: the&lt;br /&gt;
activation request of a resource made by one application logic module may&lt;br /&gt;
cause the activation request of another resource made by a second module.&lt;br /&gt;
For example, when the user switches the view in the center pane to the&lt;br /&gt;
outline view, then the task pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
The negation process is split into two phases, one&lt;br /&gt;
for collecting a list of all the necessary changes and the second for&lt;br /&gt;
updating the GUI to reflect these changes.&lt;br /&gt;
&lt;br /&gt;
;Negotiation Phase: The negotiation phase is triggered by the initial request, for example the switch of the view in the center pane.  In this phase only the requested configuration is modified.  The requested change is stored in the requested configuration and then is broadcasted.  Listeners may react by making further requests for activation or deactivation of other resources.  These are again stored in the requested configuration and broadcasted and may lead to even more requests.  All requests are put into a queue which is processed until there are no more pending requests.&lt;br /&gt;
&lt;br /&gt;
;Update Phase:When all requests have been processed and the requested configuration describes a new consistent state of the GUI then the second, the &amp;#039;&amp;#039;&amp;#039;update phase&amp;#039;&amp;#039;&amp;#039; is started.  In this phase only the current configuration is modified.&lt;br /&gt;
:That is, the requested configuration is not modified directly in this phase.  The application can of course request the activation or deactivation of resources.  Therefore, in the update phase a copy of the requested configuration is used which remains unchanged during the update.&lt;br /&gt;
:The different resource factories are asked to create or relase resources so that eventually the current configuration looks like the requested configuration.  Every activation and deactivation is broadcasted like the requests for the activations and deactivations were.&lt;br /&gt;
&lt;br /&gt;
It is the task of the configuration controller to order the activations and deactivations according to dependencies between affected resources and to optimize the update&lt;br /&gt;
phase with respect to time and visual artifacts/flickering.&lt;br /&gt;
&lt;br /&gt;
==Extensibility==&lt;br /&gt;
The drawing framework is designed to be extensible with regard to the set of known resources and to the application logic.&lt;br /&gt;
&lt;br /&gt;
For a new resource you have to provide a factory and register it at the configuration manager.  An example could be a new view or a new tool bar.&lt;br /&gt;
&lt;br /&gt;
For a new piece of application logic add a listener to the configuration controller and react to activations or deactivations of relevant resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation and Examples==&lt;br /&gt;
The examples in the following sections show how to use the drawing framework to request and access resources and how to react to changes of the current configuration.  Note that the code is C++ like pseudo code that can not be compiled as is.&lt;br /&gt;
&lt;br /&gt;
===FrameworkHelper===&lt;br /&gt;
The ::sd::framework::FrameworkHelper class provides two things&lt;br /&gt;
* the most frequently used resource URLs so that you do not have to remember them, have trouble with resource allocation, or are able to misspell resource names, and&lt;br /&gt;
* some helper functions that simplify the work with the UNO based drawing framework from inside core code.&lt;br /&gt;
The FrameworkHelper is a multi singleton.  Its Instance() method returns for a ViewShellBase object the associated FrameworkHelper object.  The functions provided cover&lt;br /&gt;
* mapping between sd::ViewShell::ShellType and view resource URL,&lt;br /&gt;
* obtain view objects for their URLs or ResourceIds,&lt;br /&gt;
* making requests for the activation or deactivation of resources,&lt;br /&gt;
* locking configuration updates,&lt;br /&gt;
* waiting for certain events to make asynchronous requests synchronous.&lt;br /&gt;
&lt;br /&gt;
One example for that is a request for the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FrameworkHelper::Instance(GetViewShellBase()).RequestView(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Drawing Framework API===&lt;br /&gt;
The following subsections provide a short introduction of the UNO API of the drawing framework.  For details please refer to the API documentation (not yet available.)&lt;br /&gt;
&lt;br /&gt;
====Getting Access to the Drawing Framework====&lt;br /&gt;
Using the UNO API of the drawing framework to access active resources or to request the activation or deactivation of resources starts with the [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XController.html XController] of an [[Impress]] or a [[Draw]] document.  From this you can obtain the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XControllerManager.html XControllerManager] and from that the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XConfigurationController.html XConfigurationController].  The XConfigurationController is the main access point for making requests and for accessing resources. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
using ::com::sun::star::uno;&lt;br /&gt;
using ::com::sun::star::frame;&lt;br /&gt;
using ::com::sun::star::drawing::framework;&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XController&amp;gt; xController;              // This is regarded as given.&lt;br /&gt;
Reference&amp;lt;XComponentContext&amp;gt; xComponentContext;  // This also is regarded as given.&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Requesting a Resource Activation====&lt;br /&gt;
Once you have obtained access to the XConfigurationController, making requests to activate or deactivate resources is simple.  The following code requests the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you compare this to the code bove that uses the FrameworkHelper to accomplish&lt;br /&gt;
the same thing then you see, that the FrameworkHelper only hides the&lt;br /&gt;
connection from the ViewShellBase to the XConfigurationController.  The rest&lt;br /&gt;
of the call is basically the same.&lt;br /&gt;
&lt;br /&gt;
However, the drawing framework does not provide too many automatisms on this&lt;br /&gt;
layer (that is the task of the modules in the application layer) so the pane&lt;br /&gt;
in which to show the slide sorter has to be requested as well.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the use of ResourceId::create() instead of ResourceId::createWithAnchorURL(). This is because a pane, in contrast to the view that was requested earlier, is not bound to any other resource.&lt;br /&gt;
&lt;br /&gt;
The two requests should be executed together.  An intermediate update of the&lt;br /&gt;
current configuration is not necessary and would lead to an annoying display&lt;br /&gt;
of an empty window before the slide sorter bar is properly shown.  The&lt;br /&gt;
probability that this happens is low but not zero.  Therefore it is good&lt;br /&gt;
practice to lock the XConfigurationController while the two requests are&lt;br /&gt;
made.  This prevents unwanted updates.  You can call the lock() and unlock()&lt;br /&gt;
methods directly but it is safer to use the ConfigurationController::Lock&lt;br /&gt;
inner class to do that.  Adding this and bringing the two requests into the&lt;br /&gt;
logical order you get&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    ::sd::framework::ConfigurationController::Lock(xCC);&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::create(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::createWithAnchorURL(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Accessing a Resource====&lt;br /&gt;
If you want to access an active resource directly then you have to ask the&lt;br /&gt;
XConfigurationController for it.  Suppose you are interested in accessing the window of the left&lt;br /&gt;
pane that shows the slide sorter bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL),&lt;br /&gt;
    UNO_QUERY);&lt;br /&gt;
if (xPane.is())&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
    if (xWindow-&amp;gt;is())&lt;br /&gt;
    {&lt;br /&gt;
        // Do something with the window.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reacting to Modifications of the Configuration====&lt;br /&gt;
When you want to implement application logic then you have to react to user input by requesting changes to the current configuration.  User input can come in many ways.  Here we cover only the indirect way of (requested) changes of the current configuration made by others.&lt;br /&gt;
&lt;br /&gt;
The following code turns on the slide sorter bar when the center pane is switched to&lt;br /&gt;
the edit view, outline view, or notes view and turns it off for all other views.  The drawing framework contains a module in the application layer that does essentially the same.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SlideSorterBarManager : public XConfigurationChangeListener {&lt;br /&gt;
public:&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; mxCC;&lt;br /&gt;
&lt;br /&gt;
void SlideSorterBarManager (const Reference&amp;lt;XConfigurationController&amp;gt;&amp;amp; rxCC)&lt;br /&gt;
    : mxCC(rxCC)&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XConfigurationControllerBroadcaster&amp;gt; xCCB (mxCC, UNO_QUERY);&lt;br /&gt;
    xCCB-&amp;gt;addConfigurationChangeListener(&lt;br /&gt;
        this,&lt;br /&gt;
        FramworkHelper::msResourceActivationRequestEvent,&lt;br /&gt;
        Any());&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
virtual void notifyConfigurationChange (const ConfigurationChangeEvent&amp;amp; rEvent)&lt;br /&gt;
{&lt;br /&gt;
    if (rEvent.Type.equals(FrameworkHelper::msResourceActivationRequestEvent))&lt;br /&gt;
    {&lt;br /&gt;
        if (rEvent.ResourceId.is())&lt;br /&gt;
         &amp;amp;&amp;amp; rEvent.ResourceId-&amp;gt;isBoundToURL(FrameworkHelper::msCenterPaneURL,DIRECT))&lt;br /&gt;
        {&lt;br /&gt;
            // A resource has been requested for the center pane.&lt;br /&gt;
            ::rtl::OUString sResourceURL (rEvent.ResourceId-&amp;gt;getResourceURL());&lt;br /&gt;
            if (sResourceURL.equals(FrameworkHelper::msImpressViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msOutlineViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msNotesViewURL))&lt;br /&gt;
            {&lt;br /&gt;
                // Show the slide sorter bar.&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::create(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Hide the slide sorter bar for the handout view, the slide&lt;br /&gt;
                // sorter view, and all views that where not handled above.&lt;br /&gt;
                mxCC-&amp;gt;requestResourceDeactivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There are three things to note in this code:&lt;br /&gt;
# The first &amp;#039;&amp;#039;&amp;#039;if&amp;#039;&amp;#039;&amp;#039; statement in the notifyConfigurationChange() method is not really necessary because the listener is registered only for this one event type and thus will not be called for other event types.&lt;br /&gt;
# There is no update lock surrounding the activation requests for the slide sorter bar.  This is not necessary   here, because the listener is only called during the negotiation phase.  During this whole phase the update is locked.&lt;br /&gt;
# There is only one deactivation request, the one for the view.  The request for the pane is missing.  This is because there might be other resources bound to the pane.  However, this is one of a few places where an automatism is active: when there are no resources bound to a pane when the negotiation phase ends, then the pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Providing a New Resource====&lt;br /&gt;
To provide a new resource, say a SingleColorView that fills a window with a&lt;br /&gt;
single color, you have to&lt;br /&gt;
*Provide the actual view&lt;br /&gt;
*Provide a factory that creates a view object for a given XPane object&lt;br /&gt;
*Register the factory&lt;br /&gt;
*Request the new view&lt;br /&gt;
&lt;br /&gt;
A view has to support the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XView.html css::drawing::framework::XView] interface which is&lt;br /&gt;
derived from the XResource interface.  Both interfaces are extremely simple&lt;br /&gt;
because the drawing framework does not need to know much about its&lt;br /&gt;
resources.&lt;br /&gt;
&lt;br /&gt;
The knowledge is concentrated only in the factory and of course in the&lt;br /&gt;
implementation of the new view.  Both a new resource and its factory are&lt;br /&gt;
typically deployed together so they can use private and implementation&lt;br /&gt;
language dependent means to communicate with each other and share information.&lt;br /&gt;
&lt;br /&gt;
The factory is given a ResourceId when asked for a new resource object.  For&lt;br /&gt;
the SingleColorView the ResourceId is used to look up the corresponding&lt;br /&gt;
XPane object from which the XWindow reference is obtained.  For the standard&lt;br /&gt;
panes the XPane object supports the XUnoTunnel interface which gives access&lt;br /&gt;
to the VCL Window pointer, but that is not used here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SingleColorViewFactory : XResourceFactory&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    virtual Reference&amp;lt;XView&amp;gt; createResource (&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        Reference&amp;lt;XResource&amp;gt; xView;&lt;br /&gt;
&lt;br /&gt;
        // Get the XWindow object fort the AnchorURL of the given ResourceId.&lt;br /&gt;
        Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
        Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
        Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(rxViewId-&amp;gt;getAnchor()), UNO_QUERY);&lt;br /&gt;
        if (xPane.is())&lt;br /&gt;
        {&lt;br /&gt;
            // Create the view for the XWindow object.&lt;br /&gt;
            Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
            if (xWindow.is())&lt;br /&gt;
                xView = new SingleColorView(rxViewId, xWindow);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return xView;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void releaseView (&lt;br /&gt;
        const Reference&amp;lt;XResource&amp;gt;&amp;amp; rxView)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing.  When the caller releases its reference to the view,&lt;br /&gt;
        // then the view will be destroyed.&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SingleColorView : drawing::framework::XView, awt::XPaintListener&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    SingleColorView(&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId,&lt;br /&gt;
        const Reference&amp;lt;XWindow&amp;gt;&amp;amp; rxWindow)&lt;br /&gt;
        : mxViewId(rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        rxWindow-&amp;gt;addPaintListener(this);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual ResourceId getResourceId (void)&lt;br /&gt;
    {&lt;br /&gt;
        return maId;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void windowPaint (const awt::PaintEvent&amp;amp; rEvent)&lt;br /&gt;
    {&lt;br /&gt;
        // Paint the area specified by the event.&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
    Reference&amp;lt;XResourceId&amp;gt; mxViewId;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The factory can be registered in two ways.&lt;br /&gt;
#Dynamically by calling XViewController::addViewFactory()&lt;br /&gt;
#Statically by adding an entry to the configuration.&lt;br /&gt;
&lt;br /&gt;
For the latter you have to provide a UNO service for the view factory, say com.sun.star.drawing.framework.SingleColorViewFactory.  With&lt;br /&gt;
this, merge the following entry into the Impress.xcu file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MultiPaneGUI&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;Framework&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;ResourceFactories&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;F0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ServiceName&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;com.sun.star.drawing.framework.SingleColorViewFactory&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;ResourceList&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;R0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;private:resource/view/SingleColorView&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
All what remains to be done is to request the view.  To show it in the right&lt;br /&gt;
pane, instead of the task panel, make this call:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        ::rtl::OUString::createFromAscii(&amp;quot;private:resource/view/SingleColorView&amp;quot;),&lt;br /&gt;
        FameworkHelper::msRightPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Impress]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117012</id>
		<title>Drawing framework</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Drawing_framework&amp;diff=117012"/>
		<updated>2009-03-24T06:05:26Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The drawing framework is a framework used by [[Impress]] and [[Draw]] for the coordinated activation and deactivation of resources like views, panes, and tool bars.&lt;br /&gt;
&lt;br /&gt;
The primary goal in designing the drawing framework was to turn Impress and Draw into modular applications that can easily be extended by additional features.&lt;br /&gt;
This should be possible dynamically through extensions, not only statically at compile time.  The drawing framework is accessible to extensions that are deployed via the extension manager (menu entry Tools-&amp;gt;ExtensionManager...).  This allows an extension to provide for instance a new view and to control when to show this view and in which pane to display it.  This can be done in any programming language for which there is UNO API support.  The [Presenter Screen|Presenter Screen extension] is one example for this.&lt;br /&gt;
&lt;br /&gt;
The design of the drawing framework addresses the following goals:&lt;br /&gt;
&lt;br /&gt;
*ease of use&lt;br /&gt;
&lt;br /&gt;
*flexibility&lt;br /&gt;
&lt;br /&gt;
*extensibility&lt;br /&gt;
&lt;br /&gt;
*abstraction from underlying frameworks&lt;br /&gt;
&lt;br /&gt;
The drawing framework can be seen as a resource management system, where the resources are panes, views, tool bars, commands (slots).  The configuration controller synchronizes activation and deactivation of resources.  It has its name from the configuration, which describes the set of active resources, i.e. the set of visible panes, views, and tool bars.  Synchronization means that when two or more resources are to be activated or deactivated at the same time then the configuration controller&lt;br /&gt;
*orders activations and deactivations according to dependencies between resources (e.g. when a viewand a pane are to be activated then the pane is activated before the view so that the view has access to the pane),&lt;br /&gt;
*tries to minimize the overall time and&lt;br /&gt;
*reduces visual artifacts, i.e. flickering.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is implemented on top of and abstracts from existing framework functionality provides mostly by the SFX2 and [[Framework]] projects.&lt;br /&gt;
&lt;br /&gt;
There is a [[Drawing Framework Glossary|glossary]] for the drawing framework.  The API of the drawing framework is documented [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/module-ix.html here].&lt;br /&gt;
&lt;br /&gt;
==Current State==&lt;br /&gt;
With the experience from the implementation of the [[Presenter_Screen|Presenter Screen extension]] the first incarnation of the drawing framework (that is described by older versions of this page, see history for [http://wiki.services.openoffice.org/w/index.php?title=Drawing_framework&amp;amp;oldid=45696 this] or older versions) has been cleaned up and simplified into its current form.&lt;br /&gt;
&lt;br /&gt;
The drawing framework is used by [[Impress]] and [[Draw]] for managing views, panes, and one or two toolbars.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Framework Design==&lt;br /&gt;
&lt;br /&gt;
The following sections describe the inner structure of the drawing framework in more detail.&lt;br /&gt;
It starts with the set of supported resources, the ResourceIds that identify resources, and configurations that describe the set of active or requested resources.&lt;br /&gt;
Last comes a description of the update process that involves the actual activation and deactivation of resources.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
The drawing framework has been desinged for four types of resources:&lt;br /&gt;
&lt;br /&gt;
* Panes&lt;br /&gt;
&lt;br /&gt;
* Views&lt;br /&gt;
&lt;br /&gt;
* Tool Bars&lt;br /&gt;
&lt;br /&gt;
* Command groups&lt;br /&gt;
&lt;br /&gt;
While the first three need little explanation (the little explanation is done in the API documentation) the concept of [[Drawing Framework Glossary#Command Groups|command groups]] is not used (yet) anywhere else.  A command group is a collection of commands realized by a module that implements at least the com::sun::star::frame::XDispatch interface and implements one or more commands (that to some are known as slots).&lt;br /&gt;
&lt;br /&gt;
A resource is identified by a non-empty set of URLs that describe the actual resource and its dependency on other resources.  One URL is called the resource URL and defines the type of the resource.  A possibly empty set of anchor URLs specifies a set of resources to which the one in question is anchored.  Panes for example act as containers for views and thus are their anchors: the resource URL of the left slide sorter in the left pane is &amp;lt;pre&amp;gt;private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;.  Its anchor is the left pane with the URL being &amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane&amp;lt;/pre&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here, the first part after private:resource/ specifies the type of resource:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;pane&amp;#039;&amp;#039;&amp;#039; for panes&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;view&amp;#039;&amp;#039;&amp;#039; for views&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;toolbar&amp;#039;&amp;#039;&amp;#039; for tool bars&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;#039; for command groups&lt;br /&gt;
The final part of the URL defines the actual resource.&lt;br /&gt;
&lt;br /&gt;
===ResourceId===&lt;br /&gt;
Each resource is identified by an object that implements the&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/ResourceId.html com::sun::star::drawing::framework::ResourceId] service with its [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XResourceId.html com::sun::star::drawing::framework::XResourceId] interface.  The XResourceId interface gives access to a set of URLs which specify the resource.  There is one URL returned by the getResourceURL() function that defines the type of the resource.  A possibly empty set of URLs returned by getAnchorURLs() specifies the anchor resource.&lt;br /&gt;
&lt;br /&gt;
Each resource in a configuration has to have a unique resource id.  Two resource ids may have the same resource URLs but then their anchors must not be the same.  An example for this would be the slide sorter being shown in two different panes.  Alternatively two resource may have the same anchor but then must not have the same resource URL.  An example for this is the view tab bar and the view in the center pane.  The anchor of both is the center pane.&lt;br /&gt;
&lt;br /&gt;
Lets take the slide sorter as an example for this.  In the left pane, the slide sorter bar is described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/floater/LeftImpressPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
The slide sorter view in the center pane id described by the ResourceId&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/view/SlideSorter&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Panes are the typical anchor resources.  They do not have an anchor, therefore getAnchorURLs() returns an empty list for them.  An example for an anchor that is not a pane is the view tab bar.  It is linked to the center pane.  It is the anchor for its tabs that each represent one view that may by displayed in the center pane.  The resource ids of the two left most tabs are for example&lt;br /&gt;
&amp;lt;pre&amp;gt;private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/ImpressView&lt;br /&gt;
private:resource/pane/CenterPane, private:resource/toolbar/ViewTabBar, private:resource/view/OutlineView&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ResourceId service provides four functions for creating ResourceId objects.  These are createEmpty() and create() for creating an empty resource id and one that has no anchor.  The createWithAnchor() variant creates a resource whose anchor is given as ResourceId object.  When the later is empty then the resulting resource could have been created with create().  Finally createWithAnchorURL takes two URLs, one for the actual resource and one for its anchor.  These four variants cover the most common usages but it may be extended in the future (note drawing framework API is not yet marked as published and may be modified.)&lt;br /&gt;
&lt;br /&gt;
===Known Resources===&lt;br /&gt;
A list of known resources can be found [[Drawing Framework Resources|here]].&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
&lt;br /&gt;
A [[Drawing Framework Glossary#Configuration|configuration]] describes a set&lt;br /&gt;
of resources.  There are two important configurations, which ideally are&lt;br /&gt;
identical:&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Current Configuration|current configuration]] describes the set of currently active resources. The term &amp;#039;&amp;#039;active&amp;#039;&amp;#039; can mean different things for different types of resources.  For panes, views, and tool bars it means that they are visible. For a command group it means that that group is ready to process incoming slot calls.&lt;br /&gt;
&lt;br /&gt;
*The [[Drawing Framework Glossary#Requested Configuration|requested configuration]] describes the set of  resources that have been requested to be active either directly by the user or by the application in response to some user input.&lt;br /&gt;
&lt;br /&gt;
Usually the two configurations differ only temporarily after a&lt;br /&gt;
new request for the activation or deactivation of a resource has been made&lt;br /&gt;
but not yet been processed.  Eventually the current configuration is updated to&lt;br /&gt;
reflect the requested configuration.  There may, however, be circumstances,&lt;br /&gt;
that do not allow a resource to be activated or (less likely) to be deactivated.&lt;br /&gt;
One reason for this is that some resources are created asynchronously and&lt;br /&gt;
become available only after a little time.&lt;br /&gt;
&lt;br /&gt;
See the  [[Drawing Framework Glossary#Configuration|configuration]] glossary&lt;br /&gt;
entry for examples.&lt;br /&gt;
&lt;br /&gt;
It is possible obtain a copy of the requested configuration and restore it&lt;br /&gt;
later.  This allows to undo temporary changes.  For example, the in-place&lt;br /&gt;
slide show uses this feature to temporarily hide the side panes and to&lt;br /&gt;
restore them when the show ends.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Three layer design===&lt;br /&gt;
&lt;br /&gt;
The drawing framework consists of controllers, factories, and application&lt;br /&gt;
logic modules.  These  are located on three layers.  The assignment to the&lt;br /&gt;
different layers depends on the knowledge about different aspects of the&lt;br /&gt;
resource management:&lt;br /&gt;
&lt;br /&gt;
;Application Layer:The [[Drawing Framework Glossary#Application Layer|application layer]] controls &amp;#039;&amp;#039;&amp;#039;when&amp;#039;&amp;#039;&amp;#039; to activate or deactivate a resource.  This layer contains the application logic.  For example the Impress application uses a module that is responsible for activating or deactivating the slide sorter bar depending on the view that is displayed in the center pane.&lt;br /&gt;
&lt;br /&gt;
;Synchronization Layer:The [[Drawing Framework Glossary#Synchronization Layer|synchronization layer]] uses the XConfigurationController to &amp;#039;&amp;#039;&amp;#039;synchronize&amp;#039;&amp;#039;&amp;#039; the requests from the application layer with the resource controllers in the resource layer. It has no detailed knowledge about individual resources nor about the application logic.&lt;br /&gt;
&lt;br /&gt;
;Resource Layer:The resource factories in the [[Drawing Framework Glossary#Resource Layer|resource layer]] know &amp;#039;&amp;#039;&amp;#039;how&amp;#039;&amp;#039;&amp;#039; to activate or deactivate resources.  The XResourceControllers are called by the XConfigurationController to update the the current configuration so that it looks like the requested configuration.&lt;br /&gt;
&lt;br /&gt;
[[image:DrawingFrameworkDesign.png|The different parts of the drawing framework are organized in three layers]]&lt;br /&gt;
&lt;br /&gt;
The image illustrates the three layer design for the Impress application.  The ImpressModule is created by the ImpressViewShell when the user creates a new Impress document.  The ImpressModule creates the other modules in the application layer that control different aspect of the application.  For example they watch for user input and switch to different views in ther center pane accordingly.&lt;br /&gt;
&lt;br /&gt;
The modules in the application layer communicate with the XConfgurationController in the synchronization layer to make requests for the activation or deactivation of panes and views.  The XConfigurationController modifies the RequestedConfiguration accordingly. &lt;br /&gt;
&lt;br /&gt;
Eventually the CurrentConfiguration is updated.  The XConfigurationController then determines the order in which to activate and deactivate resources and calls the resource factories in that order to create resources that are activated or to release resources that are deactivated.&lt;br /&gt;
&lt;br /&gt;
Resource factories can implement a cache to store deactivated resources.  Some resources like the slide sorter bar are activated and deactivated frequently.  Caching it may speed this up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Two phase updates===&lt;br /&gt;
&lt;br /&gt;
The drawing framework negotiates between modules implementing application&lt;br /&gt;
logic that want to show or hide a resource on one side and the resource&lt;br /&gt;
factories on the other side.  The negotiation process is iterative: the&lt;br /&gt;
activation request of a resource made by one application logic module may&lt;br /&gt;
cause the activation request of another resource made by a second module.&lt;br /&gt;
For example, when the user switches the view in the center pane to the&lt;br /&gt;
outline view, then the task pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
The negation process is split into two phases, one&lt;br /&gt;
for collecting a list of all the necessary changes and the second for&lt;br /&gt;
updating the GUI to reflect these changes.&lt;br /&gt;
&lt;br /&gt;
;Negotiation Phase: The negotiation phase is triggered by the initial request, for example the switch of the view in the center pane.  In this phase only the requested configuration is modified.  The requested change is stored in the requested configuration and then is broadcasted.  Listeners may react by making further requests for activation or deactivation of other resources.  These are again stored in the requested configuration and broadcasted and may lead to even more requests.  All requests are put into a queue which is processed until there are no more pending requests.&lt;br /&gt;
&lt;br /&gt;
;Update Phase:When all requests have been processed and the requested configuration describes a new consistent state of the GUI then the second, the &amp;#039;&amp;#039;&amp;#039;update phase&amp;#039;&amp;#039;&amp;#039; is started.  In this phase only the current configuration is modified.&lt;br /&gt;
:That is, the requested configuration is not modified directly in this phase.  The application can of course request the activation or deactivation of resources.  Therefore, in the update phase a copy of the requested configuration is used which remains unchanged during the update.&lt;br /&gt;
:The different resource factories are asked to create or relase resources so that eventually the current configuration looks like the requested configuration.  Every activation and deactivation is broadcasted like the requests for the activations and deactivations where.&lt;br /&gt;
&lt;br /&gt;
It is the task of the configuration controller to order the activations and deactivations according to dependencies between affected resources and to optimize the update&lt;br /&gt;
phase with respect to time and visual artifacts/flickering.&lt;br /&gt;
&lt;br /&gt;
==Extensibility==&lt;br /&gt;
The drawing framework is designed to be extensible with regard to the set of known resources and to the application logic.&lt;br /&gt;
&lt;br /&gt;
For a new resource you have to provide a factory and register it at the configuration manager.  An example could be a new view or a new tool bar.&lt;br /&gt;
&lt;br /&gt;
For a new piece of application logic add a listener to the configuration controller and react to activations or deactivations of relevant resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation and Examples==&lt;br /&gt;
The examples in the following sections show how to use the drawing framework to request and access resources and how to react to changes of the current configuration.  Note that the code is C++ like pseudo code that can not be compiled as is.&lt;br /&gt;
&lt;br /&gt;
===FrameworkHelper===&lt;br /&gt;
The ::sd::framework::FrameworkHelper class provides two things&lt;br /&gt;
* the most frequently used resource URLs so that you do not have to remember them, have trouble with resource allocation, or are able to misspell resource names, and&lt;br /&gt;
* some helper functions that simplify the work with the UNO based drawing framework from inside core code.&lt;br /&gt;
The FrameworkHelper is a multi singleton.  Its Instance() method returns for a ViewShellBase object the associated FrameworkHelper object.  The functions provided cover&lt;br /&gt;
* mapping between sd::ViewShell::ShellType and view resource URL,&lt;br /&gt;
* obtain view objects for their URLs or ResourceIds,&lt;br /&gt;
* making requests for the activation or deactivation of resources,&lt;br /&gt;
* locking configuration updates,&lt;br /&gt;
* waiting for certain events to make asynchronous requests synchronous.&lt;br /&gt;
&lt;br /&gt;
One example for that is a request for the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FrameworkHelper::Instance(GetViewShellBase()).RequestView(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Drawing Framework API===&lt;br /&gt;
The following subsections provide a short introduction of the UNO API of the drawing framework.  For details please refer to the API documentation (not yet available.)&lt;br /&gt;
&lt;br /&gt;
====Getting Access to the Drawing Framework====&lt;br /&gt;
Using the UNO API of the drawing framework to access active resources or to request the activation or deactivation of resources starts with the [http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XController.html XController] of an [[Impress]] or a [[Draw]] document.  From this you can obtain the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XControllerManager.html XControllerManager] and from that the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XConfigurationController.html XConfigurationController].  The XConfigurationController is the main access point for making requests and for accessing resources. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
using ::com::sun::star::uno;&lt;br /&gt;
using ::com::sun::star::frame;&lt;br /&gt;
using ::com::sun::star::drawing::framework;&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XController&amp;gt; xController;              // This is regarded as given.&lt;br /&gt;
Reference&amp;lt;XComponentContext&amp;gt; xComponentContext;  // This also is regarded as given.&lt;br /&gt;
&lt;br /&gt;
Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Requesting a Resource Activation====&lt;br /&gt;
Once you have obtained access to the XConfigurationController, making requests to activate or deactivate resources is simple.  The following code requests the activation of the slide sorter bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you compare this to the code bove that uses the FrameworkHelper to accomplish&lt;br /&gt;
the same thing then you see, that the FrameworkHelper only hides the&lt;br /&gt;
connection from the ViewShellBase to the XConfigurationController.  The rest&lt;br /&gt;
of the call is basically the same.&lt;br /&gt;
&lt;br /&gt;
However, the drawing framework does not provide too many automatisms on this&lt;br /&gt;
layer (that is the task of the modules in the application layer) so the pane&lt;br /&gt;
in which to show the slide sorter has to be requested as well.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the use of ResourceId::create() instead of ResourceId::createWithAnchorURL(). This is because a pane, in contrast to the view that was requested earlier, is not bound to any other resource.&lt;br /&gt;
&lt;br /&gt;
The two requests should be executed together.  An intermediate update of the&lt;br /&gt;
current configuration is not necessary and would lead to an annoying display&lt;br /&gt;
of an empty window before the slide sorter bar is properly shown.  The&lt;br /&gt;
probability that this happens is low but not zero.  Therefore it is good&lt;br /&gt;
practice to lock the XConfigurationController while the two requests are&lt;br /&gt;
made.  This prevents unwanted updates.  You can call the lock() and unlock()&lt;br /&gt;
methods directly but it is safer to use the ConfigurationController::Lock&lt;br /&gt;
inner class to do that.  Adding this and bringing the two requests into the&lt;br /&gt;
logical order you get&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    ::sd::framework::ConfigurationController::Lock(xCC);&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::create(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
    xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
        ResourceId::createWithAnchorURL(&lt;br /&gt;
            aComponentContext,&lt;br /&gt;
            FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
            FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Accessing a Resource====&lt;br /&gt;
If you want to access an active resource directly then you have to ask the&lt;br /&gt;
XConfigurationController for it.  Suppose you are interested in accessing the window of the left&lt;br /&gt;
pane that shows the slide sorter bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(&lt;br /&gt;
    ResourceId::create(&lt;br /&gt;
        aComponentContext,&lt;br /&gt;
        FrameworkHelper::msLeftImpressPaneURL),&lt;br /&gt;
    UNO_QUERY);&lt;br /&gt;
if (xPane.is())&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
    if (xWindow-&amp;gt;is())&lt;br /&gt;
    {&lt;br /&gt;
        // Do something with the window.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reacting to Modifications of the Configuration====&lt;br /&gt;
When you want to implement application logic then you have to react to user input by requesting changes to the current configuration.  User input can come in many ways.  Here we cover only the indirect way of (requested) changes of the current configuration made by others.&lt;br /&gt;
&lt;br /&gt;
The following code turns on the slide sorter bar when the center pane is switched to&lt;br /&gt;
the edit view, outline view, or notes view and turns it off for all other views.  The drawing framework contains a module in the application layer that does essentially the same.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SlideSorterBarManager : public XConfigurationChangeListener {&lt;br /&gt;
public:&lt;br /&gt;
Reference&amp;lt;XConfigurationController&amp;gt; mxCC;&lt;br /&gt;
&lt;br /&gt;
void SlideSorterBarManager (const Reference&amp;lt;XConfigurationController&amp;gt;&amp;amp; rxCC)&lt;br /&gt;
    : mxCC(rxCC)&lt;br /&gt;
{&lt;br /&gt;
    Reference&amp;lt;XConfigurationControllerBroadcaster&amp;gt; xCCB (mxCC, UNO_QUERY);&lt;br /&gt;
    xCCB-&amp;gt;addConfigurationChangeListener(&lt;br /&gt;
        this,&lt;br /&gt;
        FramworkHelper::msResourceActivationRequestEvent,&lt;br /&gt;
        Any());&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
virtual void notifyConfigurationChange (const ConfigurationChangeEvent&amp;amp; rEvent)&lt;br /&gt;
{&lt;br /&gt;
    if (rEvent.Type.equals(FrameworkHelper::msResourceActivationRequestEvent))&lt;br /&gt;
    {&lt;br /&gt;
        if (rEvent.ResourceId.is())&lt;br /&gt;
         &amp;amp;&amp;amp; rEvent.ResourceId-&amp;gt;isBoundToURL(FrameworkHelper::msCenterPaneURL,DIRECT))&lt;br /&gt;
        {&lt;br /&gt;
            // A resource has been requested for the center pane.&lt;br /&gt;
            ::rtl::OUString sResourceURL (rEvent.ResourceId-&amp;gt;getResourceURL());&lt;br /&gt;
            if (sResourceURL.equals(FrameworkHelper::msImpressViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msOutlineViewURL)&lt;br /&gt;
             || sResourceURL.equals(FrameworkHelper::msNotesViewURL))&lt;br /&gt;
            {&lt;br /&gt;
                // Show the slide sorter bar.&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::create(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
                xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Hide the slide sorter bar for the handout view, the slide&lt;br /&gt;
                // sorter view, and all views that where not handled above.&lt;br /&gt;
                mxCC-&amp;gt;requestResourceDeactivation(&lt;br /&gt;
                    ResourceId::createWithAnchorURL(&lt;br /&gt;
                        aComponentContext,&lt;br /&gt;
                        FrameworkHelper::msSlideSorterURL,&lt;br /&gt;
                        FrameworkHelper::msLeftImpressPaneURL));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There are three things to note in this code:&lt;br /&gt;
# The first &amp;#039;&amp;#039;&amp;#039;if&amp;#039;&amp;#039;&amp;#039; statement in the notifyConfigurationChange() method is not really necessary because the listener is registered only for this one event type and thus will not be called for other event types.&lt;br /&gt;
# There is no update lock surrounding the activation requests for the slide sorter bar.  This is not necessary   here, because the listener is only called during the negotiation phase.  During this whole phase the update is locked.&lt;br /&gt;
# There is only one deactivation request, the one for the view.  The request for the pane is missing.  This is because there might be other resources bound to the pane.  However, this is one of a few places where an automatism is active: when there are no resources bound to a pane when the negotiation phase ends, then the pane is deactivated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Providing a New Resource====&lt;br /&gt;
To provide a new resource, say a SingleColorView that fills a window with a&lt;br /&gt;
single color, you have to&lt;br /&gt;
*Provide the actual view&lt;br /&gt;
*Provide a factory that creates a view object for a given XPane object&lt;br /&gt;
*Register the factory&lt;br /&gt;
*Request the new view&lt;br /&gt;
&lt;br /&gt;
A view has to support the [http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/framework/XView.html css::drawing::framework::XView] interface which is&lt;br /&gt;
derived from the XResource interface.  Both interfaces are extremely simple&lt;br /&gt;
because the drawing framework does not need to know much about its&lt;br /&gt;
resources.&lt;br /&gt;
&lt;br /&gt;
The knowledge is concentrated only in the factory and of course in the&lt;br /&gt;
implementation of the new view.  Both a new resource and its factory are&lt;br /&gt;
typically deployed together so they can use private and implementation&lt;br /&gt;
language dependent means to communicate with each other and share information.&lt;br /&gt;
&lt;br /&gt;
The factory is given a ResourceId when asked for a new resource object.  For&lt;br /&gt;
the SingleColorView the ResourceId is used to look up the corresponding&lt;br /&gt;
XPane object from which the XWindow reference is obtained.  For the standard&lt;br /&gt;
panes the XPane object supports the XUnoTunnel interface which gives access&lt;br /&gt;
to the VCL Window pointer, but that is not used here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SingleColorViewFactory : XResourceFactory&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    virtual Reference&amp;lt;XView&amp;gt; createResource (&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        Reference&amp;lt;XResource&amp;gt; xView;&lt;br /&gt;
&lt;br /&gt;
        // Get the XWindow object fort the AnchorURL of the given ResourceId.&lt;br /&gt;
        Reference&amp;lt;XControllerManager&amp;gt; xCM (xController, UNO_QUERY_THROW);&lt;br /&gt;
        Reference&amp;lt;XConfigurationController&amp;gt; xCC (xCM-&amp;gt;getConfigurationController());&lt;br /&gt;
        Reference&amp;lt;XPane&amp;gt; xPane (xCC-&amp;gt;getResource(rxViewId-&amp;gt;getAnchor()), UNO_QUERY);&lt;br /&gt;
        if (xPane.is())&lt;br /&gt;
        {&lt;br /&gt;
            // Create the view for the XWindow object.&lt;br /&gt;
            Reference&amp;lt;XWindow&amp;gt; xWindow (xPane-&amp;gt;getWindow());&lt;br /&gt;
            if (xWindow.is())&lt;br /&gt;
                xView = new SingleColorView(rxViewId, xWindow);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return xView;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void releaseView (&lt;br /&gt;
        const Reference&amp;lt;XResource&amp;gt;&amp;amp; rxView)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing.  When the caller releases its reference to the view,&lt;br /&gt;
        // then the view will be destroyed.&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SingleColorView : drawing::framework::XView, awt::XPaintListener&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    SingleColorView(&lt;br /&gt;
        const Reference&amp;lt;XResourceId&amp;gt;&amp;amp; rxViewId,&lt;br /&gt;
        const Reference&amp;lt;XWindow&amp;gt;&amp;amp; rxWindow)&lt;br /&gt;
        : mxViewId(rxViewId)&lt;br /&gt;
    {&lt;br /&gt;
        rxWindow-&amp;gt;addPaintListener(this);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual ResourceId getResourceId (void)&lt;br /&gt;
    {&lt;br /&gt;
        return maId;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    virtual void windowPaint (const awt::PaintEvent&amp;amp; rEvent)&lt;br /&gt;
    {&lt;br /&gt;
        // Paint the area specified by the event.&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
    Reference&amp;lt;XResourceId&amp;gt; mxViewId;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The factory can be registered in two ways.&lt;br /&gt;
#Dynamically by calling XViewController::addViewFactory()&lt;br /&gt;
#Statically by adding an entry to the configuration.&lt;br /&gt;
&lt;br /&gt;
For the latter you have to provide a UNO service for the view factory, say com.sun.star.drawing.framework.SingleColorViewFactory.  With&lt;br /&gt;
this, merge the following entry into the Impress.xcu file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MultiPaneGUI&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;Framework&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;ResourceFactories&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;F0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;ServiceName&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;com.sun.star.drawing.framework.SingleColorViewFactory&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;node oor:name=&amp;quot;ResourceList&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;node oor:name=&amp;quot;R0&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;prop oor:name=&amp;quot;URL&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;value&amp;gt;private:resource/view/SingleColorView&amp;lt;/value&amp;gt;&lt;br /&gt;
            &amp;lt;/prop&amp;gt;&lt;br /&gt;
          &amp;lt;/node&amp;gt;&lt;br /&gt;
        &amp;lt;/node&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
All what remains to be done is to request the view.  To show it in the right&lt;br /&gt;
pane, instead of the task panel, make this call:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xCC-&amp;gt;requestResourceActivation(&lt;br /&gt;
    ResourceId::createWithAnchorURL(&lt;br /&gt;
        xComponentContext,&lt;br /&gt;
        ::rtl::OUString::createFromAscii(&amp;quot;private:resource/view/SingleColorView&amp;quot;),&lt;br /&gt;
        FameworkHelper::msRightPaneURL));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Impress]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Programming_OOoDraw_and_OOoImpress&amp;diff=115967</id>
		<title>Programming OOoDraw and OOoImpress</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Programming_OOoDraw_and_OOoImpress&amp;diff=115967"/>
		<updated>2009-03-15T09:48:12Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
OOoDraw is my favorite application of OpenOffice.org suite. I think then I will spend a lot of time with this chapter. I start writing this chapter with the Help of Christian post in OOoForum (Code snippets)&lt;br /&gt;
[http://www.oooforum.org/forum/viewtopic.phtml?t=11128 Working with a Presentation Document in C++]&lt;br /&gt;
In this chapter, we use again the starting code described [[UNO_automation_with_a_binary_%28executable%29 | here ]]. It consists of a subprogram “ooConnect()” and a main. Working with this code consists of adding new code in the main (see the red comment). We give again the main program slightly modified to fit OOoDraw requirements :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 1 Again the starting Code&lt;br /&gt;
// C++ &lt;br /&gt;
// adapted for OOoDraw&lt;br /&gt;
int main( ) {&lt;br /&gt;
//retrieve an instance of the remote service manager&lt;br /&gt;
    Reference&amp;lt; XMultiServiceFactory &amp;gt; rOfficeServiceManager;&lt;br /&gt;
    rOfficeServiceManager = ooConnect();&lt;br /&gt;
    if( rOfficeServiceManager.is() ){&lt;br /&gt;
        printf( &amp;quot;Connected sucessfully to the office\n&amp;quot; );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//get the desktop service using createInstance returns an XInterface type&lt;br /&gt;
    Reference&amp;lt; XInterface  &amp;gt; Desktop = rOfficeServiceManager-&amp;gt;createInstance(&lt;br /&gt;
    OUString::createFromAscii( &amp;quot;com.sun.star.frame.Desktop&amp;quot; ));&lt;br /&gt;
&lt;br /&gt;
//query for the XComponentLoader interface&lt;br /&gt;
    Reference&amp;lt; XComponentLoader &amp;gt; rComponentLoader (Desktop, UNO_QUERY);&lt;br /&gt;
    if( rComponentLoader.is() ){&lt;br /&gt;
        	printf( &amp;quot;XComponentloader successfully instanciated\n&amp;quot; );&lt;br /&gt;
    	}&lt;br /&gt;
&lt;br /&gt;
//get an instance of the OOoDraw document&lt;br /&gt;
    Reference&amp;lt; XComponent &amp;gt; xcomponent = rComponentLoader-&amp;gt;loadComponentFromURL(&lt;br /&gt;
	OUString::createFromAscii(&amp;quot;private:factory/sdraw&amp;quot;),&lt;br /&gt;
        OUString::createFromAscii(&amp;quot;_blank&amp;quot;),&lt;br /&gt;
        0,&lt;br /&gt;
        Sequence &amp;lt; ::com::sun::star::beans::PropertyValue &amp;gt;());&lt;br /&gt;
// add code here&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find more explanations [[IDL_Files_and_Cpp#IDL__and_C.2B.2B|here]] (if you are not a beginner).&lt;br /&gt;
&lt;br /&gt;
=Finding the drawing Slide=&lt;br /&gt;
Bear in mind that if OOoSheet opens with three sheets by default, OOoDraw opens with only one page/slide (index 0).&lt;br /&gt;
== An existing Slide ==&lt;br /&gt;
If only the index of the slide is known, have look at &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPagesSupplier&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.container.XIndexAccess&amp;lt;/idl&amp;gt; interfaces :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 2 Index access to a draw Slide&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::drawing;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XDrawPagesSupplier.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XDrawPagesSupplier \&amp;quot; in the makefile&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::container;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/container/XIndexAccess.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.container.XIndexAccess \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
	Reference&amp;lt; XDrawPagesSupplier &amp;gt; rDrawDoc(xcomponent, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
// query the XDrawPages Interface&lt;br /&gt;
	Reference&amp;lt; XDrawPages &amp;gt; rDrawPages = rDrawDoc-&amp;gt;getDrawPages();&lt;br /&gt;
&lt;br /&gt;
// query the XIndexAccess Interface&lt;br /&gt;
	Reference&amp;lt; XIndexAccess &amp;gt; rPageIndexAccess(rDrawPages, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	Any DrawPage = rPageIndexAccess-&amp;gt;getByIndex(0);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know how many pages belong to your document, you can reach it from rPageIndexAccess object with :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 3 How many Slides ?&lt;br /&gt;
// C++&lt;br /&gt;
	rPageIndexAccess-&amp;gt;getCount();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you only know the page name (see &amp;lt;idl&amp;gt;com.sun.star.container.XNameAccess&amp;lt;/idl&amp;gt; interface):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 4 Slide Name Access&lt;br /&gt;
//C++&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/container/XNameAccess.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.container.XNameAccess \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
//query the XNameAccess Interface&lt;br /&gt;
	Reference&amp;lt; XNameAccess &amp;gt; rNameAccess(rDrawPages, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	if (rNameAccess-&amp;gt;hasByName(OUString::createFromAscii(&amp;quot;Slide 1&amp;quot;))) {&lt;br /&gt;
		Any DrawPage = rNameAccess-&amp;gt;&lt;br /&gt;
					getByName(OUString::createFromAscii(&amp;quot;Slide 1&amp;quot;));&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Create, rename, copy and remove a Slide ==&lt;br /&gt;
=== Create===&lt;br /&gt;
Create a new slide with a known Index (see &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPagesSupplier&amp;lt;/idl&amp;gt;, &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPage&amp;lt;/idl&amp;gt;, &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPages&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.container.XIndexAccess&amp;lt;/idl&amp;gt; interfaces) :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 5 Creating a new Slide&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::drawing;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XDrawPagesSupplier.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XDrawPagesSupplier \&amp;quot; in the makefile&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::container;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/container/XIndexAccess.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.container.XIndexAccess \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
	Reference&amp;lt; XDrawPagesSupplier &amp;gt; rDrawDoc(xcomponent, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
// query the XDrawPages Interface&lt;br /&gt;
	Reference&amp;lt; XDrawPages &amp;gt; rDrawPages = rDrawDoc-&amp;gt;getDrawPages();&lt;br /&gt;
&lt;br /&gt;
// query for the XDrawPage Inteface&lt;br /&gt;
	Reference&amp;lt; XDrawPage &amp;gt; rDrawPage = rDrawPages-&amp;gt;insertNewByIndex(2);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In this example, the new slide is indexed with value 2 and then its default name is “Slide 3”. You can see a difference between [[Programming_OOoDraw_and_OOoImpress#An_existing_Slide|previous code]] and this one : the former uses an Any type variable (DrawPage) although the latter code obtains directly a &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPage&amp;lt;/idl&amp;gt; interface. One more step is needed to obtain a &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPage&amp;lt;/idl&amp;gt; when working with Any : a UNO query. Add the above code to the former and you obtain like the latter code a &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPage&amp;lt;/idl&amp;gt; interface.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 6 Accessing the XDrawPage Service&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XDrawPage.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XDrawPage \&amp;quot; in the makefile&lt;br /&gt;
// Query the XDrawPage Interface&lt;br /&gt;
	Reference&amp;lt; XDrawPage &amp;gt; rDrawPage(DrawPage, UNO_QUERY);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rename===&lt;br /&gt;
How to rename your slide ? You have to change the Name property of the slide (see &amp;lt;idl&amp;gt;com.sun.star.container.XNamed&amp;lt;/idl&amp;gt; interface):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 7 Renaming a Slide&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/container/XNamed.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.container.XNamed \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
// query for the XNamed Interface&lt;br /&gt;
	Reference&amp;lt; XNamed &amp;gt; rNamed(rDrawPage, UNO_QUERY);&lt;br /&gt;
	rNamed-&amp;gt;setName(OUString::createFromAscii(&amp;quot;My second page&amp;quot;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The &amp;lt;idl&amp;gt;com.sun.star.container.XNamed&amp;lt;/idl&amp;gt; interface is your friend as seen in this code. The corresponding IDL code is given now :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
// IDL&lt;br /&gt;
module com {  module sun {  module star {  module container {&lt;br /&gt;
&lt;br /&gt;
interface XNamed: com::sun::star::uno::XInterface&lt;br /&gt;
{&lt;br /&gt;
	string getName();&lt;br /&gt;
	[oneway] void setName( [in] string aName );&lt;br /&gt;
};&lt;br /&gt;
}; }; }; };  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As seen only two methods are available setName already used in the example and getName.&lt;br /&gt;
We have already focused our attention on the difference between PageDraw and rPageDraw variables : please note we can use both in the previous code.&lt;br /&gt;
===Copy===&lt;br /&gt;
And now you want to copy a page : you have to query the &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPageDuplicator&amp;lt;/idl&amp;gt; interface.&lt;br /&gt;
We have to pass a draw page reference to the method duplicate(). A new draw page is appended at the end of the page list, using the default naming scheme for pages,  Slide n .&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 8 This Listing doesn&amp;#039;t work at the Moment&lt;br /&gt;
// C++ to check (doesn&amp;#039;t work !!!)&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XDrawPageDuplicator.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XDrawPageDuplicator \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
// query for the XDrawPageDuplicator Interface&lt;br /&gt;
	Reference&amp;lt; XDrawPageDuplicator &amp;gt; rDrawPageDuplicator(rDrawPage(s)???, UNO_QUERY);&lt;br /&gt;
	&lt;br /&gt;
	Reference&amp;lt; XDrawPage&amp;gt; rDrawPage2 = rDrawPageDuplicator-&amp;gt;duplicate(rDrawPage);&lt;br /&gt;
// This last line doesn&amp;#039;t work&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
===Remove===&lt;br /&gt;
If you want to remove a page known by its index (see &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPagesSupplier&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.container.XIndexAccess&amp;lt;/idl&amp;gt; interfaces)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 9 Index access&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::drawing;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XDrawPagesSupplier.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XDrawPagesSupplier \&amp;quot; in the makefile&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::container;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/container/XIndexAccess.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.container.XIndexAccess \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
	Reference&amp;lt; XDrawPagesSupplier &amp;gt; rDrawDoc(xcomponent, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
// query the XDrawPages Interface&lt;br /&gt;
	Reference&amp;lt; XDrawPages &amp;gt; rDrawPages = rDrawDoc-&amp;gt;getDrawPages();&lt;br /&gt;
&lt;br /&gt;
// query for the XDrawPage Inteface&lt;br /&gt;
	Reference&amp;lt; XDrawPage &amp;gt; rDrawPage = rDrawPages-&amp;gt;insertNewByIndex(0);&lt;br /&gt;
&lt;br /&gt;
	rDrawPages-&amp;gt;remove(rDrawPage);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Removing a page known by its name is let as an exercise.&lt;br /&gt;
&lt;br /&gt;
== Setting the Focus on a Slide==&lt;br /&gt;
If you obtain a &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPage&amp;lt;/idl&amp;gt; interface corresponding to a hidden page and you want to put it on the top, have a look on &amp;lt;idl&amp;gt;com.sun.star.frame.XModel&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawView&amp;lt;/idl&amp;gt; interfaces :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 10 Setting a Slide as currently focused&lt;br /&gt;
// C++&lt;br /&gt;
// First Obtain a XDrawPage interface for this page, and after :&lt;br /&gt;
&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::frame;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/frame/XModel.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.frame.XModel \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XDrawView.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XDrawView \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
// Query the XModel Interface&lt;br /&gt;
	Reference&amp;lt; XModel &amp;gt; rmodel(rDrawDoc, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt; XController &amp;gt; ctl = rmodel-&amp;gt;getCurrentController();&lt;br /&gt;
&lt;br /&gt;
// Query the XDrawView interface&lt;br /&gt;
	Reference&amp;lt; XDrawView &amp;gt; rDrawView(ctl, UNO_QUERY);&lt;br /&gt;
	rDrawView-&amp;gt;setCurrentPage(rDrawPage);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also &amp;lt;idl&amp;gt;com.sun.star.frame.XModel&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawView&amp;lt;/idl&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Property of a Slide==&lt;br /&gt;
Properties belong to the slide are presented :&lt;br /&gt;
; slide&amp;#039;s properties&lt;br /&gt;
{| border cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;550&amp;quot;&lt;br /&gt;
|- style = &amp;quot;background:#b3e2d1;text-align:center&amp;quot;&lt;br /&gt;
| |Properties||Signification &lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
| Name ||Name of the slide &lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
| BorderLeft ||Left margin in 1/100 mm&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
| BorderRight||Right margin in 1/100 mm&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
| BorderTop ||Top margin in 1/100 mm&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
| MBorderBottom ||Bottom margin in 1/100 mm&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
| Height ||Height of the page in 1/100 mm&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
| Width ||Width of the page in 1/100 mm&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
| Number ||Number of the page begins from 1&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
| Orientation ||Portrait : com.sun.star.view.PaperOrientation.PORTRAIT&lt;br /&gt;
or&lt;br /&gt;
Landscape : com.sun.star.view.PaperOrientation.LANDSCAPE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you want for instance retrieve the page width (a property), use this code with the &amp;lt;idl&amp;gt;com.sun.star.beans.XPropertySet&amp;lt;/idl&amp;gt; interface :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 11 Slide Properties&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::beans;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/beans/XPropertySet.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.beans.XPropertySet \&amp;quot; in the makefile&lt;br /&gt;
	// find out page width&lt;br /&gt;
	Reference&amp;lt; XPropertySet &amp;gt; rPageProps(rDrawPage, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	Any ApageWidth = rPageProps-&amp;gt;getPropertyValue(OUString::createFromAscii(&amp;quot;Width&amp;quot;));&lt;br /&gt;
	sal_Int32 pageWidth;&lt;br /&gt;
	ApageWidth &amp;gt;&amp;gt;= pageWidth;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you want to set the four page margins properties you can use this code :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 12 Margin Properties&lt;br /&gt;
// C++&lt;br /&gt;
// Obtain rPageProps like previous code&lt;br /&gt;
	Any props[4];&lt;br /&gt;
	props[0] &amp;lt;&amp;lt;= (short)1200;&lt;br /&gt;
	props[1] &amp;lt;&amp;lt;= (short)1200;&lt;br /&gt;
	props[2] &amp;lt;&amp;lt;= (short)1200;&lt;br /&gt;
	props[3] &amp;lt;&amp;lt;= (short)1200;&lt;br /&gt;
&lt;br /&gt;
	rPageProps-&amp;gt;setPropertyValue(OUString::createFromAscii(&amp;quot;BorderLeft&amp;quot;),props[0]);&lt;br /&gt;
	rPageProps-&amp;gt;setPropertyValue(OUString::createFromAscii(&amp;quot;BorderRight&amp;quot;),props[1]);&lt;br /&gt;
	rPageProps-&amp;gt;setPropertyValue(OUString::createFromAscii(&amp;quot;BorderTop&amp;quot;),props[2]);&lt;br /&gt;
	rPageProps-&amp;gt;setPropertyValue(OUString::createFromAscii(&amp;quot;BorderBottom&amp;quot;),props[3]);	&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
An other simpler way is to use the build in makeAny function :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 13 Margin Properties and makeAny Function&lt;br /&gt;
// C++&lt;br /&gt;
// Obtain rPageProps like previous code&lt;br /&gt;
	rPageProps-&amp;gt;&lt;br /&gt;
		setPropertyValue(OUString::createFromAscii(&amp;quot;BorderLeft&amp;quot;),makeAny((short)1200));&lt;br /&gt;
	rPageProps-&amp;gt;&lt;br /&gt;
		setPropertyValue(OUString::createFromAscii(&amp;quot;BorderRight&amp;quot;),makeAny((short)1200));&lt;br /&gt;
	rPageProps-&amp;gt;&lt;br /&gt;
		setPropertyValue(OUString::createFromAscii(&amp;quot;BorderTop&amp;quot;),makeAny((short)1200));&lt;br /&gt;
	rPageProps-&amp;gt;&lt;br /&gt;
		setPropertyValue(OUString::createFromAscii(&amp;quot;BorderBottom&amp;quot;),makeAny((short)1200));	&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It&amp;#039;s time now to draw shapes on pages.&lt;br /&gt;
&lt;br /&gt;
== Going further with Inspector ==&lt;br /&gt;
&lt;br /&gt;
[[Object Inspector|The new object inspector]] is able to generate Java or C++ or OOoBasic code. In order to try inspector ability to generate C++ code, we want to use it for the following problem : obtaining the default selected slide from a draw document. See also [[Programming_OooWriter#Going_further_with_Inspector|similar problem with writer document]] and particularly the definition of an IDL-tree.&lt;br /&gt;
&lt;br /&gt;
Using inspector gives us the following IDL-tree :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyDocument -&amp;gt;methods&lt;br /&gt;
  -&amp;gt;com.sun.star.frame.XController getCurrentController()&lt;br /&gt;
    -&amp;gt;xController-&amp;gt;methods&lt;br /&gt;
      -&amp;gt; xDrawPage getCurrentPage         &lt;br /&gt;
        -&amp;gt;String getName           return Slide 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding C++ code atomatically generated is presented below. It use &amp;lt;idl&amp;gt;com.sun.star.frame.XModel&amp;lt;/idl&amp;gt;, &amp;lt;idl&amp;gt;com.sun.star.frame.XController&amp;lt;/idl&amp;gt;, &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawView&amp;lt;/idl&amp;gt;, &amp;lt;idl&amp;gt;com.sun.star.drawing.XDrawPage&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.container.XNamed&amp;lt;/idl&amp;gt; interfaces, but a closer look shows you have to add include directives :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;com/sun/star/frame/XModel.hpp&amp;quot;&lt;br /&gt;
#include &amp;quot;com/sun/star/uno/Reference.hxx&amp;quot;&lt;br /&gt;
#include &amp;quot;com/sun/star/uno/XInterface.hpp&amp;quot;&lt;br /&gt;
#include &amp;quot;rtl/ustring.hxx&amp;quot;&lt;br /&gt;
#include &amp;quot;sal/config.h&amp;quot;&lt;br /&gt;
#include &amp;quot;sal/types.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
namespace css = com::sun::star;&lt;br /&gt;
using namespace rtl;&lt;br /&gt;
&lt;br /&gt;
//...&lt;br /&gt;
void codesnippet(const css::uno::Reference&amp;lt;css::uno::XInterface&amp;gt;&amp;amp; _oUnoEntryObject ){{&lt;br /&gt;
	css::uno::Reference&amp;lt;css::frame::XModel&amp;gt; xModel( _oUnoEntryObject, css::uno::UNO_QUERY_THROW);&lt;br /&gt;
	css::uno::Reference&amp;lt;css::frame::XController&amp;gt; xController = xModel-&amp;gt;getCurrentController();&lt;br /&gt;
	css::uno::Reference&amp;lt;css::drawing::XDrawView&amp;gt; xDrawView( xController, css::uno::UNO_QUERY_THROW);&lt;br /&gt;
	css::uno::Reference&amp;lt;css::drawing::XDrawPage&amp;gt; xDrawPage = xDrawView-&amp;gt;getCurrentPage();&lt;br /&gt;
	css::uno::Reference&amp;lt;css::container::XNamed&amp;gt; xNamed( xDrawPage, css::uno::UNO_QUERY_THROW);&lt;br /&gt;
	OUString sName = xNamed-&amp;gt;getName();&lt;br /&gt;
}&lt;br /&gt;
//...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{Documentation/Caution|I have not checked this code at the moment. I have probably to add any include directives and because we don&amp;#039;t encounter &amp;quot;any&amp;quot; type during the IDL-tree traversing, we probably haven&amp;#039;t to modify C++ source of codesnippet sub.}}&lt;br /&gt;
&lt;br /&gt;
=Drawing with OOoDraw=&lt;br /&gt;
==Inserting a Shape==&lt;br /&gt;
With OOoDraw text is considered as a shape like rectangle, ellipses... Let&amp;#039;s then start with a &amp;lt;idl&amp;gt;com.sun.star.drawing.TextShape&amp;lt;/idl&amp;gt; service and &amp;lt;idl&amp;gt;com.sun.star.drawing.XShape&amp;lt;/idl&amp;gt;, &amp;lt;idl&amp;gt;com.sun.star.drawing.XShapes&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.text.XText&amp;lt;/idl&amp;gt; interfaces:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 14 Inserting a text Shape&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget to add :using namespace com::sun::star::awt; for Point and Size&lt;br /&gt;
&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XShape.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XShape \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XShapes.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XShapes \&amp;quot; in the makefile&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::text;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/text/XText.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.text.XText \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
	Reference&amp;lt; XMultiServiceFactory &amp;gt; DocFactory(xcomponent, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt; XInterface &amp;gt; textshape = DocFactory-&amp;gt;createInstance(&lt;br /&gt;
	               OUString::createFromAscii(&amp;quot;com.sun.star.drawing.TextShape&amp;quot;) );&lt;br /&gt;
	Reference&amp;lt; XShape &amp;gt; rTxtShape(textshape, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	Point *Pos = new ( Point );&lt;br /&gt;
	Size *TheSize = new ( Size );&lt;br /&gt;
	Pos-&amp;gt;X = 2000;&lt;br /&gt;
	Pos-&amp;gt;Y = 6000;&lt;br /&gt;
	TheSize-&amp;gt;Width = 7000;&lt;br /&gt;
	TheSize-&amp;gt;Height = 2000;&lt;br /&gt;
	rTxtShape-&amp;gt;setPosition(Pos);&lt;br /&gt;
	rTxtShape-&amp;gt;setSize(*TheSize);&lt;br /&gt;
&lt;br /&gt;
// Query XShapes Interface&lt;br /&gt;
	Reference&amp;lt; XShapes &amp;gt; Shapes(rDrawPage, UNO_QUERY);&lt;br /&gt;
	Shapes-&amp;gt;add(rTxtShape);&lt;br /&gt;
&lt;br /&gt;
// Query the XText Interface&lt;br /&gt;
	Reference&amp;lt; XText &amp;gt; rText(rTxtShape, UNO_QUERY);&lt;br /&gt;
        rText-&amp;gt;setString(OUString::createFromAscii(&amp;quot;Hello people around the world&amp;quot;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This listing when executed writes out “Hello people around the world” on a page.&lt;br /&gt;
Changing a shape is simple : if you want to draw a rectangle, the only line to change is :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Listing 15 Change this Line&lt;br /&gt;
// C++&lt;br /&gt;
	Reference&amp;lt; XInterface &amp;gt; textshape = DocFactory-&amp;gt;createInstance(&lt;br /&gt;
	               OUString::createFromAscii(&amp;quot;com.sun.star.drawing.TextShape&amp;quot;) );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
with corresponding service &amp;lt;idl&amp;gt;com.sun.star.drawing.RectangleShape&amp;lt;/idl&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 16 Inserting a Rectangle Shape&lt;br /&gt;
// C++&lt;br /&gt;
	Reference&amp;lt; XInterface &amp;gt; textshape = DocFactory-&amp;gt;createInstance(&lt;br /&gt;
	               OUString::createFromAscii(&amp;quot;com.sun.star.drawing.RectangleShape&amp;quot;) );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We shall examine how to draw a shape again later. Note that you can write text too with this new shape as explained now.&lt;br /&gt;
&lt;br /&gt;
==Writing Text in a Shape==&lt;br /&gt;
Writing text in a shape is obtained with the same way as writing text in a TextShape. For a RectangleShape (rRecShape) we have then to query a &amp;lt;idl&amp;gt;com.sun.star.text.XText&amp;lt;/idl&amp;gt; interface :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 17 setString method to insert a Text&lt;br /&gt;
// C++&lt;br /&gt;
// Query the XText Interface&lt;br /&gt;
	Reference&amp;lt; XText &amp;gt; rText(rRecShape, UNO_QUERY);&lt;br /&gt;
        rText-&amp;gt;setString(OUString::createFromAscii(&amp;quot;Hello&amp;quot;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which draws a rectangle and writes out “Hello” in this rectangle.&lt;br /&gt;
&lt;br /&gt;
==Giving a Name to the Shape==&lt;br /&gt;
&lt;br /&gt;
Every shape can receive a name. This feature is very interesting if you want transform OOoDraw as a graphical front-end. Here is a code example which give a name to a shape with &amp;lt;idl&amp;gt;com.sun.star.beans.XPropertySet&amp;lt;/idl&amp;gt; interface :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 18 Naming a Shape&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::beans;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/beans/XPropertySet.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.beans.XPropertySet \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
// Query the XPropertySet Interface&lt;br /&gt;
	Reference&amp;lt; XPropertySet &amp;gt; shapeprops(rtxtShape, UNO_QUERY);&lt;br /&gt;
	shapeprops-&amp;gt;setPropertyValue(OUString::createFromAscii(&amp;quot;Name&amp;quot;),&lt;br /&gt;
			makeAny(OUString::createFromAscii(&amp;quot;demo&amp;quot;)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The XShapes interface allows adding, removing as shown in the IDL file :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 19 Index access to Shapes (IDL file)&lt;br /&gt;
// IDL&lt;br /&gt;
interface XShapes: com::sun::star::container::XIndexAccess&lt;br /&gt;
{&lt;br /&gt;
	void add( [in] com::sun::star::drawing::XShape xShape );&lt;br /&gt;
	void remove( [in] com::sun::star::drawing::XShape xShape );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The XIndexAccess inheritance allows also getcount() and getByIndex. This allows the construction of a loop on all shapes.&lt;br /&gt;
&lt;br /&gt;
See also &amp;lt;idl&amp;gt;com.sun.star.beans.XPropertySet&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.drawing.XShape&amp;lt;/idl&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Graphics and OOoDraw=&lt;br /&gt;
In OOoDraw a graphic is a bitmap or vector picture. We are interesting in this chapter with bitmap graphics.&lt;br /&gt;
&lt;br /&gt;
==Inserting a bitmap==&lt;br /&gt;
Here is an example which insert a bitmap. We start as in previous chapter : with a drawing page. The only difference is again with the shape which is now a GraphicObjectShape. And we have to give a file URL and use &amp;lt;idl&amp;gt;com.sun.star.drawing.XShape&amp;lt;/idl&amp;gt;, &amp;lt;idl&amp;gt;com.sun.star.drawing.XShapes&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.beans.XPropertySet&amp;lt;/idl&amp;gt; interfaces :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 20 Inserting an Image in a Slide&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget #include &amp;lt;osl/file.hxx&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Don&amp;#039;t forget to add :using namespace com::sun::star::awt; for Point and size&lt;br /&gt;
&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XShape.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XShape \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/drawing/XShapes.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.drawing.XShapes \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
// Don&amp;#039;t forget to add : using namespace com::sun::star::beans;&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/beans/XPropertySet.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.beans.XPropertySet \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
	Reference&amp;lt; XMultiServiceFactory &amp;gt; DocFactory(xcomponent, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt; XInterface &amp;gt; GraphicShape = DocFactory-&amp;gt;createInstance(&lt;br /&gt;
	               OUString::createFromAscii(&amp;quot;com.sun.star.drawing.GraphicObjectShape&amp;quot;));&lt;br /&gt;
	Reference&amp;lt; XShape &amp;gt; rGrafShape(GraphicShape, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	Point *Pos = new (Point);&lt;br /&gt;
	Size *TheSize = new ( Size );&lt;br /&gt;
	Pos-&amp;gt;X = 2000;&lt;br /&gt;
	Pos-&amp;gt;Y = 6000;&lt;br /&gt;
	TheSize-&amp;gt;Width = 7000;&lt;br /&gt;
	TheSize-&amp;gt;Height = 2000;&lt;br /&gt;
	rGrafShape-&amp;gt;setPosition(*Pos);&lt;br /&gt;
	rGrafShape-&amp;gt;setSize(*TheSize);&lt;br /&gt;
	OUString sImageUrl;&lt;br /&gt;
	osl::FileBase::getFileURLFromSystemPath(&lt;br /&gt;
                 OUString::createFromAscii(&amp;quot;/home/smoutou/photoperso.jpg&amp;quot;),sImageUrl);&lt;br /&gt;
	Reference&amp;lt; XPropertySet &amp;gt; rShapeProps(rGrafShape, UNO_QUERY);&lt;br /&gt;
	rShapeProps-&amp;gt;setPropertyValue(OUString::createFromAscii(&amp;quot;GraphicURL&amp;quot;),&lt;br /&gt;
			makeAny(sImageUrl));&lt;br /&gt;
&lt;br /&gt;
// Query XShapes Interface&lt;br /&gt;
	Reference&amp;lt; XShapes &amp;gt; Shapes(rDrawPage, UNO_QUERY);&lt;br /&gt;
	Shapes-&amp;gt;add(rGrafShape);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This code doesn&amp;#039;t insert the picture in the document but the link. Inserting effectively is not  possible with the API but with menus :&lt;br /&gt;
&lt;br /&gt;
1. Edition -&amp;gt; link&lt;br /&gt;
&lt;br /&gt;
		select all the pictures link&lt;br /&gt;
&lt;br /&gt;
		click on deconnect button; confirm&lt;br /&gt;
&lt;br /&gt;
2. Save the document.&lt;br /&gt;
&lt;br /&gt;
Or you copy the bitmap of the linked picture after it was added to the document and create a new shape with it. This new shape contains the actual image and not only the link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 20.2 Inserting an Image and embedding it&lt;br /&gt;
&lt;br /&gt;
// C++&lt;br /&gt;
// Don&amp;#039;t forget #include &amp;lt;com/sun/star/awt/XBitmap.hpp&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	//Only after adding the rGrafShape to the Shapes collection, &lt;br /&gt;
	//the GraphicObjectFillBitmap is set.&lt;br /&gt;
&lt;br /&gt;
	//Get a copy of the image bitmap&lt;br /&gt;
	Any bmp = rShapeProps-&amp;gt;getPropertyValue(&lt;br /&gt;
		OUString::createFromAscii(&amp;quot;GraphicObjectFillBitmap&amp;quot;));&lt;br /&gt;
	Reference&amp;lt; XBitmap &amp;gt; rBitmap(bmp, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	Reference&amp;lt; XInterface &amp;gt; embedShape = DocFactory-&amp;gt;createInstance( &lt;br /&gt;
	               OUString::createFromAscii(&amp;quot;com.sun.star.drawing.GraphicObjectShape&amp;quot;));&lt;br /&gt;
	Reference&amp;lt; XShape &amp;gt; rEmbedShape(embedShape , UNO_QUERY);&lt;br /&gt;
	&lt;br /&gt;
	//Set size and pos again (this time for the embedded shape)&lt;br /&gt;
	rEmbedShape-&amp;gt;setPosition(Position);&lt;br /&gt;
	rEmbedShape-&amp;gt;setSize(TheSize);&lt;br /&gt;
&lt;br /&gt;
	Reference&amp;lt; XPropertySet &amp;gt; rEmbedPropSet(rEmbedShape, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	//Set the bitmap for the new embedded shape&lt;br /&gt;
	rEmbedPropSet-&amp;gt;setPropertyValue(&lt;br /&gt;
		OUString::createFromAscii(&amp;quot;GraphicObjectFillBitmap&amp;quot;), makeAny(rBitmap));&lt;br /&gt;
	rEmbedPropSet-&amp;gt;setPropertyValue(&lt;br /&gt;
		OUString::createFromAscii(&amp;quot;Name&amp;quot;), makeAny(sImageUrl));&lt;br /&gt;
&lt;br /&gt;
	//Finally add the embedded shape to the shapes collection&lt;br /&gt;
	rShapes-&amp;gt;add(rEmbedShape);&lt;br /&gt;
&lt;br /&gt;
	//Dont forget to remove the linked shape&lt;br /&gt;
	rShapes-&amp;gt;remove(rGrafShape);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also &amp;lt;idl&amp;gt;com.sun.star.drawing.XShape&amp;lt;/idl&amp;gt;, &amp;lt;idl&amp;gt;com.sun.star.drawing.XShapes&amp;lt;/idl&amp;gt; &amp;lt;idl&amp;gt;com.sun.star.beans.XPropertySet&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.drawing.GraphicObjectShape&amp;lt;/idl&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Changing the Size of a Picture==&lt;br /&gt;
To keep proportion when changing the size, you have first to calculate it. For that we first get the picture&amp;#039;s size in pixels but this is possible only after the “Shapes-&amp;gt;add(rGrafShape);” Here is an example which resize the picture with a chosen width and a height calculated.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//Listing 21 Modifying a Bitmap Size&lt;br /&gt;
//C++&lt;br /&gt;
// Don&amp;#039;t forget to add : #include &amp;lt;com/sun/star/awt/XBitmap.hpp&amp;gt;&lt;br /&gt;
// Don&amp;#039;t forget to add &amp;quot;com.sun.star.awt.XBitmap \&amp;quot; in the makefile&lt;br /&gt;
&lt;br /&gt;
	Any Bitmap = rShapeProps-&amp;gt;&lt;br /&gt;
			getPropertyValue(OUString::createFromAscii(&amp;quot;GraphicObjectFillBitmap&amp;quot;));&lt;br /&gt;
	Reference&amp;lt; XBitmap &amp;gt; rBitmap(Bitmap, UNO_QUERY);&lt;br /&gt;
// query the size in pixel&lt;br /&gt;
	*TheSize = rBitmap-&amp;gt;getSize();&lt;br /&gt;
	sal_Int32 proportion = TheSize-&amp;gt;Height/TheSize-&amp;gt;Width;&lt;br /&gt;
	TheSize-&amp;gt;Width = 14000;&lt;br /&gt;
	TheSize-&amp;gt;Height = 14000*proportion;&lt;br /&gt;
	rGrafShape-&amp;gt;setSize(*TheSize);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also &amp;lt;idl&amp;gt;com.sun.star.awt.XBitmap&amp;lt;/idl&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Inserting many Pictures==&lt;br /&gt;
Every time you insert a picture, you have to query many times the  &amp;lt;idl&amp;gt;com.sun.star.drawing.GraphicObjectShape&amp;lt;/idl&amp;gt; service, even if you insert many times the same picture.&lt;br /&gt;
&lt;br /&gt;
==Finding a Picture with its Name==&lt;br /&gt;
The picture like other shapes can be accessed with an index, not very easy to use. But we can give them a name see ([[ Programming_OOoDraw_and_OOoImpress#Giving_a_Name_to_the_Shape| Giving a Name to the Shape]]) We shall tackle this problem later.&lt;br /&gt;
&lt;br /&gt;
If you want to go further with shapes go to next [[Working_with_Shapes | chapter]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Template:Home_Page}}&lt;br /&gt;
&lt;br /&gt;
= See also=&lt;br /&gt;
* Drawing Documents and Presentation Documents [[Documentation/DevGuide/Drawings/Drawing_Documents_and_Presentation_Documents|in Developer&amp;#039;s Guide]]&lt;br /&gt;
* [[Documentation/BASIC_Guide/Drawings_Presentations|Drawings ans Presentations]]&lt;br /&gt;
* [[Uno/Cpp/Tutorials/Introduction_to_Cpp_Uno|C++ and UNO tutorial]]&lt;br /&gt;
* Writing a Program to Control OpenOffice.org, by Franco Pingiori — [http://www.linuxjournal.com/article/8550 Part 1] and [http://www.linuxjournal.com/article/8608 Part 2], Linux Journal&lt;br /&gt;
&lt;br /&gt;
[[Category:OOoDraw]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Cpp]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Framework/Article/General_Architecture_Of_The_Framework_User_Interface_Implementation&amp;diff=112445</id>
		<title>Framework/Article/General Architecture Of The Framework User Interface Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Framework/Article/General_Architecture_Of_The_Framework_User_Interface_Implementation&amp;diff=112445"/>
		<updated>2009-02-19T07:36:29Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: Fixed tagging of code listings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article describes the general architecture of the framework user interface implementation. The framework user interface implementation is responsible to provide application modules and users the following services:&lt;br /&gt;
&lt;br /&gt;
* Layout of the user interface elements&lt;br /&gt;
* Creation, destruction and &lt;br /&gt;
* Persistent and transient customization of the user interface elements&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The following illustration shows the connections between the most important Framework objects. The blue objects are part of the Framework User Interface API implementation and gray objects are part of the general Framework API implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Architecture.png]]&lt;br /&gt;
&lt;br /&gt;
== The Layout Manager ==&lt;br /&gt;
&lt;br /&gt;
The layout manager is the central instance of a frame controlling the user interface. A layout manager controls the visibility, size and position of the user interface elements of OpenOffice.org. Every created frame has an associated layout manager that can be retrieved using the property &amp;#039;&amp;#039;LayoutManager&amp;#039;&amp;#039;. For OpenOffice.org 2.3 and earlier the layout manager is responsible for:&lt;br /&gt;
&lt;br /&gt;
* Menubar&lt;br /&gt;
* Toolbars&lt;br /&gt;
* Statusbar&lt;br /&gt;
&lt;br /&gt;
Docking windows are controlled by a C++ implementation which is currently independent from the layout manager. It&amp;#039;s planned to move the docking window implementation to the layout manager.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
//============================================================================= &lt;br /&gt;
&lt;br /&gt;
 module com { module sun { module star { module frame {&lt;br /&gt;
&lt;br /&gt;
//============================================================================= &lt;br /&gt;
/** controls the layout of user interface elements which are part of a frame.&lt;br /&gt;
&lt;br /&gt;
    Layout management is the process of determining the size and position of &lt;br /&gt;
    user interface elements. By default, each Frame has a layout &lt;br /&gt;
    manager -- it performs layout management for the user interface elements &lt;br /&gt;
    within the frame. User interface elements can provide size and alignment &lt;br /&gt;
    hints to layout managers, but layout managers have the final decision on &lt;br /&gt;
    the size and position of those user interface elements. &lt;br /&gt;
&lt;br /&gt;
    @since OOo 2.0.0&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
service LayoutManager&lt;br /&gt;
{&lt;br /&gt;
    /** central interface to query for, create, destroy and manipulate user &lt;br /&gt;
        interface elements which are bound to a frame.&lt;br /&gt;
&lt;br /&gt;
        @see ::com::sun::star::frame::XLayoutManager;&lt;br /&gt;
    */&lt;br /&gt;
    interface ::com::sun::star::frame::XLayoutManager;&lt;br /&gt;
        &lt;br /&gt;
    /** notification interface to receive status information about the state &lt;br /&gt;
        of the connected frame.&lt;br /&gt;
&lt;br /&gt;
        E.g., you can receive events of instantiation/destruction and&lt;br /&gt;
        activation/deactivation of a frame.&lt;br /&gt;
&lt;br /&gt;
        @see XFrame::addFrameActionListener()&lt;br /&gt;
        @see XFrame::removeFrameActionListener()&lt;br /&gt;
    */&lt;br /&gt;
    interface ::com::sun::star::frame::XFrameActionListener;&lt;br /&gt;
&lt;br /&gt;
    /** notification interface to receive change messages of user interface &lt;br /&gt;
        elements which are part of the layout manager.&lt;br /&gt;
&lt;br /&gt;
        E.g., you can receive events of insertion/replacing and&lt;br /&gt;
        removing of settings data of user interface elements.&lt;br /&gt;
&lt;br /&gt;
        @see com::sun::star::ui::XUIConfiguration&lt;br /&gt;
    */&lt;br /&gt;
    interface ::com::sun::star::ui::XUIConfigurationListener;&lt;br /&gt;
&lt;br /&gt;
    /** provides functions to merge menus for inplace editing of components&lt;br /&gt;
        inside OpenOffice.org.&lt;br /&gt;
    */&lt;br /&gt;
    interface ::com::sun::star::frame::XMenuBarMergingAcceptor;&lt;br /&gt;
&lt;br /&gt;
    /** registers listeners that want to receive layout manager&lt;br /&gt;
        events.&lt;br /&gt;
    */&lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XLayoutManagerEventBroadcaster;&lt;br /&gt;
&lt;br /&gt;
    /** interface to support settings a menu bar for inplace editing of &lt;br /&gt;
        components inside OpenOffice.org.&lt;br /&gt;
&lt;br /&gt;
        @deprecated&lt;br /&gt;
    */    &lt;br /&gt;
    [optional] interface ::com::sun::star::frame::XInplaceLayout;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}; }; }; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example to retrieve the layout manager instance from a frame.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::frame::XLayoutManager &amp;gt; xLayoutManager;&lt;br /&gt;
::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::beans::XPropertySet &amp;gt; xPropSet; &lt;br /&gt;
&lt;br /&gt;
xPropSet = ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::beans::XPropertySet &amp;gt;( xFrame, ::com::sun::star::uno::UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
if ( xPropSet.is() )&lt;br /&gt;
{&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
        xLayoutManager.set( xPropSet-&amp;gt;getPropertyValue( &lt;br /&gt;
            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( &amp;quot;LayoutManager&amp;quot; ))), &lt;br /&gt;
            ::com::sun::star::uno::UNO_QUERY );&lt;br /&gt;
    }&lt;br /&gt;
    catch ( com::sun::star::beans::UnknownPropertyException&amp;amp; )&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Address a single User Interface Element ===&lt;br /&gt;
&lt;br /&gt;
The implementation uses a new URL schema to address any user interface element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
private:resource/&amp;lt;user interface element type&amp;gt;/&amp;lt;user interface element name&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User interface element types&lt;br /&gt;
Specifies to which type the request user interface element belongs to. The following user interface element types are defined: &amp;#039;&amp;#039;&amp;#039;toolbar&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;menubar&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;statusbar&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* User interface element name&lt;br /&gt;
A user interface element name must specify unequivocally a single user interface element within the same type class of a module or document. The name is used to address the user interface definition file. For example, a user interface definition of a toolbar named “tablebar” should only exists once.&lt;br /&gt;
&lt;br /&gt;
User-defined toolbars must start with “user_” following a unique name so they can be identified as user-defined. User-defined toolbars are not context sensitive an therefor are automatically created and shown by a layout manager instance. Add-on toolbars use the prefix &amp;quot;addon_&amp;quot; and are also controlled by the layout manager automatically.&lt;br /&gt;
&lt;br /&gt;
The following example shows how to address a menu bar of an application module.&lt;br /&gt;
&amp;lt;code&amp;gt;private:resource/menubar/menubar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no need to specify the module for a user interface element as every frame which is bound to a document provides context information that is used to address the correct configuration data.&lt;br /&gt;
&lt;br /&gt;
=== Toolbars ===&lt;br /&gt;
&lt;br /&gt;
Modern GUI systems support toolbars which are rows, columns, or blocks of onscreen buttons or icons that, when clicked, activate certain functions of the program. Toolbars can be docked to the four sides of the main application window or float on the desktop. OpenOffice.org supports an unlimited number of toolbars.&amp;lt;br/&amp;gt;&lt;br /&gt;
Toolbars are addressed by the following generic schema:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;private:resource/toolbar/&amp;lt;name of toolbar&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom toolbars which can be created by the user using &amp;quot;Tools - Customize - Toolbars&amp;quot; use the following schema:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;private:resource/toolbar/custom_&amp;lt;name of custom toolbar&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add-on toolbars which can be defined by extensions and use the following schema:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;private:resource/toolbar/addon_&amp;lt;name of add-on toolbar&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LayoutManager automatically determines the type of toolbar and according to the type controls the toolbars. Custom and add-on toolbars are never context dependent, while normal toolbars can be context or non-context sensitive.&lt;br /&gt;
&lt;br /&gt;
=== Menubar ===&lt;br /&gt;
&lt;br /&gt;
A menu bar is a region on GUI where application specific functions reside. Its purpose is to provide access to different application-specific menus, such as opening files, window manipulation or help.&lt;br /&gt;
&lt;br /&gt;
The menu bar will be accessed by using the following schema:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;private:resource/menubar/menubar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Statusbar ===&lt;br /&gt;
&lt;br /&gt;
A status bar in GUI systems is a component (widget) that is often found at the bottom of windows. It&amp;#039;s normally divided into sections, each of which shows different information. Its job is primarily to display information about the current state of its window.&lt;br /&gt;
&lt;br /&gt;
A status bar is addressed by using the following schema:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;private:resource/statusbar/statusbar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The User Interface Configuration API ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org support a user interface configuration API to adapt the user interface elements to the needs of users and developers. User interface configuration data can be global, module or document based. The global user interface configuration layer is only available for accelerators. The following user interface elements can be accessed via the user interface configuration API:&lt;br /&gt;
&lt;br /&gt;
* Tool bars&lt;br /&gt;
* Menu bar&lt;br /&gt;
* Status bar&lt;br /&gt;
* Accelerators&lt;br /&gt;
* Command images&lt;br /&gt;
&lt;br /&gt;
=== The Module User Interface Configuration Manager ===&lt;br /&gt;
&lt;br /&gt;
A module user interface configuration manager can be retrieved from the &amp;lt;code&amp;gt;com::sun::star::ui::ModuleUIConfigurationManagerSupplier&amp;lt;/code&amp;gt; service which can be created with the OpenOffice.org service manager using its service specifier. One has to provide the module identifier retrieved from the &amp;lt;code&amp;gt;com::sun::star::frame::ModuleManager&amp;lt;/code&amp;gt; service to specify which ModuleUIConfigurationManager should be accessed. The following code snippet shows how one can use the ModuleManager to identify the module bound to a frame. The module identifier can then be used to retrieve the ModuleUIConfigurationManager.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
  ...&lt;br /&gt;
  &lt;br /&gt;
  try&lt;br /&gt;
  {&lt;br /&gt;
      ::rtl::OUString aModuleIdentifier;&lt;br /&gt;
      &lt;br /&gt;
      ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::frame::XModuleManager &amp;gt;( &lt;br /&gt;
          xServiceManager-&amp;gt;createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(&lt;br /&gt;
              &amp;quot;com.sun.star.frame.ModuleManager&amp;quot; ))), ::com::sun::star::uno::UNO_QUERY_THROW );&lt;br /&gt;
      &lt;br /&gt;
      aModuleIdentifier = xModuleManager-&amp;gt;identify( &lt;br /&gt;
          ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::uno::XInterface &amp;gt;( xFrame, ::com::sun::star::uno::UNO_QUERY ) );&lt;br /&gt;
      if ( aModuleIdentifier.getLength() )&lt;br /&gt;
      {&lt;br /&gt;
          ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::frame::XModuleUIConfigurationManagerSupplier &amp;gt; xModuleCfgSupplier;&lt;br /&gt;
          xModuleCfgSupplier = Reference&amp;lt; XModuleUIConfigurationManagerSupplier &amp;gt;(&lt;br /&gt;
          xServiceManager-&amp;gt;createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( &lt;br /&gt;
              &amp;quot;com.sun.star.ui.ModuleUIConfigurationManagerSupplier&amp;quot; ))), ::com::sun::star::uno::UNO_QUERY_THROW );&lt;br /&gt;
          xModuleCfgMgr = ::com::sun::star::uno::Reference&amp;lt; ::com::sun::star::ui::XUIConfiguration &amp;gt;( &lt;br /&gt;
              xModuleCfgSupplier-&amp;gt;getUIConfigurationManager( aModuleIdentifier ), ::com::sun::star::uno::UNO_QUERY );&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
  catch( ::com::sun::star::uno::Exception&amp;amp; )&lt;br /&gt;
  {&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Document User Interface Configuration Manager ===&lt;br /&gt;
&lt;br /&gt;
=== Persistence ===&lt;br /&gt;
&lt;br /&gt;
=== User Interface Configuration Data Format ===&lt;br /&gt;
&lt;br /&gt;
== Maintenance of Menus, Toolbars and User Interface Commands ==&lt;br /&gt;
&lt;br /&gt;
The resource file system which stored the user interface configuration data for older OpenOffice.org version is obsolete for most user interface elements of Openoffice.org 2.x (except context menus). As described in [http://xml.openoffice.org/general.html chapter 9 of the OpenOffice.org XML File Format documentation] all user interface configuration data is stored in a XML based file, which has already been part of Openoffice.org 1.1. This chapter describes how to maintain the necessary files to add/replace and remove new menu items/toolbar items and user interface commands.&lt;br /&gt;
Every OpenOffice.org module has a configuration file where all supported user interface commands are stored with their internationalized user interface command label. The label is used to set the correct text of a menu item. The implementation also creates a short command description from the label (without mnemonic and subsequent ...) which is used by toolbar items without an image and the short bubble help.&lt;br /&gt;
&lt;br /&gt;
The configuration files for an installed OpenOffice.org are located at: &amp;lt;code&amp;gt;&amp;lt;Office installation&amp;gt;/share/registry/org/openoffice/Office/UI&amp;lt;/code&amp;gt;. The schema definition of these configuration files can be found below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[xml]&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE oor:component-schema SYSTEM &amp;quot;../../../../../component-schema.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-schema xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; oor:name=&amp;quot;Commands&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;info&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;CD&amp;lt;/author&amp;gt;&lt;br /&gt;
      &amp;lt;desc &amp;gt;Contains general information about ~ and rules, and about actions based on office commands.&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;/info&amp;gt;&lt;br /&gt;
  &amp;lt;templates&amp;gt;&lt;br /&gt;
    &amp;lt;group oor:name=&amp;quot;LabelType&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;info&amp;gt;&lt;br /&gt;
        &amp;lt;desc&amp;gt;Provides a mapping between commands and their textual representation on the user interface.&amp;lt;/desc&amp;gt;&lt;br /&gt;
      &amp;lt;/info&amp;gt;&lt;br /&gt;
      &amp;lt;prop oor:name=&amp;quot;Label&amp;quot; oor:type=&amp;quot;xs:string&amp;quot; oor:localized=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;info&amp;gt;&lt;br /&gt;
          &amp;lt;desc&amp;gt;A localized text that describes the command or identifier. Can be used as a label inside a menu or as short tool tip help.&amp;lt;/desc&amp;gt;&lt;br /&gt;
        &amp;lt;/info&amp;gt;&lt;br /&gt;
      &amp;lt;/prop&amp;gt;&lt;br /&gt;
      &amp;lt;prop oor:name=&amp;quot;ContextLabel&amp;quot; oor:type=&amp;quot;xs:string&amp;quot; oor:localized=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;info&amp;gt;&lt;br /&gt;
          &amp;lt;desc&amp;gt;A localized text that describes the identifier of a command in a structured menu.  &amp;lt;/desc&amp;gt;&lt;br /&gt;
        &amp;lt;/info&amp;gt;&lt;br /&gt;
      &amp;lt;/prop&amp;gt;&lt;br /&gt;
      &amp;lt;prop oor:name=&amp;quot;Properties&amp;quot; oor:type=&amp;quot;xs:int&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;info&amp;gt;&lt;br /&gt;
          &amp;lt;desc&amp;gt;&lt;br /&gt;
            Additional information about a single command.&lt;br /&gt;
            Bit 0 = Command has an image.&lt;br /&gt;
            Bit 1 = Image must be mirrored  (CTL/vertical text).&lt;br /&gt;
            Bit 2 = Image must be rotated (CTL/vertical text).&lt;br /&gt;
          &amp;lt;/desc&amp;gt;&lt;br /&gt;
        &amp;lt;/info&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
      &amp;lt;/prop&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
  &amp;lt;/templates&amp;gt;&lt;br /&gt;
&amp;lt;component/&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-schema&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A LabelType consists of three properties.&lt;br /&gt;
* Label&lt;br /&gt;
A label contains the menu label text with an optional mnemonic (~) and possible “...” characters at the end to specify that a dialog will follow. The Office automatically creates a quick help text out of the label string, it removes the mnemonic and “...” characters at the end.&lt;br /&gt;
* ContextLabel&lt;br /&gt;
This is a special label which is used for sub-menu entries located on level two or greater depth. There are some popup menus which have a label which describe an action, e.g. &amp;quot;Insert&amp;quot;. All sub-menu entries of this popup menu should not contain &amp;quot;Insert&amp;quot; again (e.g. &amp;quot;Insert Picture&amp;quot;).&lt;br /&gt;
* Properties&lt;br /&gt;
A sal_Int32 type which specifies a bit field to store additional information about the command.&lt;br /&gt;
** Bit 0 = The command has an associated image. The OpenOffice.org image manager tries to retrieve an image for this command.&lt;br /&gt;
** Bit 1 = Image must be mirrored in CTL/vertical text contexts.&lt;br /&gt;
** Bit 2 = Image must be rotated in CTL/vertical text contexts.&lt;br /&gt;
&lt;br /&gt;
A command configuration file has two sets which store different information. Commands which can be executed must be added to the “Commands” set. To support the definition of popup menu labels and to have a unique identifier for every popup-menu there is a second set called “Popups”. Here only labels for popup-menus should be defined, no real command is allowed to be placed here! &lt;br /&gt;
The following cutout shows the definition of the generic user interface command “.uno:TransformDialog”.&lt;br /&gt;
&amp;lt;code&amp;gt;[xml]&lt;br /&gt;
&amp;lt;?xml version=&amp;#039;1.0&amp;#039; encoding=&amp;#039;UTF-8&amp;#039;?&amp;gt;&lt;br /&gt;
&amp;lt;oor:component-data oor:name=&amp;quot;GenericCommands&amp;quot; oor:package=&amp;quot;org.openoffice.Office.UI&amp;quot; xmlns:oor=&amp;quot;http://openoffice.org/2001/registry&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;node oor:name=&amp;quot;UserInterface&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=&amp;quot;Commands&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;node oor:name=&amp;quot;.uno:JustifyPara&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Label&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;Blocksatz&amp;lt;/value&amp;gt;&lt;br /&gt;
          &amp;lt;value xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;Justified&amp;lt;/value&amp;gt;&lt;br /&gt;
          ...&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
        &amp;lt;prop oor:name=&amp;quot;Properties&amp;quot; oor:type=&amp;quot;xs:int&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;value&amp;gt;7&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;/prop&amp;gt;&lt;br /&gt;
      &amp;lt;/node&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
    &amp;lt;node oor:name=”Popup”&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/node&amp;gt;&lt;br /&gt;
  &amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/oor:component-data&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The configuration files for all modules are maintained in the project &amp;#039;&amp;#039;&amp;#039;officecfg&amp;#039;&amp;#039;&amp;#039; within the folder &amp;lt;code&amp;gt;officecfg/registry/data/org/openoffice/Office/UI&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Adding a new Toolbar ====&lt;br /&gt;
&lt;br /&gt;
There are some additional steps necessary if you want to add a new toolbar to the Office. Two different situations are possible which must be handled:&lt;br /&gt;
&lt;br /&gt;
===== Adding a shell based toolbar =====&lt;br /&gt;
A shell based toolbar will be opened/closed automatically by sfx2/framework code. Whenever the shell is pushed to the shell stack a open/close command is triggered at the framework based layout manager. As the sfx2 is the starting point for the open/close command the toolbar must be registered at the shell. You also need a unqiue identifier for your toolbar (in the past this was also the resource ID for the toolbar). The sfx has a mapping table which can be found in the file: &amp;lt;code&amp;gt;sfx2/source/appl/workwin.cxx&amp;lt;/code&amp;gt;. It starts with the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp]&lt;br /&gt;
static const ResIdToResName pToolBarResToName[] = &lt;br /&gt;
{&lt;br /&gt;
 { 558,      &amp;quot;fullscreenbar&amp;quot;        },&lt;br /&gt;
 { 560,      &amp;quot;standardbar&amp;quot;,         },&lt;br /&gt;
 { 18003,    &amp;quot;formsnavigationbar&amp;quot;   },&lt;br /&gt;
 ...&lt;br /&gt;
 { 25000,    “newtoolbar”           }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You have to add a line which maps the unique identifier of your toolbar to the new internal toolbar name which also defines the xml filename which contains the structure data of the toolbar. You have to create the xml file and define the toolbar items within your toolbar. If your new shell is used by more than one application module you have to copy the xml file to the uiconfig folder of all dependent modules. The UI name for the toolbar must be specified within the window state configuration file of every module that uses the toolbar. The following example specifies the UI name for a new toolbar called “newtoolbar”:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[xml]&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;private:resource/toolbar/newtoolbar&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;prop oor:name=&amp;quot;UIName&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;value xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;My new toolbar&amp;lt;/value&amp;gt;&lt;br /&gt;
 &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;Meine neue Toolbar&amp;lt;/value&amp;gt;&lt;br /&gt;
 &amp;lt;/prop&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Adding a non-shell based toolbar =====&lt;br /&gt;
&lt;br /&gt;
A non-shell based toolbar can be defined without adapting any sfx2/shell based code. You have to define a unique internal name for your toolbar, e.g newtoolbar. Create a xml file that specifies which commands are part of the toolbar. Copy the toolbar xml file to the application module projects that must have access to it (there exists a folder called “uiconfig” in every application project).&lt;br /&gt;
The UI name for the toolbar must be specified within the window state configuration file of every module that uses the toolbar. The following example specifies the UI name for a new toolbar called “newtoolbar”:&lt;br /&gt;
&amp;lt;code&amp;gt;[xml]&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;private:resource/toolbar/newtoolbar&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;prop oor:name=&amp;quot;UIName&amp;quot; oor:type=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;value xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;My new toolbar&amp;lt;/value&amp;gt;&lt;br /&gt;
 &amp;lt;value xml:lang=&amp;quot;de&amp;quot;&amp;gt;Meine neue Toolbar&amp;lt;/value&amp;gt;&lt;br /&gt;
 &amp;lt;/prop&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How to add, replace or remove a User Interface Command ===&lt;br /&gt;
&lt;br /&gt;
A sfx2 based Openoffice.org module should obtain a new slot ID and creates a SID_&amp;lt;COMMAND&amp;gt; definition for it (This is also true for non-sfx2 based modules which wants to create a new global command). It depends on the new command if it is part of the generic commands or only dependent on a single module. The slot must be defined within a SDI file of the chosen project. Generic commands can be part of the sfx2 or svx based SDI files. A module based command must be part of a respective module based SDI file. A already defined command definition can be used as a template, but must be carefully adapted. A very important step is to assign a new command name to the created user interface command. It must be at least unique within the generic and module based configuration file. Please keep in mind that command definitions are &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; case-sensitive and should be carefully chosen. The command cannot be changed after release as it is also part of the dispatch API.&lt;br /&gt;
A user interface command must at least set one of the entries AccelConfig, MenuConfig, StatusBarConfig or ToolBoxConfig to true. Otherwise the command cannot be configured to a user interface element. The slot itself must be added to the correct shell. As the new command can also be part of the menu bar or a toolbar we have to add a new entry within the respective configuration file GenericCommands.xcu or the module dependent configuration file. This depends on the command itself. If the command should be part of the menu bar or a toolbar the command must be added to the XML based configuration file within the module&amp;#039;s project. &lt;br /&gt;
&lt;br /&gt;
==== Images ====&lt;br /&gt;
If the command has associated images you have to do the following additional steps:&lt;br /&gt;
&lt;br /&gt;
Rename all your images to the following schema: &lt;br /&gt;
* sc_&amp;lt;commandname&amp;gt; for small color images&lt;br /&gt;
* lc_&amp;lt;commandname&amp;gt; for large color images&lt;br /&gt;
* sch_&amp;lt;commandname&amp;gt; for small highcontrast images&lt;br /&gt;
* lch_&amp;lt;commandname&amp;gt; for large highcontrast images&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;ATTENTION: The command name must be in a lower case ascii characters!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Copy the files to the following directories: res/commandimagelist, so_res/commandimagelist. If you work on a CWS you have to cwsadd these folders.&lt;br /&gt;
Add a prop node called “Properties” to the command xcu file and set the integer value to the needed value. Please read the section before where this property node is explained.&lt;br /&gt;
If you want to build your CWS you must also add the “framework” project to your CWS. You only need to do a dmake in the util folder to create a commandimagelist.ilst file. It contains the list of all image files within the commandimagelist folder of res and so_res.&lt;br /&gt;
&lt;br /&gt;
Please don&amp;#039;t use the old schema sc&amp;lt;number&amp;gt; as it is outdated and all images using this schema and are related to toolbars or menus will be removed. Their use is deprecated and only the above&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/UCB/Preconfigured_UCBs&amp;diff=111680</id>
		<title>Documentation/DevGuide/UCB/Preconfigured UCBs</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/UCB/Preconfigured_UCBs&amp;diff=111680"/>
		<updated>2009-02-12T13:19:59Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/UCBTOC&lt;br /&gt;
|UCB2b=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/UCB/Unconfigured UCBs&lt;br /&gt;
|NextPage=Documentation/DevGuide/UCB/Content Provider Proxies&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Preconfigured UCBs}}&lt;br /&gt;
A UCB is called &amp;#039;&amp;#039;preconfigured&amp;#039;&amp;#039; if it was given a UCB configuration at the time it was instantiated. A UCB configuration contains a set of UCP registration information. &lt;br /&gt;
&lt;br /&gt;
To create a preconfigured UCB:&lt;br /&gt;
&lt;br /&gt;
# Create an instance of the UNO service &amp;lt;idl&amp;gt;com.sun.star.ucb.UniversalContentBroker&amp;lt;/idl&amp;gt;.&lt;br /&gt;
# Pass the configuration as a parameters to the creation function. The UCB instance returned offers all UCPs defined in the given configuration.&lt;br /&gt;
&lt;br /&gt;
Preconfigured UCB:&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  import com.sun.star.lang.XMultiServiceFactory;&lt;br /&gt;
  import com.sun.star.uno.Exception;&lt;br /&gt;
  import com.sun.star.uno.XInterface;&lt;br /&gt;
  &lt;br /&gt;
  boolean initUCB() {&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      // Obtain Process Service Manager.&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      &lt;br /&gt;
      XMultiServiceFactory xServiceFactory = ...&lt;br /&gt;
      &lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      // Create UCB. This needs to be done only once per process.&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      &lt;br /&gt;
      XInterface xUCB;&lt;br /&gt;
      try {&lt;br /&gt;
          // Supply configuration to use for this UCB instance...&lt;br /&gt;
          String[] keys = new String[2];&lt;br /&gt;
          keys[0] = &amp;quot;Local&amp;quot;;&lt;br /&gt;
          keys[1] = &amp;quot;Office&amp;quot;;&lt;br /&gt;
          &lt;br /&gt;
          xUCB = xServiceFactory.createInstanceWithArguments(&lt;br /&gt;
              &amp;quot;com.sun.star.ucb.UniversalContentBroker&amp;quot;, keys);&lt;br /&gt;
      }&lt;br /&gt;
      catch (com.sun.star.uno.Exception e) {&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      if (xUCB == null)&lt;br /&gt;
          return false;&lt;br /&gt;
      &lt;br /&gt;
      return true;&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
A UCB configuration used by a preconfigured UCB describes a set of UCPs available in a configuration. All UCPs contained in a configuration are registered at the UCB that is created using this configuration. A UCB configuration is identified by two keys that are strings. The keys allow some structuring in the configuration files, but they do not have a purpose. See the example file below. The standard configuration is &amp;quot;Local&amp;quot; and &amp;quot;Office&amp;quot;, that allows access to all UCPs. The XML sample below shows how these keys are used to organize UCB configurations.&lt;br /&gt;
&lt;br /&gt;
The predefined configurations for {{PRODUCTNAME}} are defined in the file &amp;#039;&amp;#039;&amp;lt;OfficePath&amp;gt;/share/config/data/org/openoffice/ucb/Configuration.xcd&amp;#039;&amp;#039;. This file must be adapted to add configurations or edit existing configurations. The XCD file is used during the {{PRODUCTNAME}} build process to generate the appropriate XML file. This XML file is part of a {{PRODUCTNAME}} installation and is located in &amp;#039;&amp;#039;&amp;lt;OfficePath&amp;gt;share/config/registry/instance/org/openoffice/ucb/Configuration.xml&amp;#039;&amp;#039;. The UCB tries to get configuration data from this XML file.&lt;br /&gt;
&lt;br /&gt;
UCB Configuration (&amp;#039;&amp;#039;org/openoffice/ucb/Configuration.xcd&amp;#039;&amp;#039;):&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE schema:package SYSTEM &amp;quot;../schema/schema.description.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:package package-id=&amp;quot;org.openoffice.ucb.Configuration&amp;quot; xml:lang=&amp;quot;en-US&amp;quot;&lt;br /&gt;
  xmlns:schema=&amp;quot;http://openoffice.org/2000/registry/schema/description&amp;quot;&lt;br /&gt;
  xmlns:default=&amp;quot;http://openoffice.org/2000/registry/schema/default&amp;quot;&lt;br /&gt;
  xmlns:cfg=&amp;quot;http://openoffice.org/2000/registry/instance&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;schema:templates template-id=&amp;quot;org.openoffice.ucb.Configuration&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- ContentProvider --&amp;gt;&lt;br /&gt;
  &amp;lt;schema:group cfg:name=&amp;quot;ContentProviderData&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:value cfg:name=&amp;quot;ServiceName&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:value&amp;gt;&lt;br /&gt;
  &amp;lt;schema:value cfg:name=&amp;quot;URLTemplate&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:value&amp;gt;&lt;br /&gt;
  &amp;lt;schema:value cfg:name=&amp;quot;Arguments&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:value&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:group&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- ContentProvidersDataSecondaryKeys --&amp;gt;&lt;br /&gt;
  &amp;lt;schema:group cfg:name=&amp;quot;ContentProvidersDataSecondaryKeys&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:set cfg:name=&amp;quot;ProviderData&amp;quot;&lt;br /&gt;
      cfg:element-type=&amp;quot;ContentProviderData&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:group&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- ContentProvidersDataPrimaryKeys --&amp;gt;&lt;br /&gt;
  &amp;lt;schema:group cfg:name=&amp;quot;ContentProvidersDataPrimaryKeys&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:set cfg:name=&amp;quot;SecondaryKeys&amp;quot;&lt;br /&gt;
      cfg:element-type=&amp;quot;ContentProvidersDataSecondaryKeys&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:group&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:templates&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;schema:component cfg:writable=&amp;quot;true&amp;quot;&lt;br /&gt;
  component-id=&amp;quot;org.openoffice.ucb.Configuration&amp;quot;&lt;br /&gt;
  cfg:notified=&amp;quot;true&amp;quot; cfg:localized=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:set cfg:name=&amp;quot;ContentProviders&amp;quot;&lt;br /&gt;
      cfg:element-type=&amp;quot;ContentProvidersDataPrimaryKeys&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;default:group cfg:name=&amp;quot;Local&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;default:set cfg:name=&amp;quot;SecondaryKeys&amp;quot;&lt;br /&gt;
      cfg:element-type=&amp;quot;ContentProvidersDataSecondaryKeys&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;default:group cfg:name=&amp;quot;Office&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;default:set cfg:name=&amp;quot;ProviderData&amp;quot;&lt;br /&gt;
          cfg:element-type=&amp;quot;ContentProviderData&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
      &amp;lt;!-- Hierarchy UCP --&amp;gt;&lt;br /&gt;
      &amp;lt;default:group cfg:name=&amp;quot;Provider1&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;ServiceName&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data&amp;gt;com.sun.star.ucb.HierarchyContentProvider&amp;lt;/default:data&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;URLTemplate&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data&amp;gt;vnd.sun.star.hier&amp;lt;/default:data&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;Arguments&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data/&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
      &amp;lt;/default:group&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
      &amp;lt;!-- File UCP --&amp;gt;&lt;br /&gt;
      &amp;lt;default:group cfg:name=&amp;quot;Provider2&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;ServiceName&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data&amp;gt;com.sun.star.ucb.FileContentProvider&amp;lt;/default:data&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;URLTemplate&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data&amp;gt;file&amp;lt;/default:data&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;Arguments&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data/&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
      &amp;lt;/default:group&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
      &amp;lt;!-- Other UCPs go here --&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;/default:set&amp;gt;&lt;br /&gt;
      &amp;lt;/default:group&amp;gt;&lt;br /&gt;
      &amp;lt;/default:set&amp;gt;&lt;br /&gt;
  &amp;lt;/default:group&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:set&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:component&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:package&amp;gt;&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Universal Content Broker]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/UCB/Preconfigured_UCBs&amp;diff=111677</id>
		<title>Documentation/DevGuide/UCB/Preconfigured UCBs</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/UCB/Preconfigured_UCBs&amp;diff=111677"/>
		<updated>2009-02-12T13:16:35Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: Fixed array index&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/UCBTOC&lt;br /&gt;
|UCB2b=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/UCB/Unconfigured UCBs&lt;br /&gt;
|NextPage=Documentation/DevGuide/UCB/Content Provider Proxies&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Preconfigured UCBs}}&lt;br /&gt;
A UCB is called &amp;#039;&amp;#039;preconfigured&amp;#039;&amp;#039; if it was given a UCB configuration at the time it was instantiated. A UCB configuration contains a set of UCP registration information. &lt;br /&gt;
&lt;br /&gt;
To create a preconfigured UCB:&lt;br /&gt;
&lt;br /&gt;
# Create an instance of the UNO service &amp;lt;idl&amp;gt;com.sun.star.ucb.UniversalContentBroker&amp;lt;/idl&amp;gt;.&lt;br /&gt;
# Pass the configuration as a parameters to the creation function. The UCB instance returned offers all UCPs defined in the given configuration.&lt;br /&gt;
&lt;br /&gt;
Preconfigured UCB:&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  import com.sun.star.lang.XMultiServiceFactory;&lt;br /&gt;
  import com.sun.star.uno.Exception;&lt;br /&gt;
  import com.sun.star.uno.XInterface;&lt;br /&gt;
  &lt;br /&gt;
  boolean initUCB() {&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      // Obtain Process Service Manager.&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      &lt;br /&gt;
      XMultiServiceFactory xServiceFactory = ...&lt;br /&gt;
      &lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      // Create UCB. This needs to be done only once per process.&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      &lt;br /&gt;
      XInterface xUCB;&lt;br /&gt;
      try {&lt;br /&gt;
          // Supply configuration to use for this UCB instance...&lt;br /&gt;
          String[] keys = new String[2];&lt;br /&gt;
          keys[0] = &amp;quot;Local&amp;quot;;&lt;br /&gt;
          keys[1] = &amp;quot;Office&amp;quot;;&lt;br /&gt;
          &lt;br /&gt;
          xUCB = xServiceFactory.createInstanceWithArguments(&lt;br /&gt;
              &amp;quot;com.sun.star.ucb.UniversalContentBroker&amp;quot;, keys);&lt;br /&gt;
      }&lt;br /&gt;
      catch (com.sun.star.uno.Exception e) {&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      if (xUCB == null)&lt;br /&gt;
          return false;&lt;br /&gt;
      &lt;br /&gt;
      return true;&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
A UCB configuration used by a preconfigured UCB describes a set of UCPs available in a configuration. All UCPs contained in a configuration are registered at the UCB that is created using this configuration. A UCB configuration is identified by two keys that are strings. The keys allow some structuring in the configuration files ), but they do not have a purpose. See the example file below. The standard configuration is &amp;quot;Local&amp;quot; and &amp;quot;Office&amp;quot;, that allows access to all UCPs. The XML sample below shows how these keys are used to organize UCB configurations.&lt;br /&gt;
&lt;br /&gt;
The predefined configurations for {{PRODUCTNAME}} are defined in the file &amp;#039;&amp;#039;&amp;lt;OfficePath&amp;gt;/share/config/data/org/openoffice/ucb/Configuration.xcd&amp;#039;&amp;#039;. This file must be adapted to add configurations or edit existing configurations. The XCD file is used during the {{PRODUCTNAME}} build process to generate the appropriate XML file. This XML file is part of a {{PRODUCTNAME}} installation and is located in &amp;#039;&amp;#039;&amp;lt;OfficePath&amp;gt;share/config/registry/instance/org/openoffice/ucb/Configuration.xml&amp;#039;&amp;#039;. The UCB tries to get configuration data from this XML file.&lt;br /&gt;
&lt;br /&gt;
UCB Configuration (&amp;#039;&amp;#039;org/openoffice/ucb/Configuration.xcd&amp;#039;&amp;#039;):&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE schema:package SYSTEM &amp;quot;../schema/schema.description.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:package package-id=&amp;quot;org.openoffice.ucb.Configuration&amp;quot; xml:lang=&amp;quot;en-US&amp;quot;&lt;br /&gt;
  xmlns:schema=&amp;quot;http://openoffice.org/2000/registry/schema/description&amp;quot;&lt;br /&gt;
  xmlns:default=&amp;quot;http://openoffice.org/2000/registry/schema/default&amp;quot;&lt;br /&gt;
  xmlns:cfg=&amp;quot;http://openoffice.org/2000/registry/instance&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;schema:templates template-id=&amp;quot;org.openoffice.ucb.Configuration&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- ContentProvider --&amp;gt;&lt;br /&gt;
  &amp;lt;schema:group cfg:name=&amp;quot;ContentProviderData&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:value cfg:name=&amp;quot;ServiceName&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:value&amp;gt;&lt;br /&gt;
  &amp;lt;schema:value cfg:name=&amp;quot;URLTemplate&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:value&amp;gt;&lt;br /&gt;
  &amp;lt;schema:value cfg:name=&amp;quot;Arguments&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:value&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:group&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- ContentProvidersDataSecondaryKeys --&amp;gt;&lt;br /&gt;
  &amp;lt;schema:group cfg:name=&amp;quot;ContentProvidersDataSecondaryKeys&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:set cfg:name=&amp;quot;ProviderData&amp;quot;&lt;br /&gt;
      cfg:element-type=&amp;quot;ContentProviderData&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:group&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- ContentProvidersDataPrimaryKeys --&amp;gt;&lt;br /&gt;
  &amp;lt;schema:group cfg:name=&amp;quot;ContentProvidersDataPrimaryKeys&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:set cfg:name=&amp;quot;SecondaryKeys&amp;quot;&lt;br /&gt;
      cfg:element-type=&amp;quot;ContentProvidersDataSecondaryKeys&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:group&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:templates&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;schema:component cfg:writable=&amp;quot;true&amp;quot;&lt;br /&gt;
  component-id=&amp;quot;org.openoffice.ucb.Configuration&amp;quot;&lt;br /&gt;
  cfg:notified=&amp;quot;true&amp;quot; cfg:localized=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;schema:set cfg:name=&amp;quot;ContentProviders&amp;quot;&lt;br /&gt;
      cfg:element-type=&amp;quot;ContentProvidersDataPrimaryKeys&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;default:group cfg:name=&amp;quot;Local&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;default:set cfg:name=&amp;quot;SecondaryKeys&amp;quot;&lt;br /&gt;
      cfg:element-type=&amp;quot;ContentProvidersDataSecondaryKeys&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;default:group cfg:name=&amp;quot;Office&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;default:set cfg:name=&amp;quot;ProviderData&amp;quot;&lt;br /&gt;
          cfg:element-type=&amp;quot;ContentProviderData&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
      &amp;lt;!-- Hierarchy UCP --&amp;gt;&lt;br /&gt;
      &amp;lt;default:group cfg:name=&amp;quot;Provider1&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;ServiceName&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data&amp;gt;com.sun.star.ucb.HierarchyContentProvider&amp;lt;/default:data&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;URLTemplate&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data&amp;gt;vnd.sun.star.hier&amp;lt;/default:data&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;Arguments&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data/&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
      &amp;lt;/default:group&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
      &amp;lt;!-- File UCP --&amp;gt;&lt;br /&gt;
      &amp;lt;default:group cfg:name=&amp;quot;Provider2&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;ServiceName&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data&amp;gt;com.sun.star.ucb.FileContentProvider&amp;lt;/default:data&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;URLTemplate&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data&amp;gt;file&amp;lt;/default:data&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
          &amp;lt;default:value cfg:name=&amp;quot;Arguments&amp;quot; cfg:type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;default:data/&amp;gt;&lt;br /&gt;
          &amp;lt;/default:value&amp;gt;&lt;br /&gt;
      &amp;lt;/default:group&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
      &amp;lt;!-- Other UCPs go here --&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      &amp;lt;/default:set&amp;gt;&lt;br /&gt;
      &amp;lt;/default:group&amp;gt;&lt;br /&gt;
      &amp;lt;/default:set&amp;gt;&lt;br /&gt;
  &amp;lt;/default:group&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:set&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:component&amp;gt;&lt;br /&gt;
  &amp;lt;/schema:package&amp;gt;&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Universal Content Broker]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/UCB/Accessing_a_UCB_Content&amp;diff=111630</id>
		<title>Documentation/DevGuide/UCB/Accessing a UCB Content</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/UCB/Accessing_a_UCB_Content&amp;diff=111630"/>
		<updated>2009-02-12T07:57:08Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: Fixed mistyped method name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/UCBTOC&lt;br /&gt;
|UCB2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/UCB/Instantiating the UCB&lt;br /&gt;
|NextPage=Documentation/DevGuide/UCB/Executing Content Commands&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Accessing a UCB Content}}&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.ucb.XContentIdentifierFactory;com.sun.star.ucb.XContentProvider&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
Each UCB content can be identified using a URL that points to a folder or a document content in the data source you want to work with. To create a content object for a given URL:&lt;br /&gt;
&lt;br /&gt;
# Obtain access to the UCB.&lt;br /&gt;
# Let the UCB create a content identifier object for the requested URL using &amp;lt;code&amp;gt;createContentIdentifier()&amp;lt;/code&amp;gt; at the &amp;lt;idl&amp;gt;com.sun.star.ucb.XContentIdentifierFactory&amp;lt;/idl&amp;gt; of the UCB.&lt;br /&gt;
# Let the UCB create a content object for the content identifier using &amp;lt;code&amp;gt;queryContent()&amp;lt;/code&amp;gt; at the &amp;lt;idl&amp;gt;com.sun.star.ucb.XContentProvider&amp;lt;/idl&amp;gt; interface of the UCB.&lt;br /&gt;
&lt;br /&gt;
The UCB selects a UCP according to the URL contained in the identifier object and dispatches the &amp;lt;code&amp;gt;queryContent()&amp;lt;/code&amp;gt; call to it. The UCP creates the content implementation object and returns it to the UCB, which passes it on to the caller.&lt;br /&gt;
&lt;br /&gt;
Creating a UCB content from a given URL: &lt;br /&gt;
&amp;lt;!--[SOURCE:UCB/Helper.java]--&amp;gt;&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  import com.sun.star.uno.UnoRuntime;&lt;br /&gt;
  import com.sun.star.uno.Xinterface;&lt;br /&gt;
  import com.sun.star.ucb.*;&lt;br /&gt;
  &lt;br /&gt;
  {&lt;br /&gt;
      String aURL = ...&lt;br /&gt;
      &lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      // Obtain access to UCB...&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      &lt;br /&gt;
      XInterface xUCB = ...&lt;br /&gt;
      &lt;br /&gt;
      // Obtain required UCB interfaces XContentIdentifierFactory and XContentProvider&lt;br /&gt;
      XContentIdentifierFactory xIdFactory = (XContentIdentifierFactory)UnoRuntime.queryInterface( &lt;br /&gt;
          XContentIdentifierFactory.class, xUCB);&lt;br /&gt;
      XContentProvider xProvider = (XContentProvider)UnoRuntime.queryInterface(&lt;br /&gt;
          XContentProvider.class, xUCB);&lt;br /&gt;
      &lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      // Obtain content object from UCB...&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      &lt;br /&gt;
      // Create identifier object for given URL.&lt;br /&gt;
      XContentIdentifier xId = xIdFactory.createContentIdentifier(aURL);&lt;br /&gt;
      &lt;br /&gt;
      XContent xContent = xProvider.queryContent(xId);&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Universal Content Broker]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/UCB/Instantiating_the_UCB&amp;diff=111629</id>
		<title>Documentation/DevGuide/UCB/Instantiating the UCB</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/UCB/Instantiating_the_UCB&amp;diff=111629"/>
		<updated>2009-02-12T07:45:01Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: Fixed array index&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/DevGuide/UCBTOC&lt;br /&gt;
|UCB2a=block&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|PrevPage=Documentation/DevGuide/UCB/Using the UCB API&lt;br /&gt;
|NextPage=Documentation/DevGuide/UCB/Accessing a UCB Content&lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:Instantiating the UCB}}&lt;br /&gt;
&amp;lt;!--&amp;lt;idltopic&amp;gt;com.sun.star.ucb.UniversalContentBroker&amp;lt;/idltopic&amp;gt;--&amp;gt;&lt;br /&gt;
The following steps have to be performed before a process can use the UCB:&lt;br /&gt;
&lt;br /&gt;
* Create and set the UNO service manager.&lt;br /&gt;
* Create an instance of the UNO service &amp;lt;idl&amp;gt;com.sun.star.ucb.UniversalContentBroker&amp;lt;/idl&amp;gt;, passing the keys identifying a predefined UCB configuration to &amp;lt;code&amp;gt;createInstanceWithArguments()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There are several predefined UCB configurations. Each configuration contains data that describes a set of UCPs. All UCPs contained in a configuration are registered at the UCB that is created using this configuration. A UCB configuration is identified by two keys that are strings. The standard configuration is &amp;quot;&amp;lt;code&amp;gt;Local&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;Office&amp;lt;/code&amp;gt;&amp;quot;, which generally allows access to all UCPs available in a local installation.&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  import com.sun.star.lang.XMultiServiceFactory;&lt;br /&gt;
  import com.sun.star.uno.Exception;&lt;br /&gt;
  import com.sun.star.uno.XInterface;&lt;br /&gt;
  &lt;br /&gt;
  boolean initUCB() {&lt;br /&gt;
  &lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      // Obtain Process Service Manager.&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      &lt;br /&gt;
      XMultiServiceFactory xServiceFactory = ...&lt;br /&gt;
      &lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      // Create UCB. This needs to be done only once per process.&lt;br /&gt;
      /////////////////////////////////////////////////////////////////////&lt;br /&gt;
      &lt;br /&gt;
      XInterface xUCB;&lt;br /&gt;
      try {&lt;br /&gt;
          // Supply configuration to use for this UCB instance...&lt;br /&gt;
          String[] keys = new String[2];&lt;br /&gt;
          keys[ 0 ] = &amp;quot;Local&amp;quot;;&lt;br /&gt;
          keys[ 1 ] = &amp;quot;Office&amp;quot;;&lt;br /&gt;
          &lt;br /&gt;
          xUCB = xServiceFactory.createInstanceWithArguments(&lt;br /&gt;
              &amp;quot;com.sun.star.ucb.UniversalContentBroker&amp;quot;, keys );&lt;br /&gt;
      }&lt;br /&gt;
      catch (com.sun.star.uno.Exception e) {&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      if (xUCB == null)&lt;br /&gt;
          return false;&lt;br /&gt;
      &lt;br /&gt;
      return true;&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
For information about other configurations, refer to [[Documentation/DevGuide/UCB/Configuration|Configuration]].&lt;br /&gt;
&lt;br /&gt;
{{PDL1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation/Developer&amp;#039;s Guide/Universal Content Broker]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=DomainDeveloper&amp;diff=86531</id>
		<title>DomainDeveloper</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=DomainDeveloper&amp;diff=86531"/>
		<updated>2008-07-14T13:59:40Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A mapping of names to OOo accounts.&lt;br /&gt;
&lt;br /&gt;
Abbrev.:&lt;br /&gt;
&lt;br /&gt;
* PL : Project Lead&lt;br /&gt;
* CL : Project Co-Lead&lt;br /&gt;
* CC : Community Council Member&lt;br /&gt;
* ESC : Engineering Steering Committee Member &lt;br /&gt;
* CVS : has write access to the OOo CVS repository&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name || CVS || @openoffice.org || [[IRC Communication]] || Notes || Affiliation&lt;br /&gt;
|-&lt;br /&gt;
| Volker Ahrendt|| X || va||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Kai Ahrens|| X || ka || Kai_Ahrens ||PL Graphic Applications||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Gene Anaya||   || ganaya||||||&lt;br /&gt;
|-&lt;br /&gt;
| Joost Andrae|| X || ja||ja||CL qa, release testing en-US builds and releasing builds||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Eric Bachard|| X || ericb||ericb2|| CL Education, Mac OSX/Linux PPC port ||Education project&lt;br /&gt;
|-&lt;br /&gt;
| Kai Backman||  || kaib ||KaiB||||&lt;br /&gt;
|-&lt;br /&gt;
| Sascha Ballach|| X || sab||||||&lt;br /&gt;
|-&lt;br /&gt;
| Jayant Balraj Madavi||   || jayant_madavi||aZEN_JM||Connectivity / Database||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Barfurth|| X || jb||JoergB||Configuration Util||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Omer Bar-or|| X || cremlae||cremlae||Mac porting||Google Summer of Code&lt;br /&gt;
|-&lt;br /&gt;
| Mathias Bauer|| X || mba||||PL Writer, CL Framework, XML||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Thorsten Behrens|| X || thb||thorsten||vcl/impress/toolkit visionary||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Thomas Benisch|| X || tbe||||Scripting framework||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Stephan Bergmann|| X || sb||||CL UDK||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Bille|| X || abi||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Éric Bischoff|| X || ebischoff||ebischoff||KDE A/B driver||Bureau Cornavin&lt;br /&gt;
|-&lt;br /&gt;
| Nick Blievers|| X || nick||||IRIX||&lt;br /&gt;
|-&lt;br /&gt;
| Daniel Boelzle|| X || dbo||||UNO core/bridges/packages||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Bolte|| X || obo||||RE||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Rafaella Braconi||   || coni||Rafaella ||PL l10n, Globalization Program Manager||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Michael Brauer|| X || mib||||PL XML||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Braun|| X || obr||obr||System Integration/Accessibility Hacker||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Bregas|| X || ab||||StarBasic||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Brunsmann||   || jbrunsmann||||UDK||&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Budischewski||   || jbu||PyUNO hacker||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Peter Burow|| X  || pb||plumbumm||UI||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Aidan Butler||   || aidan||||XML filters||&lt;br /&gt;
|-&lt;br /&gt;
| Giuseppe Castagno || X || beppec56 || beppec56_  or beppe_c || PDF output&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ScottCarr|Scott Carr]] || X  || kcarr||kcarr||PL Documentation||Progbits&lt;br /&gt;
|-&lt;br /&gt;
| Colin Charles||   || drbyte||bytee||Malaysian native-lang project||bytebot.net&lt;br /&gt;
|-&lt;br /&gt;
| Jinhong Chen ||   || chainchen ||   || || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Xiuzhi Cheng|| X || xzcheng || xiuzhi|| ESC,Xml,ODF|| [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Behrend Cornelius|| X || bc||||Wizards||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Michael Cziebalski||   || mci||||||&lt;br /&gt;
|-&lt;br /&gt;
| [[User:pdefilippis|Pierre de Filippis]]|| X || pdefilippis||aliscafo||Mac OSX native porting||&lt;br /&gt;
|-&lt;br /&gt;
| Andrew Dent|| X ||ace_dent||ace_dent||ui/custom_images||&lt;br /&gt;
|-&lt;br /&gt;
| Naren Devaiah||   || ||ndev||Performance||Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Quangang Dong||   || donqg || dongqg || Layout  || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Nitin Dongre||   || ||nitin_BITS||||Novell, Inc.(intern)&lt;br /&gt;
|-&lt;br /&gt;
| Radek Doulik||   || radekdoulik||rodo_||Canvas hacker||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Carsten Driesner|| X || cd|| cd_oo ||PL Framework||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Yunfen Du || X || duyunfen|| dyf|| Base ||[[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| Herbert Duerr|| X || hdu||hdu_hh||GSL||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Düsterhoff|| X || od||Writer||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Bernd Eilers|| X || bei||rfc821||EIS||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| René Engelhard|| X || rene||_rene_||config_office, Debian packager||Debian&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Pereriksson|Per Eriksson]] || || pereriksson || || CL, MarCon Sweden ||&lt;br /&gt;
|-&lt;br /&gt;
| Yaqiong Fang || X  || fangyq || fangyq|| Graphics|| [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Hubert Figuière|| X || hub || hub || PPTX || Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Andre Fischer|| X || af||||Impress||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Uwe Fischer || X || ufi || ufiooo || Application Help || Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Ken Foskey||   || waratah||waratah||config_office/dmake man||slug.org.au&lt;br /&gt;
|-&lt;br /&gt;
| Duncan Foster||   || dfoster||||||&lt;br /&gt;
|-&lt;br /&gt;
| David Fraser||   || davidfraser||davidfraser||South African translations, multilingual builds||translate.org.za&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Nf|Nils Fuhrmann]]||   || nf||SunNF||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Martin Gallwey|| X || mtg||marty_||XML/Writer/packaging||&lt;br /&gt;
|-&lt;br /&gt;
| Pierre-Andre Galmes || || pagalmes || pagalmes || Chart2 ||StarXpert&lt;br /&gt;
|-&lt;br /&gt;
| Tony Galmiche|| X || tonygalmiche||||CL FR native-lang project||&lt;br /&gt;
|-&lt;br /&gt;
| Sunil Gandhi||   || ||tyro||||NOSIP&lt;br /&gt;
|-&lt;br /&gt;
| Peng Gao ||  || Gao Peng|| Gao Peng || writer|| [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|Zemin Gao ||  || gaozemin|| gaozm || Calc || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Sophie Gautier|| X || sgauti|| sophi ||PL FR native-lang project, CC ||.&lt;br /&gt;
|-&lt;br /&gt;
| Vladimir Glazounov|| X || vg||||RE||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Laurent Godard || X || laurentgodard || lgodard || CC, PL Extensions, Fr Native-lang Project || inDesko/Nuxeo &lt;br /&gt;
|-&lt;br /&gt;
| Jody Goldberg|| X || jodygoldberg||jody||[[Calc]] spreadsheet-ness||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Dirk Grobler|| X || dg||||Database Access||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Sg|Steffen Grund]]|| X || sg|| || NetBeans Integration ||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Bettina Haberer||   || bh||||RFEOwner||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Ingrid Halama|| X || iha||||Chart||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Chris Halls|| X || haggai||haggai||Debian packager&amp;amp;amp;misc. hacker||Credativ Ltd., Debian&lt;br /&gt;
|-&lt;br /&gt;
| Gregor Hartmann|| X || gh|| Lachs ||Testtool, gsicheck, buildbot||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Bustamam Harun||   || bustamam||||Malaysian stuff||&lt;br /&gt;
|-&lt;br /&gt;
| Kevin Hendricks|| X || khendricks||||PL Lingucomponent, PowerPC||&lt;br /&gt;
|-&lt;br /&gt;
| Con Hennessy||   || cphennessy||cph2 or cph_||hacker &amp;amp;amp; former council person||OpenApp&lt;br /&gt;
|-&lt;br /&gt;
| Ivo Hinkelmann|| X || ihi||ivo||l10n tooling/general/RE||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Eric Hoch|| X || maveric||mav_eric||Mac Porting||&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Lutz_Hoeger|Lutz Hoeger]]|| X || lh ||lutzh||PL [http://ux.openoffice.org User Experience]||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Jan Holešovský|| X || kendy||kendy||KDE integration||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Martin Hollmichel|| X || mh||Ratte/Nesshof||Build Maestro, PL External, Tools, Porting, CC||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Karl Hong|| X || khong||||i18n, CJK expert||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Matthias Huetsch|| X || mhu||||Performance/strategy, PL UCB, CC, ESC||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Michael Hönnig|| X || mi||||PL API||&lt;br /&gt;
|-&lt;br /&gt;
| [[User:icobgr|Hristo Hristov]] ||   || icobgr || icobgr || PL Bulgarian native-lang project ||&lt;br /&gt;
|-&lt;br /&gt;
| Sven Jacobi|| X || sj||||Escherwizard||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Jahnke||   || jj||||tooling||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Christian Jansen||   || cj ||||Menu and Toolbar?||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Ocke Janssen|| X || oj||Base||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Pavel Janík|| X || pjanik||paveljanik||PL Czech native-lang project, CL l10n, CC, ESC, l10n builds||&lt;br /&gt;
|-&lt;br /&gt;
| Berry Jia|| X || berryjia||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Chuang Jiang ||   || jiangc ||   || || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Jingchuan Kang||   || kangjingchuan || jingchuan || Surrogates in Unicode || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Pascal Junck||   || pjunck||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:pj@openoffice.org|Peter Junge]]|| X || pj|| peter13j|| OOo community contact for my Chinese Employer, QA||[[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Christian Junker||   || Cyb||christianju||API||Trees For Life&lt;br /&gt;
|-&lt;br /&gt;
| Etsushi Kato || X || ekato ||   || Mac OS X Port || Independent &lt;br /&gt;
|-&lt;br /&gt;
| Hirano Kazunari||   || khirano||||Japanese||&lt;br /&gt;
|-&lt;br /&gt;
| Dhananjay Keskar|| X || dkeskar ||dkeskar||Performance,Buildbot,cat-herder||Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Robert Kinsella||   || rkinsella||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Volodymyr Khrystynych||   || volody||||XML Filter||&lt;br /&gt;
|-&lt;br /&gt;
| Matthias Klose||   || doko||doko||Ubuntu, gcc, python packager||Canonical, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Laszlo Kovacs||   || lkovacs||||Documentation||&lt;br /&gt;
|-&lt;br /&gt;
| Tobias Krause|| X || tkr||||ucb||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Martin Kretzschmar|| X || mkretzschmar||martink||Gnome / Debian||Student&lt;br /&gt;
|-&lt;br /&gt;
| Will Lachance||   || wlach||wlach_||Word Perfect File Filters||Net Integration Technologies, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Thomas Lange|| X || tl||tl13||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Lars Langhans|| X || lla||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Hans-Joachim Lankenau|| X || hjs||ause||dmake makefile expert, RE||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Németh László|| X || nemeth||||PL lingucomponent||&lt;br /&gt;
|-&lt;br /&gt;
| Jakob Lechner|| X || jakob_lechner||||Writer||Fabalabs&lt;br /&gt;
|-&lt;br /&gt;
| Michael Leibowitz||  X || mikeleib ||mikeleib||performance||Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Wind Li|| X || windly||||Address books||&lt;br /&gt;
|-&lt;br /&gt;
|Jian Li ||   || lijian || lijian|| Writer|| [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|Yuan  Li ||   || liyuan ||   || PyUNO, Async dialogs || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|Weike Liang ||   || liangweike || liangweike || Graphics || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Ping Liao||   || pliao||||||&lt;br /&gt;
|-&lt;br /&gt;
| Tor Lillqvist|| X || tml||tml_||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Joachim Lingner|| X || jl||||Java, CLI||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Christian Lippka|| X || cl || cl ||Graphic Applications||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Mindy Liu||   || mindyliu||||||&lt;br /&gt;
|-&lt;br /&gt;
|Jianli Liu ||  || liujl|| liujianli || Graphics|| [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|[[User:liutao | LiuTao]]   || X  || liutao || liutao  || PyUNO, Async dialogs,slideshow,modularization in SW || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|YU Liu || X  || ch2000liuy || LiuYU  || Swriter || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|Yuhua Liu ||  || liuyuhua|| yuhua|| ||[[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Dl|Dieter Loeschky]]|| X || dl ||||PL: ODF Toolkit||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Philipp Lohmann|| X || pl||PhilippL||VCL/X11 (GSL) hacker||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Michel Loiseleur|| || mloiseleur|| coren`|| Bugfixes ||Linagora&lt;br /&gt;
|-&lt;br /&gt;
| Jackson Low|| X || xxjack12xx||||Porting||&lt;br /&gt;
|-&lt;br /&gt;
| Patrick Luby||   || pluby||||Mac||&lt;br /&gt;
|-&lt;br /&gt;
|Jingrong Luo ||  || Luo Jingrong|| Luo Jingrong|| ||[[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|Xugang Lv ||   || lvxg || lvxg || XML Writer || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Prasad Madhav || X || pmadhav || pmadhav || Buildbot || Intern@Intel &lt;br /&gt;
|-&lt;br /&gt;
| Babak Mahbod||   || bmahbod||||||&lt;br /&gt;
|-&lt;br /&gt;
| Martin Maher||   || mmaher||||Writer &amp;amp;amp; Filter chap||&lt;br /&gt;
|-&lt;br /&gt;
| Nakata Maho|| X || maho||_maho_||PL QA, PL JA, FreeBSD guy||Independent&lt;br /&gt;
|-&lt;br /&gt;
|Yonggang Mao || X || maoyonggang|| maoyg|| Calc ||[[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|Yue Lv ||  || lvyue || lvyue || Calc ||[[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| John Marmion|| X || jmarmion||||||&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Martens|| X || ama||||PL Writer||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
|-|&lt;br /&gt;
| Shane M Mathews|| X || smmathews|| smmathews ||[[Impress:_OpenGL_rendered_transitions]]||student&lt;br /&gt;
|-&lt;br /&gt;
| Frank Mau|| X || fma||||tooling||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:smsm1|Shaun McDonald]] || X || smsm1 || shaunmcdonald || Mac Port, buildbot MacPort1 || Graduate&lt;br /&gt;
|-&lt;br /&gt;
| Caolán McNamara|| X || cmc||caolan||CL Writer &amp;amp;amp; Filter man||RedHat, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Meeks|| X || mmeeks||michael_||ugly hack-er, ESC||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Frank Meies|| X || fme||||Writer||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Federico Mena-Quintero||   || federicomena||federico||perfectionist||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ismael Merzaq|| X || isma87||ismael_||Mac OSX native porting||Student&lt;br /&gt;
|-&lt;br /&gt;
| Michael Mi||   || mmi||||||&lt;br /&gt;
|-&lt;br /&gt;
| Björn Michaelsen|| X || b_michaelsen ||Sweetshark|| ||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Björn Milcke|| X || bm||bm_||Chart||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Petr Mladek||   || pmladek||pmladek||SUSE RPMs, ooo-build releases||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Cyrille Moureaux|| X || cyrillem||Cyrille||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Mmp|Matthias Müller-Prove]]|| X || mmp|| mprove|| [[User Experience]], http://ux.openoffice.org || Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Takashi Nakamoto|| || bluedwarf|| || ||&lt;br /&gt;
|-&lt;br /&gt;
| Jan Navrátil || X || jnavrati || jnavrati || || RedHat, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Niklas Nebel|| X || nn||||PL [[Calc]]||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Christoph Neumann|| X || cn||||[[UnoApiTest]]||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Frank Neumann|| X || fne||||MacPort||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| NicelKM|| X || mnicel||nicel||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jan Nieuwenhuizen|| X || jcn||janneke||Layout code, hacker ||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bertram Nolte||   || bnolte||||||&lt;br /&gt;
|-&lt;br /&gt;
| Tomas O&amp;#039;Connor||   || toconnor||||Scripting Framework||&lt;br /&gt;
|-&lt;br /&gt;
| Maximilian Odendahl|| X  || mod||mod||[[Notes2]]|| Student / SEPT-Solutions&lt;br /&gt;
|-&lt;br /&gt;
| Lars Oppermann|| X || lo||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Rodrigo Parra Novo|| X || rodarvus||rodarvus||Gnumeric/Abiword OpenDocument Format support and port to Maemo||INdT (Instituto Nokia de Tecnologia)&lt;br /&gt;
|-&lt;br /&gt;
| Edward Peterlin|| X || OPENSTEP||||Mac||&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Fpe|Frank Peters]]|| X || fpe||||CL Documentation||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Christof Pintaske|| X || cp||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Ron Piterman||   || rpiterman||||||&lt;br /&gt;
|-&lt;br /&gt;
| Sebastien Plisson|| X  || plipli||plipli||Developer on Aqua port||OO Aqua Port&lt;br /&gt;
|-&lt;br /&gt;
| Noel Power||   || npower||noelp||VBA Interop, Scripting||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Nikolai Pretzell|| X || np || ||Autodoc, code quality||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Jonathan Pryor|| || jpryor || jonp || || Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Canghua Qu||  || quch || Canghua || AutoTest, Graphics || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Volker Quetschke|| X || vq||vq||W32-tcsh/bash build environment and dmake Hacker, ESC||Gravity Waves&lt;br /&gt;
|-&lt;br /&gt;
| Tino Rachui|| X || tra||tinor||GSL/Unix Hacker||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Kr|Kay Ramme]]|| X || kr||||PL UDK||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ErAck|Eike Rathke]]|| X || er||erAck||CL [[Calc]], engine; CL i18n; stricken with number formatter||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Michael Rauch|| X || mrauch||||NetBSD||&lt;br /&gt;
|-&lt;br /&gt;
| Jens-Heiner Rechtien|| X || hr||blauwal||RE; OOo SCM (CVS, CWS tooling); Porting; Compilers||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Daniel Rentz|| X || dr|| drr ||[[Calc]] Excel filter, UI||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Florian Reuter|| X || flr||||Writer filters||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Georg Richter|| X || grichter||georg||Base, native MySQL driver||MySQL AB&lt;br /&gt;
|-&lt;br /&gt;
| G. Roderick Singleton||   || grsingleton||grsingleton||Documentation||pathtech.org&lt;br /&gt;
|-&lt;br /&gt;
| Hennes Rohling|| X || hro||||GSL &amp;amp;amp; Util||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Bibek Sahu||   || Bibek||bibek||Impress pieces||Trees For Life&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Schlüns|| X || as||||Framework||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Ingo Schmidt|| X || is||||(Native) Installation||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Jsc|J&amp;amp;uuml;rgen Schmidt]]|| X || jsc||jsc||PL API, CL Extensions, UNO, SDK||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Stephan Schäfer|| X || ssa||ssa||VCL||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Frank Schönheit|| X || fs||FrankS||Database Access, Forms||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Stella Schulze|| X || sts||||Visual Design||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Julian Seward || || sewardj || || valgrind ||&lt;br /&gt;
|-&lt;br /&gt;
| Darragh Sherwin||   || dsherwin||darragh||E-Legislation / E-GovSystems||Propylon&lt;br /&gt;
|-&lt;br /&gt;
|Lei shi ||  || shilei|| sl || Graphics|| [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|Zhoubo  Shi ||   || shizhoubo ||   || || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Raul Siddhartha||   || rsiddhartha||raul||GTK File Selector||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Sarah Smith||   || ssmith||||||&lt;br /&gt;
|-&lt;br /&gt;
| [[User:mox|Mox Soini]] || X || mox || Moxed || Mac Porting || &lt;br /&gt;
|-&lt;br /&gt;
| Rajesh Sola||   || rajeshsola||sola||misc.||NOSIP&lt;br /&gt;
|-&lt;br /&gt;
| Kai Sommerfeld|| X || kso||||manager &amp;amp;amp; hacker||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Specht|| X || os||||PL UI||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Spindler||   || jspindler||||||&lt;br /&gt;
|-&lt;br /&gt;
| Fridrich Štrba|| X || fridrich_strba||Fridrich||Word Perfect Hacker||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Keith Stribley|| X || kstribley||||Graphite fonts, Myanmar l10n||&lt;br /&gt;
|-&lt;br /&gt;
| Ulf Stroehler||   || us||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Muthusuba|Muthu Subramanian]]|| X || muthusuba||muthusuba||misc.||&lt;br /&gt;
|-&lt;br /&gt;
| Louis Suárez-Potts||   || louis||louis||Community Manager||Collab.net&lt;br /&gt;
|-&lt;br /&gt;
| Claus Sørensen||   || cs||c26n,cHBs,chbs||Danish Localization and Project Management Tool(oopm)||ProFOSS&lt;br /&gt;
|-&lt;br /&gt;
|Quanfa Tang ||  || tqfa|| tangquanfa|| Calc || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| David Tardon || X || dtardon || dtardon || || [[Red Hat Inc.]]&lt;br /&gt;
|-&lt;br /&gt;
| Stefan Taxhet|| X || st||stx12||CC, interpersonal problem fixer||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Armin Theissen||   || armin||||||&lt;br /&gt;
|-&lt;br /&gt;
| Caio Tiago Oliveira|| X || asrail||asrail||CL QA, release testing pt-BR builds||BrOffice.org&lt;br /&gt;
|-&lt;br /&gt;
| Jan Tietjens||   || tietjens||||||&lt;br /&gt;
|-&lt;br /&gt;
| Rüdiger Timm|| X || rt|| rtimm ||RE||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:mt|Malte Timmermann]]|| X || mt|| Malte || Accessibility, Security, Performance||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Gerhard Tonn||   || tonn||||s390||&lt;br /&gt;
|-&lt;br /&gt;
| Willem van Dorp||   || willem.vandorp||||||&lt;br /&gt;
|-&lt;br /&gt;
| Tom Verbeek|| X || tv||||Wizards, Art team||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Sander Vesik||   || svesik||||||&lt;br /&gt;
|-&lt;br /&gt;
| Daniel Vogelheim|| X || dvo||||XML||&lt;br /&gt;
|-&lt;br /&gt;
| Mikhail Voitenko|| X || mav||mav||Framework||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Robert Vojta|| X || rvojta||rvojta||VBA Interop||&lt;br /&gt;
|-&lt;br /&gt;
| Dirk Völzke|| X || dv||||Installation||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Sparcmoz|Jim Watson]]|| X || sparcmoz|| sparcmoz||GNU Linux sparc porter||clug.org.au&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Weiz |Zhao Wei ]] ||   || weiz || weiz || chart, AODL  || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Armin Weiss|| X || aw||||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Gerd Weiss|| X || gm||||RE||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Dan Williams|| X || fa||dcbw||Mac et. al. hacker||RedHat, Inc.&lt;br /&gt;
|-&lt;br /&gt;
|[[User:wuy|Yan Wu]] || X || wuy ||   ||Framework || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Stephan Wunderlich|| X || sw||||||&lt;br /&gt;
|-&lt;br /&gt;
|Dehua Xu ||   || xudehua || xudh  || Release || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Kohei Yoshida|| X || kohei||kohei_||[[Calc]] hacker, Calc optimization solver developer||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| George Zahopoulos|| X || georgez||||||&lt;br /&gt;
|-&lt;br /&gt;
| Kurt Zenker|| X || kz||smoketester||RE||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
|Huajun Zhang ||  || zhanghuajun|| zhanghj|| SW ||[[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|[[User:Zhangxiaofei|Xiaofei Zhang]]||  || Zhangxiaofei || zhangxiaofei/FelixZ || [[Framework]] ||[[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
|Jianwei Zhao ||   || zhaojianwei || zhaojianwei ||  Swriter  || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Sheng zhao|| X  || jacky23 ||   ||OdfToolKit_odf4j || [[Beijing Redflag Chinese 2000 Software Co., Ltd.|Beijing Redflag CH2000]]&lt;br /&gt;
|-&lt;br /&gt;
| Claudio F Filho||   || filhocf||filhocf||Brazilian portuguese Localization||BrOffice.org&lt;br /&gt;
|-&lt;br /&gt;
| Xiaoyang Yu||   || || ||Disk block reordering||Intel Corporation &lt;br /&gt;
|- &lt;br /&gt;
| Antonio Xu|| X || antoxu || antoxu || Async dialogs, PRC improvements || Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Rail Aliev || X  || rail || rail ||  Ru and Tr NL Co-lead || Infra-Resource &lt;br /&gt;
|-&lt;br /&gt;
| Jeremy Zheng|| X || zhiming || Jeremy || Async dialogs, PRC improvements || Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Schmidtm|Matthias Schmidt]] ||   || schmidtm || schmidtm || Mac OSX Aqua Port || Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Yuri Dario ||   || ydario || Paperino || OS/2 Port || Serenity Systems intl&lt;br /&gt;
|-&lt;br /&gt;
| Fong Lin || X  || pflin || Fong  || CJK Enhancement/ Filter || Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| [[User:jza|Alexandro Colorado]]|| X || jza || jza|| CL [[OOoES|ES]] || &lt;br /&gt;
|-&lt;br /&gt;
| Sunil Amitkumar Janki || || sjanki || sjanki || GNU Linux mipsel porter || &lt;br /&gt;
|-&lt;br /&gt;
| [[User:Rescue|Joey Stanford]] ||  || Rescue/k0fcc || Rinchen || CL [http://eo.openoffice.org/ Esperanto native-lang project] || [http://canonical.com Canonical] ||&lt;br /&gt;
|-&lt;br /&gt;
| Mingfei Jia || X  || jiamingfei ||   || Lotus Smart Suite filter || IBM Corp.&lt;br /&gt;
|-&lt;br /&gt;
| Xing Li || X  || lixxing ||   || Accessibility || IBM Corp.&lt;br /&gt;
|-&lt;br /&gt;
| Wei Guo SHI || X  || shiwg ||   || Accessibility and Smart Suite filter || IBM Corp.&lt;br /&gt;
|-&lt;br /&gt;
| Takashi Ono || X  || tono ||   || MinGW port || Independent&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== QA Engineers ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name ||CVS||@openoffice.org || [[IRC Communication]] || Interested modules || Notes || Affiliation&lt;br /&gt;
|-&lt;br /&gt;
| Stefan Baltzer||||sba||||writer||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Thorsten Bosbach||X||tbo||||framework, qa/qatesttool||QA Framework / Automation||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Craemer||X||oc||||[[Calc]]||QA Calc / Automation||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Helge Delfs||X||hde||||writer, qa/qatesttool||QA Writer / Automation||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Fredrik Haegg||X||fha||||draw, impress, qa/qatesttool||QA Graphics / Automation||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Hasan Ilter||||hi||||writer, printing, pdf export||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Michael Rüß||||mru||||writer, word im/export||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Éric Savary||||es||||writer, accessibility||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:jsi|Joerg Sievers]]||X||jsi||jogi||qa/qatesttool, [[Calc]]||Automation / QA Calc||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Joerg Skottke||X||jsk||skotti||framework, qa/qatesttool||QA Framework / Automation||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Marc Neumann||X||msc||||database, qa/qatesttool||QA Base / Automation||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Chris Lukasiak||||clu||||database||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Frank Stecher||||fst||||[[Calc]]||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Jack Warchold|||| jw||||writer, import/export filters||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Uwe Luebbers||||ul||||framework||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Thorsten Martens||||tm||||framework||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Olaf Felka|||| of||||framework, installation||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Thomas Klarhoefer||||kla||||chart||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Wolfram Garten|||| wg||||draw, impress||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| Christian Guenther||||cgu||||draw, impress||||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Thorsten_Ziehm|Thorsten Ziehm]]||||| thorstenziehm||||||QA lead||Sun Microsystems&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are tracking pending JCAs in the document [[Pending JCAs]].&lt;br /&gt;
&lt;br /&gt;
== Related Pages ==&lt;br /&gt;
* [[Commit Rights]]&lt;br /&gt;
* [[Contributing Patches]]&lt;br /&gt;
* [[User Experience Community]]&lt;br /&gt;
* A map of OOo developers around the world is available at http://www.frappr.com/ooodev, please add yourself to the map if you&amp;#039;re involved in OOo development. It&amp;#039;s just fun to see who&amp;#039;s where :-)&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Alpha Centauri]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Writing_warning-free_code&amp;diff=86166</id>
		<title>Writing warning-free code</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Writing_warning-free_code&amp;diff=86166"/>
		<updated>2008-07-10T06:21:07Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We are currently on the way towards a completely warning-free OOo C/C++ code base.  And once we have reached that, we want to keep the code clean!&lt;br /&gt;
&lt;br /&gt;
We reached a first milestone by integrating CWS [http://eis.services.openoffice.org/EIS2/servlet/cws.showCWS?Id=2903&amp;amp;Path=SRC680%2Fwarnings01 warnings01] into SRC680m173.  Since then, and at least on the &amp;lt;code&amp;gt;unxlngi6&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsoli4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsols4&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;wntmsci10&amp;lt;/code&amp;gt; platforms, the C/C++ compilers are used with rather aggressive warning levels, and in most CVS modules warnings are treated as errors that break the build.  Some CVS modules have not yet been made warning-free.&lt;br /&gt;
&lt;br /&gt;
==What changed?==&lt;br /&gt;
&lt;br /&gt;
Since SRC680m173, any new or modified C/C++ code that produces warnings will break the build.  Ideally, to be sure that integrating a CWS will not break the build, the CWS should now be built on every warning-free platform (i.e., at least &amp;lt;code&amp;gt;unxlngi6&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsoli4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsols4&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;wntmsci10&amp;lt;/code&amp;gt;), with all supported compiler versions, in both product and non-product variants, and with and without the &amp;lt;code&amp;gt;debug=x&amp;lt;/code&amp;gt; build switch before nominating it for integration.  Practically, a reasonable subset of these will have to suffice.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;code&amp;gt;unxlngi6&amp;lt;/code&amp;gt;, we concentrated on GCC&amp;amp;nbsp;3.4.1, GCC 4.0.2/4.0.3, and GCC&amp;amp;nbsp;4.1.1, while other GCC versions probably produce slightly different warnings (that could break the build now on those GCC versions).&lt;br /&gt;
&lt;br /&gt;
Porters are encouraged to make additional platforms warning-free.  Since most ports are using GCC, there should not be too many surprises.  Any necessary changes to the platform-specific &amp;lt;code&amp;gt;.mk&amp;lt;/code&amp;gt; file in &amp;lt;code&amp;gt;solenv/inc&amp;lt;/code&amp;gt; can be modelled after &amp;lt;code&amp;gt;solenv/inc/unxlngi6.mk&amp;lt;/code&amp;gt;.  In short, you need a bunch of &amp;lt;code&amp;gt;CFLAGSxxx&amp;lt;/code&amp;gt; (see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&amp;amp;msgNo=758 interface-announce C/C++ compiler warnings]) and &amp;lt;code&amp;gt;MODULES_WITH_WARNINGS&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;COMPILER_WARN_ERRORS&amp;lt;/code&amp;gt; (see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&amp;amp;msgNo=942 interface-announce MODULES_WITH_WARNINGS]).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;wall=x&amp;lt;/code&amp;gt; build switch no longer has any effect on the warning-free platforms.  Once all platforms are warning-free, we can remove it completely.&lt;br /&gt;
&lt;br /&gt;
==The missing modules==&lt;br /&gt;
&lt;br /&gt;
If your job is to clean up a given CVS module, here are some practical guidelines:&lt;br /&gt;
* Remove the module from the &amp;lt;code&amp;gt;MODULES_WITH_WARNINGS&amp;lt;/code&amp;gt; list in the platform-specific &amp;lt;code&amp;gt;.mk&amp;lt;/code&amp;gt; files in &amp;lt;code&amp;gt;solenv/inc&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Make sure your module builds and delivers successfully with &amp;lt;code&amp;gt;build &amp;amp;&amp;amp; deliver&amp;lt;/code&amp;gt; (and all the variants mentioned above).&lt;br /&gt;
* If your module contains external code which we do not want to clean up, set &amp;lt;code&amp;gt;EXTERNAL_WARNINGS_NOT_ERRORS := TRUE&amp;lt;/code&amp;gt; at the beginning of the corresponding &amp;lt;code&amp;gt;makefile.mk&amp;lt;/code&amp;gt;, so that warnings do not lead to errors there.&lt;br /&gt;
* In any case, for any header file delivered from your module, make sure that &amp;lt;code&amp;gt;testhxx&amp;lt;/code&amp;gt; on the delivered header file is successful.  (Note that &amp;lt;code&amp;gt;testhxx&amp;lt;/code&amp;gt; only works for headers delivered to the solver, not for local headers within a CVS module, as it calls the compiler with only a fixed set of include directories.)&lt;br /&gt;
* If you encounter a warning that cannot reasonably be worked around, discuss that problem on &amp;lt;code&amp;gt;dev@openoffice.org&amp;lt;/code&amp;gt;.  One outcome of that discussion can be that we globally disable that particular warning.  To see which warnings are already globally disabled on a given platform, look at the settings for &amp;lt;code&amp;gt;CFLAGSWARNCC&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CFLAGSWARNCXX&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CFLAGSWALLCC&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;CFLAGSWALLCXX&amp;lt;/code&amp;gt; in the platform-specific &amp;lt;code&amp;gt;.mk&amp;lt;/code&amp;gt; file in &amp;lt;code&amp;gt;solenv/inc&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;unxlngi6.mk&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsoli4.mk&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsols4.mk&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;wntmsci10.mk&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
See the current [[Warning-free_code_status|warning-free code status]].&lt;br /&gt;
&lt;br /&gt;
==Tips for Warning-free code==&lt;br /&gt;
&lt;br /&gt;
The following is a list of issues you might come across when making existing&lt;br /&gt;
code warning-free, or when writing new, warning-free code:&lt;br /&gt;
&lt;br /&gt;
===Integral conversions===&lt;br /&gt;
&lt;br /&gt;
Sometimes, a cast between integral types is needed to avoid a warning.  In such a case, use &amp;lt;code&amp;gt;sal::static_int_cast&amp;lt;/code&amp;gt;&amp;amp;nbsp;(C++) or &amp;lt;code&amp;gt;SAL_INT_CAST&amp;lt;/code&amp;gt;&amp;amp;nbsp;(C) to make that cast stick out&amp;amp;mdash;it will need to be adapted when the type of any of the involved expressions changes later on:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Int32 n;&lt;br /&gt;
std::vector&amp;lt;char&amp;gt; v;&lt;br /&gt;
if (n &amp;gt;= 0 &amp;amp;&amp;amp; sal::static_int_cast&amp;lt;sal_uInt32&amp;gt;(n) == v.size()) ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you might get the warning C4244 (possible loss of data) on Windows also for the following situation:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
short a = 0, b = 0;&lt;br /&gt;
a += b;  // warning C4244 on Windows&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is because &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; are converted to &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, then added and the result is then again cast back to &amp;lt;code&amp;gt;short&amp;lt;/code&amp;gt;. This is especially nasty, as it also happens when you use &amp;lt;code&amp;gt;xub_StrLen&amp;lt;/code&amp;gt;, but only if it is a typedf to &amp;lt;code&amp;gt;USHORT&amp;lt;/code&amp;gt; and not to &amp;lt;code&amp;gt;sal_uInt32&amp;lt;/code&amp;gt;, i.e. only as long as &amp;lt;code&amp;gt;STRING32&amp;lt;/code&amp;gt; is not defined in solar.h.&lt;br /&gt;
The warning does not occur when you use &amp;lt;code&amp;gt;operator+&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;operator+=&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
short a = 0, b = 0;&lt;br /&gt;
a = a + b;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid enum case values===&lt;br /&gt;
&lt;br /&gt;
Code like&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
enum E { A=1, B=2, C=4 } e;&lt;br /&gt;
switch (e) {&lt;br /&gt;
case A: ...&lt;br /&gt;
case B|C: ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will cause &amp;lt;code&amp;gt;wntmsci11&amp;lt;/code&amp;gt; to complain with &amp;lt;code&amp;gt;warning C4063: case &amp;#039;6&amp;#039; is not a valid value for switch of enum &amp;#039;E&amp;#039;&amp;lt;/code&amp;gt;. This can be worked around by promoting &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt; to is underlying integral type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
switch (+e) {&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I think the compiler warning is perfectly valid there (although a little misleading). There is a simple reason for it: because of C++ computing rules for operator|, the second case statement (B|C) has type int and value 6, whilst compiler expects it to have type E. There is not automatic conversion from int to enumeration type; even if there were one, no enumerator from E has value 6. So, in the &amp;quot;work around&amp;quot;, the second case statement is actually &amp;#039;&amp;#039;unreachable&amp;#039;&amp;#039; (well, suppose there are no explicit casts in assignment to e)!&lt;br /&gt;
&lt;br /&gt;
What the author probably wanted is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
switch (e) {&lt;br /&gt;
case A: ...&lt;br /&gt;
case B:  // No code, falls through to the next statement&lt;br /&gt;
case C: ...  // The code of the original B|C branch&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- dt&lt;br /&gt;
&lt;br /&gt;
===Casting between pointer and integer types===&lt;br /&gt;
&lt;br /&gt;
====C++====&lt;br /&gt;
&lt;br /&gt;
* From pointer-to-(possibly-cv-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; to unsigned integral type&amp;amp;nbsp;&amp;lt;code&amp;gt;U&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
P p;&lt;br /&gt;
U u = sal::static_int_cast&amp;lt;U&amp;gt;(reinterpret_cast&amp;lt;sal_uIntPtr&amp;gt;(p));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From unsigned integral type&amp;amp;nbsp;&amp;lt;code&amp;gt;U&amp;lt;/code&amp;gt; to pointer-to-(possibly-cv-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
U u;&lt;br /&gt;
P p = reinterpret_cast&amp;lt;P&amp;gt;(sal::static_int_cast&amp;lt;sal_uIntPtr&amp;gt;(u));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From pointer-to-(possibly-cv-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; to signed integral type&amp;amp;nbsp;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
P p;&lt;br /&gt;
S s = sal::static_int_cast&amp;lt;S&amp;gt;(reinterpret_cast&amp;lt;sal_IntPtr&amp;gt;(p));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From signed integral type&amp;amp;nbsp;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt; to pointer-to-(possibly-cv-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
S s;&lt;br /&gt;
P p = reinterpret_cast&amp;lt;P&amp;gt;(sal::static_int_cast&amp;lt;sal_IntPtr&amp;gt;(s));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====C====&lt;br /&gt;
&lt;br /&gt;
* From pointer-to-(possibly-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; to unsigned integer type&amp;amp;nbsp;&amp;lt;code&amp;gt;U&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
P p;&lt;br /&gt;
U u = SAL_INT_CAST(U, (sal_uIntPtr) p);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From unsigned integer type&amp;amp;nbsp;&amp;lt;code&amp;gt;U&amp;lt;/code&amp;gt; to pointer-to-(possibly-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
U u;&lt;br /&gt;
P p = (P) SAL_INT_CAST(sal_uIntPtr, u);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From pointer-to-(possibly-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; to signed integer type&amp;amp;nbsp;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
P p;&lt;br /&gt;
S s = SAL_INT_CAST(S, (sal_IntPtr) p);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From signed integer type&amp;amp;nbsp;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt; to pointer-to-(possibly-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
S s;&lt;br /&gt;
P p = (P) SAL_INT_CAST(sal_IntPtr, s);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pointer to function===&lt;br /&gt;
&lt;br /&gt;
A pointer to function is not compatible with a pointer to object, so code like&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void * osl::Module::getSymbol(rtl::OUString const &amp;amp;);&lt;br /&gt;
typedef void (* MyFunc)();&lt;br /&gt;
MyFunc f = module.getSymbol(&amp;quot;myFunc&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will not compile.  The only places were converting between pointer to function and pointer to object (typically &amp;lt;code&amp;gt;void *&amp;lt;/code&amp;gt;) should be necessary are &amp;lt;code&amp;gt;osl::Module::getSymbol&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;osl::Module::getUrlFromAddress&amp;lt;/code&amp;gt;, and in both cases there are additional functions (&amp;lt;code&amp;gt;osl::Module::getFunctionSymbol&amp;lt;/code&amp;gt; and an overload with &amp;lt;code&amp;gt;oslGenericFunction&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;osl::Module::getUrlFromAddress&amp;lt;/code&amp;gt;) that handle the problem internally.  Use them!&lt;br /&gt;
&lt;br /&gt;
===Name hiding===&lt;br /&gt;
&lt;br /&gt;
In C++, use a &amp;lt;code&amp;gt;using&amp;lt;/code&amp;gt; declaration to make visible (virtual) function declarations from a base clase that would be hidden by a function declaration in a derived class:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class Base {&lt;br /&gt;
public:&lt;br /&gt;
  virtual void f(int);&lt;br /&gt;
  virtual void f(double);&lt;br /&gt;
};&lt;br /&gt;
class Derived: public Base {&lt;br /&gt;
public:&lt;br /&gt;
  using Base::f;&lt;br /&gt;
  virtual void f(int);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure to apply the correct access control to the &amp;lt;code&amp;gt;using&amp;lt;/code&amp;gt; declaration:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class Base {&lt;br /&gt;
protected:&lt;br /&gt;
  void f();&lt;br /&gt;
};&lt;br /&gt;
class Derived: public Base {&lt;br /&gt;
public:&lt;br /&gt;
  void f(int);&lt;br /&gt;
protected:&lt;br /&gt;
  using Base::f;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you can, avoid such constructs as in the above example, by chosing different names for the two functions &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. If on the other hand the function f is clearly meant to be overloaded, then make all instances of &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; virtual in the base class.&lt;br /&gt;
&lt;br /&gt;
===Unused parameters===&lt;br /&gt;
&lt;br /&gt;
There are three cases where a parameter of a function is not actually used in the definition of the function:&lt;br /&gt;
&lt;br /&gt;
* The function has to have a certain signature (it is a virtual function, shall be used with a certain function pointer type, or is part of a stable API that cannot be changed).  In those cases, leave out the paramter name in the function definition (C++) or use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
(void) paramName; /* avoid warning about unused parameter */&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
at the start of the function body (C).&lt;br /&gt;
&lt;br /&gt;
* The function is created by the Macro IMPL_LINK( Class, Method, ArgType, ArgName ) from tools/inc/link.hxx or similar. Use EMPTYARG as Parametername as in&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
IMPL_LINK( Class, Method, ArgType, EMPTYARG )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
EMPTYARG is defined empty, so this will result in leaving out the parameter name as suggested above.&lt;br /&gt;
&lt;br /&gt;
* The function uses the paramter only in an &amp;lt;code&amp;gt;#ifdef&amp;lt;/code&amp;gt;-block, or only in &amp;lt;code&amp;gt;OSL_ASSERT&amp;lt;/code&amp;gt; etc. debug code.  If the first case occurs in C++ code, fix it by using the same &amp;lt;code&amp;gt;#ifdef&amp;lt;/code&amp;gt; around the parameter name in the function header.  In all other cases, fix it by using&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
(void) paramName; /* avoid warning about unused parameter */&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
at the start of the function body.&lt;br /&gt;
&lt;br /&gt;
* The function once used the parameter, but does no longer do so.  In that case, clean up the function declaration and all uses of the function.&lt;br /&gt;
&lt;br /&gt;
===When all else fails===&lt;br /&gt;
&lt;br /&gt;
There are cases where the only sensible solution is to suppress warnings for a given chunk of code:&lt;br /&gt;
&lt;br /&gt;
* As explained above, in external code which we do not want to clean up, use &amp;lt;code&amp;gt;EXTERNAL_WARNINGS_NOT_ERRORS := TRUE&amp;lt;/code&amp;gt; so that warnings do not lead to errors there.&lt;br /&gt;
&lt;br /&gt;
* Header files included directly from the system, or header files delivered from external code included in the OOo code base but which we cannot reasonably make &amp;lt;code&amp;gt;testhxx&amp;lt;/code&amp;gt;-clean:  Surround that code (e.g., the &amp;lt;code&amp;gt;#include&amp;lt;/code&amp;gt;-directives for those headers) by&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#if defined __GNUC__&lt;br /&gt;
#pragma GCC system_header&lt;br /&gt;
#elif defined __SUNPRO_CC&lt;br /&gt;
#pragma disable_warn&lt;br /&gt;
#elif defined _MSC_VER&lt;br /&gt;
#pragma warning(push, 1)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#if defined __SUNPRO_CC&lt;br /&gt;
#pragma enable_warn&lt;br /&gt;
#elif defined _MSC_VER&lt;br /&gt;
#pragma warning(pop)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(probably together with an explanatory comment).  &amp;lt;em&amp;gt;Due to the nature of the GCC solution, this does not work directly within the compilation unit&amp;#039;s main (&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.cxx&amp;lt;/code&amp;gt;) file, only within a (&amp;lt;code&amp;gt;.h&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.hxx&amp;lt;/code&amp;gt;) file included directly or indirectly.&amp;lt;/em&amp;gt; Even more important, because the &amp;lt;code&amp;gt;system_header&amp;lt;/code&amp;gt; pragma affects the &amp;#039;&amp;#039;rest of the current header&amp;#039;&amp;#039;, the entire warnings guard mechanism should be separated into a &amp;#039;&amp;#039;header file on its own&amp;#039;&amp;#039;, including just the file in question. From the original file then include that wrapper file.&lt;br /&gt;
&lt;br /&gt;
* Code generated by &amp;lt;code&amp;gt;flex&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;bison&amp;lt;/code&amp;gt;:  The solution here is similar to the solution in the previous item&amp;amp;mdash;disable all warnings in the generated code.  However, this has two implications:  For one, it means that also all warnings from our client code integrated into the &amp;lt;code&amp;gt;flex&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;bison&amp;lt;/code&amp;gt; output are suppressed; this is not really that large an issue, given the relatively small number of &amp;lt;code&amp;gt;flex&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;bison&amp;lt;/code&amp;gt; files we use.  For another, due to the nature of the GCC solution, it means that you need to introduce a wrapper file.  The individual steps for a given &amp;lt;code&amp;gt;flex&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;bison&amp;lt;/code&amp;gt; file named &amp;lt;code&amp;gt;example.ly&amp;lt;/code&amp;gt;, translated to &amp;lt;code&amp;gt;$(MISC)$/example.cxx&amp;lt;/code&amp;gt;, are as follows:  First, change &amp;lt;code&amp;gt;example.ly&amp;lt;/code&amp;gt; by adding&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#if defined __GNUC__&lt;br /&gt;
#pragma GCC system_header&lt;br /&gt;
#elif defined __SUNPRO_CC&lt;br /&gt;
#pragma disable_warn&lt;br /&gt;
#elif defined _MSC_VER&lt;br /&gt;
#pragma warning(push, 1)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(probably together with an explanatory comment) at the very end of the initial &amp;lt;code&amp;gt;%{...%}&amp;lt;/code&amp;gt; section (for &amp;lt;code&amp;gt;_MSC_VER&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;#pragma warning(push, 1)&amp;lt;/code&amp;gt; might not disable all the warnings that occur; in that case, add &amp;lt;code&amp;gt;#pragma warning(disable: NNN1 NNN2 ...)&amp;lt;/code&amp;gt; after it to disable specific warnings &amp;lt;code&amp;gt;NNN1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;NNN2&amp;lt;/code&amp;gt;, etc.).  Second, create a new file named &amp;lt;code&amp;gt;wrap_example.cxx&amp;lt;/code&amp;gt; in the same source directory as &amp;lt;code&amp;gt;exmaple.ly&amp;lt;/code&amp;gt;, containing&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;example.cxx&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Third, change the corresponding &amp;lt;code&amp;gt;makefile.mk&amp;lt;/code&amp;gt; by adding&lt;br /&gt;
&amp;lt;code&amp;gt;[]&lt;br /&gt;
INCPRE=$(MISC)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to the top, by changing occurences of &amp;lt;code&amp;gt;example.obj&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;wrap_example.obj&amp;lt;/code&amp;gt;, and by adding&lt;br /&gt;
&amp;lt;code&amp;gt;[]&lt;br /&gt;
$(OBJ)$/wrap_example.obj: $(MISC)$/example.cxx&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
and/or&lt;br /&gt;
&amp;lt;code&amp;gt;[]&lt;br /&gt;
$(SLO)$/wrap_example.obj: $(MISC)$/example.cxx&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
at the bottom.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Education]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Writing_warning-free_code&amp;diff=86163</id>
		<title>Writing warning-free code</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Writing_warning-free_code&amp;diff=86163"/>
		<updated>2008-07-10T06:03:18Z</updated>

		<summary type="html">&lt;p&gt;Dtardon: Comment to validity of the &amp;quot;switch&amp;quot; example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We are currently on the way towards a completely warning-free OOo C/C++ code base.  And once we have reached that, we want to keep the code clean!&lt;br /&gt;
&lt;br /&gt;
We reached a first milestone by integrating CWS [http://eis.services.openoffice.org/EIS2/servlet/cws.showCWS?Id=2903&amp;amp;Path=SRC680%2Fwarnings01 warnings01] into SRC680m173.  Since then, and at least on the &amp;lt;code&amp;gt;unxlngi6&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsoli4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsols4&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;wntmsci10&amp;lt;/code&amp;gt; platforms, the C/C++ compilers are used with rather aggressive warning levels, and in most CVS modules warnings are treated as errors that break the build.  Some CVS modules have not yet been made warning-free.&lt;br /&gt;
&lt;br /&gt;
==What changed?==&lt;br /&gt;
&lt;br /&gt;
Since SRC680m173, any new or modified C/C++ code that produces warnings will break the build.  Ideally, to be sure that integrating a CWS will not break the build, the CWS should now be built on every warning-free platform (i.e., at least &amp;lt;code&amp;gt;unxlngi6&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsoli4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsols4&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;wntmsci10&amp;lt;/code&amp;gt;), with all supported compiler versions, in both product and non-product variants, and with and without the &amp;lt;code&amp;gt;debug=x&amp;lt;/code&amp;gt; build switch before nominating it for integration.  Practically, a reasonable subset of these will have to suffice.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;code&amp;gt;unxlngi6&amp;lt;/code&amp;gt;, we concentrated on GCC&amp;amp;nbsp;3.4.1, GCC 4.0.2/4.0.3, and GCC&amp;amp;nbsp;4.1.1, while other GCC versions probably produce slightly different warnings (that could break the build now on those GCC versions).&lt;br /&gt;
&lt;br /&gt;
Porters are encouraged to make additional platforms warning-free.  Since most ports are using GCC, there should not be too many surprises.  Any necessary changes to the platform-specific &amp;lt;code&amp;gt;.mk&amp;lt;/code&amp;gt; file in &amp;lt;code&amp;gt;solenv/inc&amp;lt;/code&amp;gt; can be modelled after &amp;lt;code&amp;gt;solenv/inc/unxlngi6.mk&amp;lt;/code&amp;gt;.  In short, you need a bunch of &amp;lt;code&amp;gt;CFLAGSxxx&amp;lt;/code&amp;gt; (see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&amp;amp;msgNo=758 interface-announce C/C++ compiler warnings]) and &amp;lt;code&amp;gt;MODULES_WITH_WARNINGS&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;COMPILER_WARN_ERRORS&amp;lt;/code&amp;gt; (see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&amp;amp;msgNo=942 interface-announce MODULES_WITH_WARNINGS]).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;wall=x&amp;lt;/code&amp;gt; build switch no longer has any effect on the warning-free platforms.  Once all platforms are warning-free, we can remove it completely.&lt;br /&gt;
&lt;br /&gt;
==The missing modules==&lt;br /&gt;
&lt;br /&gt;
If your job is to clean up a given CVS module, here are some practical guidelines:&lt;br /&gt;
* Remove the module from the &amp;lt;code&amp;gt;MODULES_WITH_WARNINGS&amp;lt;/code&amp;gt; list in the platform-specific &amp;lt;code&amp;gt;.mk&amp;lt;/code&amp;gt; files in &amp;lt;code&amp;gt;solenv/inc&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Make sure your module builds and delivers successfully with &amp;lt;code&amp;gt;build &amp;amp;&amp;amp; deliver&amp;lt;/code&amp;gt; (and all the variants mentioned above).&lt;br /&gt;
* If your module contains external code which we do not want to clean up, set &amp;lt;code&amp;gt;EXTERNAL_WARNINGS_NOT_ERRORS := TRUE&amp;lt;/code&amp;gt; at the beginning of the corresponding &amp;lt;code&amp;gt;makefile.mk&amp;lt;/code&amp;gt;, so that warnings do not lead to errors there.&lt;br /&gt;
* In any case, for any header file delivered from your module, make sure that &amp;lt;code&amp;gt;testhxx&amp;lt;/code&amp;gt; on the delivered header file is successful.  (Note that &amp;lt;code&amp;gt;testhxx&amp;lt;/code&amp;gt; only works for headers delivered to the solver, not for local headers within a CVS module, as it calls the compiler with only a fixed set of include directories.)&lt;br /&gt;
* If you encounter a warning that cannot reasonably be worked around, discuss that problem on &amp;lt;code&amp;gt;dev@openoffice.org&amp;lt;/code&amp;gt;.  One outcome of that discussion can be that we globally disable that particular warning.  To see which warnings are already globally disabled on a given platform, look at the settings for &amp;lt;code&amp;gt;CFLAGSWARNCC&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CFLAGSWARNCXX&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CFLAGSWALLCC&amp;lt;/code&amp;gt;, and/or &amp;lt;code&amp;gt;CFLAGSWALLCXX&amp;lt;/code&amp;gt; in the platform-specific &amp;lt;code&amp;gt;.mk&amp;lt;/code&amp;gt; file in &amp;lt;code&amp;gt;solenv/inc&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;unxlngi6.mk&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsoli4.mk&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unxsols4.mk&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;wntmsci10.mk&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
See the current [[Warning-free_code_status|warning-free code status]].&lt;br /&gt;
&lt;br /&gt;
==Tips for Warning-free code==&lt;br /&gt;
&lt;br /&gt;
The following is a list of issues you might come across when making existing&lt;br /&gt;
code warning-free, or when writing new, warning-free code:&lt;br /&gt;
&lt;br /&gt;
===Integral conversions===&lt;br /&gt;
&lt;br /&gt;
Sometimes, a cast between integral types is needed to avoid a warning.  In such a case, use &amp;lt;code&amp;gt;sal::static_int_cast&amp;lt;/code&amp;gt;&amp;amp;nbsp;(C++) or &amp;lt;code&amp;gt;SAL_INT_CAST&amp;lt;/code&amp;gt;&amp;amp;nbsp;(C) to make that cast stick out&amp;amp;mdash;it will need to be adapted when the type of any of the involved expressions changes later on:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
sal_Int32 n;&lt;br /&gt;
std::vector&amp;lt;char&amp;gt; v;&lt;br /&gt;
if (n &amp;gt;= 0 &amp;amp;&amp;amp; sal::static_int_cast&amp;lt;sal_uInt32&amp;gt;(n) == v.size()) ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you might get the warning C4244 (possible loss of data) on Windows also for the following situation:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
short a = 0, b = 0;&lt;br /&gt;
a += b;  // warning C4244 on Windows&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is because &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; are converted to &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, then added and the result is then again cast back to &amp;lt;code&amp;gt;short&amp;lt;/code&amp;gt;. This is especially nasty, as it also happens when you use &amp;lt;code&amp;gt;xub_StrLen&amp;lt;/code&amp;gt;, but only if it is a typedf to &amp;lt;code&amp;gt;USHORT&amp;lt;/code&amp;gt; and not to &amp;lt;code&amp;gt;sal_uInt32&amp;lt;/code&amp;gt;, i.e. only as long as &amp;lt;code&amp;gt;STRING32&amp;lt;/code&amp;gt; is not defined in solar.h.&lt;br /&gt;
The warning does not occur when you use &amp;lt;code&amp;gt;operator+&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;operator+=&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
short a = 0, b = 0;&lt;br /&gt;
a = a + b;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid enum case values===&lt;br /&gt;
&lt;br /&gt;
Code like&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
enum E { A=1, B=2, C=4 } e;&lt;br /&gt;
switch (e) {&lt;br /&gt;
case A: ...&lt;br /&gt;
case B|C: ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will cause &amp;lt;code&amp;gt;wntmsci11&amp;lt;/code&amp;gt; to complain with &amp;lt;code&amp;gt;warning C4063: case &amp;#039;6&amp;#039; is not a valid value for switch of enum &amp;#039;E&amp;#039;&amp;lt;/code&amp;gt;. This can be worked around by promoting &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt; to is underlying integral type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
switch (+e) {&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I think the compiler warning is perfectly valid there (although a little misleading). There is a simple reason for it: because of C++ computing rules for operator|, the second case statement (B|C) has type int and value 6, whilst compiler expects it to have type E. There is not automatical conversion from int to enumeration type; even if there were one, no enumerator from E has value 6. So, in the &amp;quot;work around&amp;quot;, the case is actually &amp;#039;&amp;#039;unreachable&amp;#039;&amp;#039; (well, suppose there are no explicit casts in assignment to e)!&lt;br /&gt;
&lt;br /&gt;
What the author probably wanted is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
switch (e) {&lt;br /&gt;
case A: ...&lt;br /&gt;
case B:  // No code, falls through to the next statement&lt;br /&gt;
case C: ...  // The code of the original B|C branch&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- dt&lt;br /&gt;
&lt;br /&gt;
===Casting between pointer and integer types===&lt;br /&gt;
&lt;br /&gt;
====C++====&lt;br /&gt;
&lt;br /&gt;
* From pointer-to-(possibly-cv-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; to unsigned integral type&amp;amp;nbsp;&amp;lt;code&amp;gt;U&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
P p;&lt;br /&gt;
U u = sal::static_int_cast&amp;lt;U&amp;gt;(reinterpret_cast&amp;lt;sal_uIntPtr&amp;gt;(p));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From unsigned integral type&amp;amp;nbsp;&amp;lt;code&amp;gt;U&amp;lt;/code&amp;gt; to pointer-to-(possibly-cv-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
U u;&lt;br /&gt;
P p = reinterpret_cast&amp;lt;P&amp;gt;(sal::static_int_cast&amp;lt;sal_uIntPtr&amp;gt;(u));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From pointer-to-(possibly-cv-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; to signed integral type&amp;amp;nbsp;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
P p;&lt;br /&gt;
S s = sal::static_int_cast&amp;lt;S&amp;gt;(reinterpret_cast&amp;lt;sal_IntPtr&amp;gt;(p));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From signed integral type&amp;amp;nbsp;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt; to pointer-to-(possibly-cv-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
S s;&lt;br /&gt;
P p = reinterpret_cast&amp;lt;P&amp;gt;(sal::static_int_cast&amp;lt;sal_IntPtr&amp;gt;(s));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====C====&lt;br /&gt;
&lt;br /&gt;
* From pointer-to-(possibly-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; to unsigned integer type&amp;amp;nbsp;&amp;lt;code&amp;gt;U&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
P p;&lt;br /&gt;
U u = SAL_INT_CAST(U, (sal_uIntPtr) p);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From unsigned integer type&amp;amp;nbsp;&amp;lt;code&amp;gt;U&amp;lt;/code&amp;gt; to pointer-to-(possibly-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
U u;&lt;br /&gt;
P p = (P) SAL_INT_CAST(sal_uIntPtr, u);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From pointer-to-(possibly-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; to signed integer type&amp;amp;nbsp;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
P p;&lt;br /&gt;
S s = SAL_INT_CAST(S, (sal_IntPtr) p);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From signed integer type&amp;amp;nbsp;&amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt; to pointer-to-(possibly-qualified-)void-or-object type&amp;amp;nbsp;&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
S s;&lt;br /&gt;
P p = (P) SAL_INT_CAST(sal_IntPtr, s);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pointer to function===&lt;br /&gt;
&lt;br /&gt;
A pointer to function is not compatible with a pointer to object, so code like&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void * osl::Module::getSymbol(rtl::OUString const &amp;amp;);&lt;br /&gt;
typedef void (* MyFunc)();&lt;br /&gt;
MyFunc f = module.getSymbol(&amp;quot;myFunc&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will not compile.  The only places were converting between pointer to function and pointer to object (typically &amp;lt;code&amp;gt;void *&amp;lt;/code&amp;gt;) should be necessary are &amp;lt;code&amp;gt;osl::Module::getSymbol&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;osl::Module::getUrlFromAddress&amp;lt;/code&amp;gt;, and in both cases there are additional functions (&amp;lt;code&amp;gt;osl::Module::getFunctionSymbol&amp;lt;/code&amp;gt; and an overload with &amp;lt;code&amp;gt;oslGenericFunction&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;osl::Module::getUrlFromAddress&amp;lt;/code&amp;gt;) that handle the problem internally.  Use them!&lt;br /&gt;
&lt;br /&gt;
===Name hiding===&lt;br /&gt;
&lt;br /&gt;
In C++, use a &amp;lt;code&amp;gt;using&amp;lt;/code&amp;gt; declaration to make visible (virtual) function declarations from a base clase that would be hidden by a function declaration in a derived class:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class Base {&lt;br /&gt;
public:&lt;br /&gt;
  virtual void f(int);&lt;br /&gt;
  virtual void f(double);&lt;br /&gt;
};&lt;br /&gt;
class Derived: public Base {&lt;br /&gt;
public:&lt;br /&gt;
  using Base::f;&lt;br /&gt;
  virtual void f(int);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure to apply the correct access control to the &amp;lt;code&amp;gt;using&amp;lt;/code&amp;gt; declaration:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class Base {&lt;br /&gt;
protected:&lt;br /&gt;
  void f();&lt;br /&gt;
};&lt;br /&gt;
class Derived: public Base {&lt;br /&gt;
public:&lt;br /&gt;
  void f(int);&lt;br /&gt;
protected:&lt;br /&gt;
  using Base::f;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you can, avoid such constructs as in the above example, by chosing different names for the two functions &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. If on the other hand the function f is clearly meant to be overloaded, then make all instances of &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; virtual in the base class.&lt;br /&gt;
&lt;br /&gt;
===Unused parameters===&lt;br /&gt;
&lt;br /&gt;
There are three cases where a parameter of a function is not actually used in the definition of the function:&lt;br /&gt;
&lt;br /&gt;
* The function has to have a certain signature (it is a virtual function, shall be used with a certain function pointer type, or is part of a stable API that cannot be changed).  In those cases, leave out the paramter name in the function definition (C++) or use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
(void) paramName; /* avoid warning about unused parameter */&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
at the start of the function body (C).&lt;br /&gt;
&lt;br /&gt;
* The function is created by the Macro IMPL_LINK( Class, Method, ArgType, ArgName ) from tools/inc/link.hxx or similar. Use EMPTYARG as Parametername as in&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
IMPL_LINK( Class, Method, ArgType, EMPTYARG )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
EMPTYARG is defined empty, so this will result in leaving out the parameter name as suggested above.&lt;br /&gt;
&lt;br /&gt;
* The function uses the paramter only in an &amp;lt;code&amp;gt;#ifdef&amp;lt;/code&amp;gt;-block, or only in &amp;lt;code&amp;gt;OSL_ASSERT&amp;lt;/code&amp;gt; etc. debug code.  If the first case occurs in C++ code, fix it by using the same &amp;lt;code&amp;gt;#ifdef&amp;lt;/code&amp;gt; around the parameter name in the function header.  In all other cases, fix it by using&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
(void) paramName; /* avoid warning about unused parameter */&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
at the start of the function body.&lt;br /&gt;
&lt;br /&gt;
* The function once used the parameter, but does no longer do so.  In that case, clean up the function declaration and all uses of the function.&lt;br /&gt;
&lt;br /&gt;
===When all else fails===&lt;br /&gt;
&lt;br /&gt;
There are cases where the only sensible solution is to suppress warnings for a given chunk of code:&lt;br /&gt;
&lt;br /&gt;
* As explained above, in external code which we do not want to clean up, use &amp;lt;code&amp;gt;EXTERNAL_WARNINGS_NOT_ERRORS := TRUE&amp;lt;/code&amp;gt; so that warnings do not lead to errors there.&lt;br /&gt;
&lt;br /&gt;
* Header files included directly from the system, or header files delivered from external code included in the OOo code base but which we cannot reasonably make &amp;lt;code&amp;gt;testhxx&amp;lt;/code&amp;gt;-clean:  Surround that code (e.g., the &amp;lt;code&amp;gt;#include&amp;lt;/code&amp;gt;-directives for those headers) by&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#if defined __GNUC__&lt;br /&gt;
#pragma GCC system_header&lt;br /&gt;
#elif defined __SUNPRO_CC&lt;br /&gt;
#pragma disable_warn&lt;br /&gt;
#elif defined _MSC_VER&lt;br /&gt;
#pragma warning(push, 1)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#if defined __SUNPRO_CC&lt;br /&gt;
#pragma enable_warn&lt;br /&gt;
#elif defined _MSC_VER&lt;br /&gt;
#pragma warning(pop)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(probably together with an explanatory comment).  &amp;lt;em&amp;gt;Due to the nature of the GCC solution, this does not work directly within the compilation unit&amp;#039;s main (&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.cxx&amp;lt;/code&amp;gt;) file, only within a (&amp;lt;code&amp;gt;.h&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.hxx&amp;lt;/code&amp;gt;) file included directly or indirectly.&amp;lt;/em&amp;gt; Even more important, because the &amp;lt;code&amp;gt;system_header&amp;lt;/code&amp;gt; pragma affects the &amp;#039;&amp;#039;rest of the current header&amp;#039;&amp;#039;, the entire warnings guard mechanism should be separated into a &amp;#039;&amp;#039;header file on its own&amp;#039;&amp;#039;, including just the file in question. From the original file then include that wrapper file.&lt;br /&gt;
&lt;br /&gt;
* Code generated by &amp;lt;code&amp;gt;flex&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;bison&amp;lt;/code&amp;gt;:  The solution here is similar to the solution in the previous item&amp;amp;mdash;disable all warnings in the generated code.  However, this has two implications:  For one, it means that also all warnings from our client code integrated into the &amp;lt;code&amp;gt;flex&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;bison&amp;lt;/code&amp;gt; output are suppressed; this is not really that large an issue, given the relatively small number of &amp;lt;code&amp;gt;flex&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;bison&amp;lt;/code&amp;gt; files we use.  For another, due to the nature of the GCC solution, it means that you need to introduce a wrapper file.  The individual steps for a given &amp;lt;code&amp;gt;flex&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;bison&amp;lt;/code&amp;gt; file named &amp;lt;code&amp;gt;example.ly&amp;lt;/code&amp;gt;, translated to &amp;lt;code&amp;gt;$(MISC)$/example.cxx&amp;lt;/code&amp;gt;, are as follows:  First, change &amp;lt;code&amp;gt;example.ly&amp;lt;/code&amp;gt; by adding&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#if defined __GNUC__&lt;br /&gt;
#pragma GCC system_header&lt;br /&gt;
#elif defined __SUNPRO_CC&lt;br /&gt;
#pragma disable_warn&lt;br /&gt;
#elif defined _MSC_VER&lt;br /&gt;
#pragma warning(push, 1)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(probably together with an explanatory comment) at the very end of the initial &amp;lt;code&amp;gt;%{...%}&amp;lt;/code&amp;gt; section (for &amp;lt;code&amp;gt;_MSC_VER&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;#pragma warning(push, 1)&amp;lt;/code&amp;gt; might not disable all the warnings that occur; in that case, add &amp;lt;code&amp;gt;#pragma warning(disable: NNN1 NNN2 ...)&amp;lt;/code&amp;gt; after it to disable specific warnings &amp;lt;code&amp;gt;NNN1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;NNN2&amp;lt;/code&amp;gt;, etc.).  Second, create a new file named &amp;lt;code&amp;gt;wrap_example.cxx&amp;lt;/code&amp;gt; in the same source directory as &amp;lt;code&amp;gt;exmaple.ly&amp;lt;/code&amp;gt;, containing&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;example.cxx&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Third, change the corresponding &amp;lt;code&amp;gt;makefile.mk&amp;lt;/code&amp;gt; by adding&lt;br /&gt;
&amp;lt;code&amp;gt;[]&lt;br /&gt;
INCPRE=$(MISC)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to the top, by changing occurences of &amp;lt;code&amp;gt;example.obj&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;wrap_example.obj&amp;lt;/code&amp;gt;, and by adding&lt;br /&gt;
&amp;lt;code&amp;gt;[]&lt;br /&gt;
$(OBJ)$/wrap_example.obj: $(MISC)$/example.cxx&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
and/or&lt;br /&gt;
&amp;lt;code&amp;gt;[]&lt;br /&gt;
$(SLO)$/wrap_example.obj: $(MISC)$/example.cxx&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
at the bottom.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Education]]&lt;/div&gt;</summary>
		<author><name>Dtardon</name></author>
	</entry>
</feed>