Difference between revisions of "Framework/Tutorial/Statusbar Controller"
(→General abstract of the status bar controller concept) |
|||
Line 93: | Line 93: | ||
interface com::sun::star::frame::XStatusbarController; | interface com::sun::star::frame::XStatusbarController; | ||
}; | }; | ||
− | |||
− | |||
}; }; }; }; | }; }; }; }; | ||
</code> | </code> | ||
+ | |||
+ | = The language selection status bar controller = | ||
+ | |||
+ | This chapter describes how to create a language selection status bar controller. It uses the previous described concepts and descriptions to implement it. | ||
+ | |||
+ | == A status bar controller implementation skeleton == | ||
+ | |||
+ | == The lanuage selection part == | ||
[[Category:Development]] | [[Category:Development]] |
Revision as of 20:40, 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
- Programming with UNO
- C++ knowledge
- How to create an extension with the "OpenOffice.org SDK"
Contents
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
This chapter describes how to create a language selection status bar controller. It uses the previous described concepts and descriptions to implement it.