1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SVTOOLS_EXTENSIONLISTBOX_HXX
29 #define _SVTOOLS_EXTENSIONLISTBOX_HXX
30 
31 #include <vcl/ctrl.hxx>
32 #include <rtl/ustring.hxx>
33 
34 // ============================================================================
35 
36 namespace svt
37 {
38 
39 #define EXTENSION_LISTBOX_ENTRY_NOTFOUND (sal_Int32) 0xFFFFFFFF
40 
41 // ============================================================================
42 
43 /** This abstract class provides methods to implement an extension list box.
44     This header is needed for the automatic test tool
45 */
46 class IExtensionListBox: public Control
47 {
48 public:
49     IExtensionListBox( Window* pParent, WinBits nWinStyle = 0 ): Control( pParent, nWinStyle ){}
50 
51     /** @return  The count of the entries in the list box. */
52     virtual sal_Int32 getItemCount() const = 0;
53 
54     /** @return  The index of the first selected entry in the list box.
55         When nothing is selected, which is the case when getItemCount returns '0',
56         then this function returns EXTENSION_LISTBOX_ENTRY_NOTFOUND */
57     virtual sal_Int32 getSelIndex() const = 0;
58 
59     /** @return  The item name of the entry with the given index
60         The index starts with 0.
61         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
62     virtual ::rtl::OUString getItemName( sal_Int32 index ) const = 0;
63 
64     /** @return  The version string of the entry with the given index
65         The index starts with 0.
66         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
67     virtual ::rtl::OUString getItemVersion( sal_Int32 index ) const = 0;
68 
69     /** @return  The description string of the entry with the given index
70         The index starts with 0.
71         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
72     virtual ::rtl::OUString getItemDescription( sal_Int32 index ) const = 0;
73 
74     /** @return  The publisher string of the entry with the given index
75         The index starts with 0.
76         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
77     virtual ::rtl::OUString getItemPublisher( sal_Int32 index ) const = 0;
78 
79     /** @return  The link behind the publisher text of the entry with the given index
80         The index starts with 0.
81         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
82     virtual ::rtl::OUString getItemPublisherLink( sal_Int32 index ) const = 0;
83 
84     /** The entry at the given position will be selected
85         Index starts with 0.
86         Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
87     virtual void select( sal_Int32 index ) = 0;
88 
89     /** The first found entry with the given name will be selected
90         When there was no entry found with the name, the selection doesn't change.
91         Please note that there might be more than one entry with the same
92         name, because:
93             1. the name is not unique
94             2. one extension can be installed as user and shared extension.
95     */
96     virtual void select( const ::rtl::OUString & sName ) = 0;
97 };
98 // ============================================================================
99 
100 } // namespace svt
101 
102 // ============================================================================
103 
104 #endif // _SVTOOLS_EXTENSIONLISTBOX_HXX
105 
106