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 _SVTOOLS_EXTENSIONLISTBOX_HXX
25 #define _SVTOOLS_EXTENSIONLISTBOX_HXX
26 
27 #include <vcl/ctrl.hxx>
28 #include <rtl/ustring.hxx>
29 
30 // ============================================================================
31 
32 namespace svt
33 {
34 
35 #define EXTENSION_LISTBOX_ENTRY_NOTFOUND (sal_Int32) 0xFFFFFFFF
36 
37 // ============================================================================
38 
39 /** This abstract class provides methods to implement an extension list box.
40     This header is needed for the automatic test tool
41 */
42 class IExtensionListBox: public Control
43 {
44 public:
IExtensionListBox(Window * pParent,WinBits nWinStyle=0)45     IExtensionListBox( Window* pParent, WinBits nWinStyle = 0 ): Control( pParent, nWinStyle ){}
46 
47     /** @return  The count of the entries in the list box. */
48     virtual sal_Int32 getItemCount() const = 0;
49 
50     /** @return  The index of the first selected entry in the list box.
51         When nothing is selected, which is the case when getItemCount returns '0',
52         then this function returns EXTENSION_LISTBOX_ENTRY_NOTFOUND */
53     virtual sal_Int32 getSelIndex() const = 0;
54 
55     /** @return  The item name of the entry with the given index
56         The index starts with 0.
57         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
58     virtual ::rtl::OUString getItemName( sal_Int32 index ) const = 0;
59 
60     /** @return  The version string of the entry with the given index
61         The index starts with 0.
62         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
63     virtual ::rtl::OUString getItemVersion( sal_Int32 index ) const = 0;
64 
65     /** @return  The description string of the entry with the given index
66         The index starts with 0.
67         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
68     virtual ::rtl::OUString getItemDescription( sal_Int32 index ) const = 0;
69 
70     /** @return  The publisher string of the entry with the given index
71         The index starts with 0.
72         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
73     virtual ::rtl::OUString getItemPublisher( sal_Int32 index ) const = 0;
74 
75     /** @return  The link behind the publisher text of the entry with the given index
76         The index starts with 0.
77         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
78     virtual ::rtl::OUString getItemPublisherLink( sal_Int32 index ) const = 0;
79 
80     /** The entry at the given position will be selected
81         Index starts with 0.
82         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
83     virtual void select( sal_Int32 index ) = 0;
84 
85     /** The first found entry with the given name will be selected
86         When there was no entry found with the name, the selection doesn't change.
87         Please note that there might be more than one entry with the same
88         name, because:
89             1. the name is not unique
90             2. one extension can be installed as user and shared extension.
91     */
92     virtual void select( const ::rtl::OUString & sName ) = 0;
93 };
94 // ============================================================================
95 
96 } // namespace svt
97 
98 // ============================================================================
99 
100 #endif // _SVTOOLS_EXTENSIONLISTBOX_HXX
101 
102