Difference between revisions of "Framework/Tutorial/Statusbar Controller"

From Apache OpenOffice Wiki
Jump to: navigation, search
(General abstract of the status bar controller concept)
Line 13: Line 13:
 
= General abstract of the status bar controller concept =
 
= General abstract of the status bar controller concept =
  
A status bar controller must be implemented via UNO using the status bar controller service. This service is called '''com.sun.star.frame.StatusbarController'''. OpenOffice.org uses the different interfaces of the service for creation, destruction and communication. It defines what interfaces must be supported.
+
== Status bar controller architecture ==
  
The following code part shows the UNO IDL description of the service.
+
A status bar controller must be implemented via UNO using the status bar controller service. This service is called '''com.sun.star.frame.StatusbarController'''. Thw OpenOffice.org status bar implementation uses the different interfaces of the service for creation, destruction and communication. The following code part shows the UNO IDL description of the service:
  
 
<code>[cpp]
 
<code>[cpp]

Revision as of 20:35, 18 February 2007

This tutorial will give you a detailed overview of the OpenOffice.org status bar and how to create a status bar conbtroller. Everybody is invited to participate. May be someone wants to translate the extension to a different language (e.g. Java or Python) or wants to have more information about a specific topic. You can set a link to this page, if you think that this page adds valuable information. The outcome of this tutorial will be a language selection status bar controller where you can set the document

The reader of this tutorial should know the following aspects

The OpenOffice.org status bar

The OpenOffice.org status bar is controlled by the frame based layout manager. Every frame contains a layout manager that controls the user interfaces elements (e.g. menu bar, status bar, toolbars). The layout manager identifies every user interface element via a unique url. The status bar can be addressed by the following url: private:resource/statusbar/statusbar.

General abstract of the status bar controller concept

Status bar controller architecture

A status bar controller must be implemented via UNO using the status bar controller service. This service is called com.sun.star.frame.StatusbarController. Thw OpenOffice.org status bar implementation uses the different interfaces of the service for creation, destruction and communication. The following code part shows the UNO IDL description of the service:

[cpp] //=============================================================================

module com {  module sun {  module star {  module frame {

//============================================================================= /** is an abstract service for a component which offers a more complex user

   interface to users within a status bar.
   A generic status bar function is represented as a text field which has 
   provides status information to the user. A status bar controller can be 
   added to a status bar and provide information or functions with a more 
   sophisticated user interface.
   A typical example for a status bar controller is the zoom level chooser 
   within the statusbar. It provides an option to change the zoom level of 
   an application.
   see com::sun::star::frame::XDispatchProvider
   see com::sun::star::frame::XStatusbarController
   since OOo 2.0.0
*/

service StatusbarController {

   //-------------------------------------------------------------------------
   /** with this interface a component can receive events if a feature has 
       changed.
       The toolbar controller implementation should register itself as a 
       listener when its com::sun::star::util::XUpdatable interface has 
       been called.
    */
   interface com::sun::star::frame::XStatusListener;
   /** used to initialize a component with required arguments.
       A toolbar controller needs at least three additional arguments 
       provided as com::sun::star::beans::PropertyValue:
       Frame
       com::sun::star::frame::XFrame instance to which the toolbar 
       controller belongs.
       
       CommandURL
       a string which specifies the command a statusbar controller is bound.
       ServiceManager
       a com::sun::star::lang::XMultiServiceFactory instance which can 
       be used to create additional UNO services.
   */
   interface com::sun::star::lang::XInitialization;
   /** used to notify an implementation that it needs to add its listener or 
       remove and add them again.
       A status bar controller instance is ready for use after this call has 
       been made the first time. The status bar implementation guarentees that 
       the controller's item window has been added to the status bar and its 
       reference is held by it.
   */
   interface com::sun::star::util::XUpdatable;
   //-------------------------------------------------------------------------
   /** used to notify changed features and requests for additional user 
       interface items.
       Mostly used by a status bar implementation to forward information to 
       and request services from a status bar controller component. This 
       interface must be useable after 
       com::sun::star::lang::XInitialitation::initialize has been called.  
       The behavior of the interface is undefined if the controller component 
       hasn't been initialized.
    */
   interface com::sun::star::frame::XStatusbarController;

};

The language selection status bar controller

}; }; }; };

Personal tools