Framework/Article/General Architecture Of The Framework User Interface Implementation

From Apache OpenOffice Wiki
< Framework
Revision as of 09:30, 3 July 2007 by Cd (Talk | contribs)

Jump to: navigation, search

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:

  • Layout of the user interface elements
  • Creation, destruction and
  • Persistent and transient customization of the user interface elements

Overview

The Layout Manager

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 LayoutManager. The layout manager supports to retrieve all currently instanciated user interface elements. It is also possible to retrieve a single user interface element.

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

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

//============================================================================= /** controls the layout of user interface elements which are part of a frame.

   Layout management is the process of determining the size and position of 
   user interface elements. By default, each Frame has a layout 
   manager -- it performs layout management for the user interface elements 
   within the frame. User interface elements can provide size and alignment 
   hints to layout managers, but layout managers have the final decision on 
   the size and position of those user interface elements. 
   @since OOo 2.0.0
  • /

service LayoutManager {

   /** central interface to query for, create, destroy and manipulate user 
       interface elements which are bound to a frame.
       @see ::com::sun::star::frame::XLayoutManager;
   */
   interface ::com::sun::star::frame::XLayoutManager;
       
   /** notification interface to receive status information about the state 
       of the connected frame.
       E.g., you can receive events of instantiation/destruction and
       activation/deactivation of a frame.
       @see XFrame::addFrameActionListener()
       @see XFrame::removeFrameActionListener()
   */
   interface ::com::sun::star::frame::XFrameActionListener;
   /** notification interface to receive change messages of user interface 
       elements which are part of the layout manager.
       E.g., you can receive events of insertion/replacing and
       removing of settings data of user interface elements.
       @see com::sun::star::ui::XUIConfiguration
   */
   interface ::com::sun::star::ui::XUIConfigurationListener;
   /** provides functions to merge menus for inplace editing of components
       inside OpenOffice.org.
   */
   interface ::com::sun::star::frame::XMenuBarMergingAcceptor;
   /** registers listeners that want to receive layout manager
       events.
   */
   [optional] interface ::com::sun::star::frame::XLayoutManagerEventBroadcaster;
   /** interface to support settings a menu bar for inplace editing of 
       components inside OpenOffice.org.
       @deprecated
   */    
   [optional] interface ::com::sun::star::frame::XInplaceLayout;

};

}; }; }; };

Example to retrieve the layout manager instance from a frame. [cpp]

com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet;

xPropSet = ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >( xFrame, ::com::sun::star::uno::UNO_QUERY );

if ( xPropSet.is() ) {

   try
   {
       xLayoutManager.set( xPropSet->getPropertyValue( 
           ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))), 
           ::com::sun::star::uno::UNO_QUERY );
   }
   catch ( com::sun::star::beans::UnknownPropertyException& )
   {
   }

}

The User Interface Configuration API

The Module User Interface Configuration Manager

The Document User Interface Configuration Manager

Persistence

User Interface Configuration Data Format

Maintenance of Menus, Toolbars and User Interface Commands

Adding a new Toolbar

How to add, replace or remove a User Interface Command

Personal tools