1*01aa44aaSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*01aa44aaSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*01aa44aaSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*01aa44aaSAndrew Rist * distributed with this work for additional information 6*01aa44aaSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*01aa44aaSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*01aa44aaSAndrew Rist * "License"); you may not use this file except in compliance 9*01aa44aaSAndrew Rist * with the License. You may obtain a copy of the License at 10*01aa44aaSAndrew Rist * 11*01aa44aaSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*01aa44aaSAndrew Rist * 13*01aa44aaSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*01aa44aaSAndrew Rist * software distributed under the License is distributed on an 15*01aa44aaSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*01aa44aaSAndrew Rist * KIND, either express or implied. See the License for the 17*01aa44aaSAndrew Rist * specific language governing permissions and limitations 18*01aa44aaSAndrew Rist * under the License. 19*01aa44aaSAndrew Rist * 20*01aa44aaSAndrew Rist *************************************************************/ 21*01aa44aaSAndrew Rist 22*01aa44aaSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVTOOLS_EXTENSIONLISTBOX_HXX 25cdf0e10cSrcweir #define _SVTOOLS_EXTENSIONLISTBOX_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <vcl/ctrl.hxx> 28cdf0e10cSrcweir #include <rtl/ustring.hxx> 29cdf0e10cSrcweir 30cdf0e10cSrcweir // ============================================================================ 31cdf0e10cSrcweir 32cdf0e10cSrcweir namespace svt 33cdf0e10cSrcweir { 34cdf0e10cSrcweir 35cdf0e10cSrcweir #define EXTENSION_LISTBOX_ENTRY_NOTFOUND (sal_Int32) 0xFFFFFFFF 36cdf0e10cSrcweir 37cdf0e10cSrcweir // ============================================================================ 38cdf0e10cSrcweir 39cdf0e10cSrcweir /** This abstract class provides methods to implement an extension list box. 40cdf0e10cSrcweir This header is needed for the automatic test tool 41cdf0e10cSrcweir */ 42cdf0e10cSrcweir class IExtensionListBox: public Control 43cdf0e10cSrcweir { 44cdf0e10cSrcweir public: IExtensionListBox(Window * pParent,WinBits nWinStyle=0)45cdf0e10cSrcweir IExtensionListBox( Window* pParent, WinBits nWinStyle = 0 ): Control( pParent, nWinStyle ){} 46cdf0e10cSrcweir 47cdf0e10cSrcweir /** @return The count of the entries in the list box. */ 48cdf0e10cSrcweir virtual sal_Int32 getItemCount() const = 0; 49cdf0e10cSrcweir 50cdf0e10cSrcweir /** @return The index of the first selected entry in the list box. 51cdf0e10cSrcweir When nothing is selected, which is the case when getItemCount returns '0', 52cdf0e10cSrcweir then this function returns EXTENSION_LISTBOX_ENTRY_NOTFOUND */ 53cdf0e10cSrcweir virtual sal_Int32 getSelIndex() const = 0; 54cdf0e10cSrcweir 55cdf0e10cSrcweir /** @return The item name of the entry with the given index 56cdf0e10cSrcweir The index starts with 0. 57cdf0e10cSrcweir Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */ 58cdf0e10cSrcweir virtual ::rtl::OUString getItemName( sal_Int32 index ) const = 0; 59cdf0e10cSrcweir 60cdf0e10cSrcweir /** @return The version string of the entry with the given index 61cdf0e10cSrcweir The index starts with 0. 62cdf0e10cSrcweir Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */ 63cdf0e10cSrcweir virtual ::rtl::OUString getItemVersion( sal_Int32 index ) const = 0; 64cdf0e10cSrcweir 65cdf0e10cSrcweir /** @return The description string of the entry with the given index 66cdf0e10cSrcweir The index starts with 0. 67cdf0e10cSrcweir Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */ 68cdf0e10cSrcweir virtual ::rtl::OUString getItemDescription( sal_Int32 index ) const = 0; 69cdf0e10cSrcweir 70cdf0e10cSrcweir /** @return The publisher string of the entry with the given index 71cdf0e10cSrcweir The index starts with 0. 72cdf0e10cSrcweir Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */ 73cdf0e10cSrcweir virtual ::rtl::OUString getItemPublisher( sal_Int32 index ) const = 0; 74cdf0e10cSrcweir 75cdf0e10cSrcweir /** @return The link behind the publisher text of the entry with the given index 76cdf0e10cSrcweir The index starts with 0. 77cdf0e10cSrcweir Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */ 78cdf0e10cSrcweir virtual ::rtl::OUString getItemPublisherLink( sal_Int32 index ) const = 0; 79cdf0e10cSrcweir 80cdf0e10cSrcweir /** The entry at the given position will be selected 81cdf0e10cSrcweir Index starts with 0. 82cdf0e10cSrcweir Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */ 83cdf0e10cSrcweir virtual void select( sal_Int32 index ) = 0; 84cdf0e10cSrcweir 85cdf0e10cSrcweir /** The first found entry with the given name will be selected 86cdf0e10cSrcweir When there was no entry found with the name, the selection doesn't change. 87cdf0e10cSrcweir Please note that there might be more than one entry with the same 88cdf0e10cSrcweir name, because: 89cdf0e10cSrcweir 1. the name is not unique 90cdf0e10cSrcweir 2. one extension can be installed as user and shared extension. 91cdf0e10cSrcweir */ 92cdf0e10cSrcweir virtual void select( const ::rtl::OUString & sName ) = 0; 93cdf0e10cSrcweir }; 94cdf0e10cSrcweir // ============================================================================ 95cdf0e10cSrcweir 96cdf0e10cSrcweir } // namespace svt 97cdf0e10cSrcweir 98cdf0e10cSrcweir // ============================================================================ 99cdf0e10cSrcweir 100cdf0e10cSrcweir #endif // _SVTOOLS_EXTENSIONLISTBOX_HXX 101cdf0e10cSrcweir 102