Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SVTOOLS_EXTENSIONLISTBOX_HXX
21 : #define INCLUDED_SVTOOLS_EXTENSIONLISTBOX_HXX
22 :
23 : #include <vcl/ctrl.hxx>
24 : #include <rtl/ustring.hxx>
25 :
26 :
27 :
28 : namespace svt
29 : {
30 :
31 :
32 :
33 : /** This abstract class provides methods to implement an extension list box.
34 : This header is needed for the automatic test tool
35 : */
36 0 : class IExtensionListBox: public Control
37 : {
38 : public:
39 : enum { ENTRY_NOTFOUND = -1 };
40 :
41 0 : IExtensionListBox( vcl::Window* pParent, WinBits nWinStyle = 0 ): Control( pParent, nWinStyle ){}
42 :
43 : /** @return The count of the entries in the list box. */
44 : virtual sal_Int32 getItemCount() const = 0;
45 :
46 : /** @return The index of the first selected entry in the list box.
47 : When nothing is selected, which is the case when getItemCount returns '0',
48 : then this function returns ENTRY_NOTFOUND */
49 : virtual sal_Int32 getSelIndex() const = 0;
50 :
51 : /** @return The item name of the entry with the given index
52 : The index starts with 0.
53 : Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
54 : virtual OUString getItemName( sal_Int32 index ) const = 0;
55 :
56 : /** @return The version string of the entry with the given index
57 : The index starts with 0.
58 : Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
59 : virtual OUString getItemVersion( sal_Int32 index ) const = 0;
60 :
61 : /** @return The description string of the entry with the given index
62 : The index starts with 0.
63 : Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
64 : virtual OUString getItemDescription( sal_Int32 index ) const = 0;
65 :
66 : /** @return The publisher string of the entry with the given index
67 : The index starts with 0.
68 : Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
69 : virtual OUString getItemPublisher( sal_Int32 index ) const = 0;
70 :
71 : /** @return The link behind the publisher text of the entry with the given index
72 : The index starts with 0.
73 : Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
74 : virtual OUString getItemPublisherLink( sal_Int32 index ) const = 0;
75 :
76 : /** The entry at the given position will be selected
77 : Index starts with 0.
78 : Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
79 : virtual void select( sal_Int32 index ) = 0;
80 :
81 : /** The first found entry with the given name will be selected
82 : When there was no entry found with the name, the selection doesn't change.
83 : Please note that there might be more than one entry with the same
84 : name, because:
85 : 1. the name is not unique
86 : 2. one extension can be installed as user and shared extension.
87 : */
88 : virtual void select( const OUString & sName ) = 0;
89 : };
90 :
91 :
92 : } // namespace svt
93 :
94 :
95 :
96 : #endif // INCLUDED_SVTOOLS_EXTENSIONLISTBOX_HXX
97 :
98 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|