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 LAYOUT_CORE_LOCALIZED_STRING_HXX 29 #define LAYOUT_CORE_LOCALIZED_STRING_HXX 30 31 #include <com/sun/star/awt/XFixedText.hpp> 32 #include <toolkit/awt/vclxwindow.hxx> 33 34 namespace layoutimpl 35 { 36 namespace css = ::com::sun::star; 37 38 // FIXME: misuse XFixedText interface for simple string 39 class LocalizedString : public css::awt::XFixedText 40 , public VCLXWindow 41 { 42 public: 43 LocalizedString(); 44 45 // css::uno::XInterface 46 css::uno::Any SAL_CALL queryInterface( css::uno::Type const& rType ) 47 throw(css::uno::RuntimeException); 48 void SAL_CALL acquire() throw() { OWeakObject::acquire(); } 49 void SAL_CALL release() throw() { OWeakObject::release(); } 50 51 // css::awt::XFixedText 52 void SAL_CALL setText( ::rtl::OUString const& s ) 53 throw(css::uno::RuntimeException); 54 ::rtl::OUString SAL_CALL getText() 55 throw(css::uno::RuntimeException); 56 void SAL_CALL setAlignment( sal_Int16 ) 57 throw(css::uno::RuntimeException) { } 58 sal_Int16 SAL_CALL getAlignment() 59 throw(css::uno::RuntimeException) { return 0; } 60 61 // css::awt::XLayoutConstrains 62 virtual css::awt::Size SAL_CALL getMinimumSize() 63 throw(css::uno::RuntimeException) { return css::awt::Size( 0, 0 ); } 64 css::awt::Size SAL_CALL getPreferredSize() 65 throw(css::uno::RuntimeException) { return getMinimumSize(); } 66 css::awt::Size SAL_CALL calcAdjustedSize( css::awt::Size const& size ) 67 throw(css::uno::RuntimeException) { return size; } 68 69 static void ImplGetPropertyIds( std::list< sal_uInt16 > &ids ); 70 virtual void GetPropertyIds( std::list< sal_uInt16 > &ids ) 71 { return ImplGetPropertyIds( ids ); } 72 }; 73 74 } // namespace layoutimpl 75 76 #endif /* LAYOUT_CORE_LOCALIZED_STRING_HXX */ 77