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#ifndef __com_sun_star_awt_XSimpleTabController_idl__
24#define __com_sun_star_awt_XSimpleTabController_idl__
25
26#ifndef __com_sun_star_awt_XTabListener_idl__
27#include <com/sun/star/awt/XTabListener.idl>
28#endif
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
35#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
36#endif
37
38#ifndef __com_sun_star_beans_NamedValue_idl__
39#include <com/sun/star/beans/NamedValue.idl>
40#endif
41
42//=============================================================================
43
44 module com {  module sun {  module star {  module awt {
45
46//=============================================================================
47
48/** specifies the basic operations for a tab controller,
49    but does not require XControl as type of tabs.
50 */
51published interface XSimpleTabController : com::sun::star::uno::XInterface
52{
53    //-------------------------------------------------------------------------
54    /** create a new tab and return an unique ID,
55        which can be used further to adress this tab by using other methods
56        of this interface.
57
58        @return [long
59                an unique ID for this new tab.
60     */
61    long insertTab();
62
63    //-------------------------------------------------------------------------
64    /** remove a tab with the given ID.
65
66        @param  ID
67                the ID of the tab, which should be removed.
68
69        @throws  ::com::sun::star::lang::IndexOutOfBoundsException
70                if the specified ID isnt used inside this tab controller.
71     */
72    void removeTab( [in] long ID )
73        raises( com::sun::star::lang::IndexOutOfBoundsException );
74
75    //-------------------------------------------------------------------------
76    /** change some properties of the specified tab.
77
78        @descr  Such properties can be:
79                <table>
80                    <tr>
81                        <td><b>Property</b></td>
82                        <td><b>Type</b></td>
83                        <td><b>Description</b></td>
84                    </tr>
85                    <tr>
86                        <td>Title</td>
87                        <td>string</td>
88                        <td>the title of the tab, which is shown at the UI.</td>
89                    </tr>
90                    <tr>
91                        <td>Position</td>
92                        <td>int</td>
93                        <td>describe the order of this tab in relation to all other tabs inside this control.</td>
94                    </tr>
95                </table>
96
97        @attention  Not all properties must be supported by all implementations of this interface.
98                    Of course some important ones should be handled by every implementation ...
99                    as e.g. "Title".
100
101        @param  ID
102                the ID of the tab, which should be changed.
103
104        @throws  ::com::sun::star::lang::IndexOutOfBoundsException
105                if the specified ID isnt used inside this tab controller.
106     */
107    void setTabProps( [in] long                                          ID         ,
108                      [in] sequence< com::sun::star::beans::NamedValue > Properties )
109        raises( com::sun::star::lang::IndexOutOfBoundsException );
110
111    //-------------------------------------------------------------------------
112    /** retrieve the set of properties for the specified tab.
113
114        @param  ID
115                the ID of the tab.
116
117        @throws  ::com::sun::star::lang::IndexOutOfBoundsException
118                if the specified ID isnt used inside this tab controller.
119     */
120    sequence< com::sun::star::beans::NamedValue > getTabProps( [in] long ID )
121        raises( com::sun::star::lang::IndexOutOfBoundsException );
122
123    //-------------------------------------------------------------------------
124    /** activate the specified tab.
125
126        @descr  The new tab will be activated and all listener will get an event describing this.
127                Of course there will be an event too, which notify's listener about the deactivation
128                of the last active tab.
129
130        @param  ID
131                the ID of the new active tab.
132
133        @throws  ::com::sun::star::lang::IndexOutOfBoundsException
134                if the specified ID isnt used inside this tab controller.
135     */
136    void activateTab( [in] long ID )
137        raises( com::sun::star::lang::IndexOutOfBoundsException );
138
139    //-------------------------------------------------------------------------
140    /** return the unique ID of the current active tab.
141
142        @eturn  [long]
143                the ID of the active tab.
144     */
145    long getActiveTabID();
146
147    //-------------------------------------------------------------------------
148    /** register listener for inserting/removing tab's and changing her properties.
149
150        @param  Listener
151                the listener for registration.
152     */
153    void addTabListener( [in] XTabListener Listener );
154
155    //-------------------------------------------------------------------------
156    /** deregister listener for inserting/removing tab's and changing her properties.
157
158        @param  Listener
159                the listener for deregistration.
160     */
161    void removeTabListener( [in] XTabListener Listener );
162};
163
164//=============================================================================
165
166}; }; }; };
167
168#endif
169