1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_frame_ToolbarController_idl__
25#define __com_sun_star_frame_ToolbarController_idl__
26
27#ifndef __com_sun_star_lang_XInitialization_idl__
28#include <com/sun/star/lang/XInitialization.idl>
29#endif
30
31#ifndef __com_sun_star_util_XUpdatable_idl__
32#include <com/sun/star/util/XUpdatable.idl>
33#endif
34
35#ifndef __com_sun_star_frame_XStatusListener_idl__
36#include <com/sun/star/frame/XStatusListener.idl>
37#endif
38
39#ifndef __com_sun_star_frame_XToolbarController_idl__
40#include <com/sun/star/frame/XToolbarController.idl>
41#endif
42
43#ifndef __com_sun_star_frame_XSubToolbarController_idl__
44#include <com/sun/star/frame/XSubToolbarController.idl>
45#endif
46
47//=============================================================================
48
49 module com {  module sun {  module star {  module frame {
50
51//=============================================================================
52/** is an abstract service for a component which offers a more complex user
53    interface to users within a toolbar.
54
55    <p>
56    A generic toolbar function is represented as a button which has a state
57    (enabled,disabled and selected, not selected). A toolbar controller can
58    be added to a toolbar and provide information or functions within a more
59    sophisticated user interface.<br/> A typical example for toolbar controller
60    is the font chooser within the toolbar. It provides all available fonts in
61    a dropdown box and shows the current chosen font.
62    <p>
63
64    @see com::sun::star::frame::XDispatchProvider
65
66    @since OpenOffice 2.0
67 */
68
69service ToolbarController
70{
71    //-------------------------------------------------------------------------
72    /** with this interface a component can receive events if a feature has
73        changed.
74
75        <p>
76        The toolbar controller implementation should register itself as a
77        listener when its <member scope="com::sun::star::util">XUpdatable</member>
78        interface has been called.
79        </p>
80     */
81    interface com::sun::star::frame::XStatusListener;
82
83    /** used to initialize a component with required arguments.
84
85        A toolbar controller needs at least three additional arguments
86        provided as <type scope="com::sun::star::beans">PropertyValue</type>:
87        <ul>
88            <li><b>Frame</b><br>a <type scope="com::sun::star::frame">XFrame</type>
89                   instance to which the toolbar controller belongs.</li>
90            <li><b>CommandURL</b><br>a string which specifies the command a
91                   toolbar controller is bound.</li>
92            <li><b>ServiceManager</b><br>a
93                   <type scope="com::sun::star::lang">XMultiServiceFactory</type>
94                   instance which can be used to create additional UNO services.</li>
95        </ul>
96    */
97    interface com::sun::star::lang::XInitialization;
98
99    /** used to notify an implementation that it needs to add its listener or remove
100        and add them again.
101
102        <p>
103        A toolbar controller instance is ready for use after this call has been made
104        the first time. The toolbar implementation guarentees that the controller's
105        item window has been added to the toolbar and its reference is held by it.
106        </p>
107    */
108    interface com::sun::star::util::XUpdatable;
109
110    //-------------------------------------------------------------------------
111    /** used to notify changed features and requests for additional user interface
112        items.
113
114        <p>
115        Mostly used by a toolbar implementation to forward information to and request
116        services from a toolbar controller component. This interface must be useable
117        after <member scope="com::sun::star::lang">XInitialitation::initialize</member>
118        has been called.  The behavior of the interface is undefined if the controller
119        component hasn't been initialized.
120        </p>
121     */
122    interface com::sun::star::frame::XToolbarController;
123
124    //-------------------------------------------------------------------------
125    /** used to notify and retrieve information that are specific for sub-toolbar
126        controllers.
127
128        <p>
129        Used by implementations that want to provide the toolbar button/sub-
130        toolbar function feature. A controller supporting this interface exchanges
131        the function of its own toolbar button, that opened the sub-toolbar, with
132        the one that has been selected on the sub-toolbar.
133        </p>
134     */
135    [optional] interface ::com::sun::star::frame::XSubToolbarController;
136};
137
138//=============================================================================
139
140}; }; }; };
141
142#endif
143