1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: textconversionImpl.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _I18N_TEXTCONERSION_HXX_
31 #define _I18N_TEXTCONERSION_HXX_
33 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/i18n/XExtendedTextConversion.hpp>
36 #include <cppuhelper/implbase2.hxx> // helper for implementations
38 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
40 // ----------------------------------------------------
41 // class TextConversion
42 // ----------------------------------------------------
43 class TextConversionImpl
: public cppu::WeakImplHelper2
45 com::sun::star::i18n::XExtendedTextConversion
,
46 com::sun::star::lang::XServiceInfo
50 TextConversionImpl( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rxMSF
) : xMSF(rxMSF
) {};
53 com::sun::star::i18n::TextConversionResult SAL_CALL
54 getConversions( const ::rtl::OUString
& aText
, sal_Int32 nStartPos
, sal_Int32 nLength
,
55 const ::com::sun::star::lang::Locale
& aLocale
, sal_Int16 nTextConversionType
,
56 sal_Int32 nTextConversionOptions
)
57 throw( com::sun::star::uno::RuntimeException
,
58 com::sun::star::lang::IllegalArgumentException
,
59 com::sun::star::lang::NoSupportException
);
60 rtl::OUString SAL_CALL
61 getConversion( const ::rtl::OUString
& aText
, sal_Int32 nStartPos
, sal_Int32 nLength
,
62 const ::com::sun::star::lang::Locale
& aLocale
, sal_Int16 nTextConversionType
,
63 sal_Int32 nTextConversionOptions
)
64 throw( com::sun::star::uno::RuntimeException
,
65 com::sun::star::lang::IllegalArgumentException
,
66 com::sun::star::lang::NoSupportException
);
67 rtl::OUString SAL_CALL
68 getConversionWithOffset( const ::rtl::OUString
& aText
, sal_Int32 nStartPos
, sal_Int32 nLength
,
69 const ::com::sun::star::lang::Locale
& aLocale
, sal_Int16 nTextConversionType
,
70 sal_Int32 nTextConversionOptions
, com::sun::star::uno::Sequence
< sal_Int32
>& offset
)
71 throw( com::sun::star::uno::RuntimeException
,
72 com::sun::star::lang::IllegalArgumentException
,
73 com::sun::star::lang::NoSupportException
);
75 interactiveConversion( const ::com::sun::star::lang::Locale
& aLocale
,
76 sal_Int16 nTextConversionType
, sal_Int32 nTextConversionOptions
)
77 throw( com::sun::star::uno::RuntimeException
,
78 com::sun::star::lang::IllegalArgumentException
,
79 com::sun::star::lang::NoSupportException
);
82 rtl::OUString SAL_CALL
83 getImplementationName()
84 throw( com::sun::star::uno::RuntimeException
);
86 supportsService(const rtl::OUString
& ServiceName
)
87 throw( com::sun::star::uno::RuntimeException
);
88 com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
89 getSupportedServiceNames()
90 throw( com::sun::star::uno::RuntimeException
);
92 com::sun::star::lang::Locale aLocale
;
93 com::sun::star::uno::Reference
< com::sun::star::i18n::XExtendedTextConversion
> xTC
;
94 com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
> xMSF
;
96 void SAL_CALL
getLocaleSpecificTextConversion( const com::sun::star::lang::Locale
& rLocale
)
97 throw( com::sun::star::lang::NoSupportException
);