Branch data Line data Source code
1 : : #ifndef INCLUDED_COM_SUN_STAR_LANG_LOCALE_HPP
2 : : #define INCLUDED_COM_SUN_STAR_LANG_LOCALE_HPP
3 : :
4 : : #include "sal/config.h"
5 : :
6 : : #include "com/sun/star/lang/Locale.hdl"
7 : :
8 : : #include "com/sun/star/uno/Type.hxx"
9 : : #include "cppu/unotype.hxx"
10 : : #include "osl/mutex.hxx"
11 : : #include "rtl/ustring.h"
12 : : #include "rtl/ustring.hxx"
13 : : #include "rtl/instance.hxx"
14 : : #include "sal/types.h"
15 : : #include "typelib/typeclass.h"
16 : : #include "typelib/typedescription.h"
17 : :
18 : : namespace com { namespace sun { namespace star { namespace lang {
19 : :
20 : 38 : inline Locale::Locale() SAL_THROW(())
21 : : : Language()
22 : : , Country()
23 : 38 : , Variant()
24 : : {
25 : 38 : }
26 : :
27 : : inline Locale::Locale(const ::rtl::OUString& Language_, const ::rtl::OUString& Country_, const ::rtl::OUString& Variant_) SAL_THROW(())
28 : : : Language(Language_)
29 : : , Country(Country_)
30 : : , Variant(Variant_)
31 : : {
32 : : }
33 : :
34 : : } } } }
35 : :
36 : : namespace com { namespace sun { namespace star { namespace lang { namespace detail {
37 : :
38 : : struct theLocaleType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theLocaleType >
39 : : {
40 : 34 : ::com::sun::star::uno::Type * operator()() const
41 : : {
42 [ + - ]: 34 : ::rtl::OUString the_name(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.Locale"));
43 [ + - ]: 34 : ::rtl::OUString the_tname0(RTL_CONSTASCII_USTRINGPARAM("string"));
44 [ + - ]: 34 : ::rtl::OUString the_name0(RTL_CONSTASCII_USTRINGPARAM("Language"));
45 [ + - ]: 34 : ::rtl::OUString the_name1(RTL_CONSTASCII_USTRINGPARAM("Country"));
46 [ + - ]: 34 : ::rtl::OUString the_name2(RTL_CONSTASCII_USTRINGPARAM("Variant"));
47 : : ::typelib_StructMember_Init the_members[] = {
48 : : { { typelib_TypeClass_STRING, the_tname0.pData, the_name0.pData }, false },
49 : : { { typelib_TypeClass_STRING, the_tname0.pData, the_name1.pData }, false },
50 : 34 : { { typelib_TypeClass_STRING, the_tname0.pData, the_name2.pData }, false } };
51 : 34 : ::typelib_TypeDescription * the_newType = 0;
52 : 34 : ::typelib_typedescription_newStruct(&the_newType, the_name.pData, 0, 3, the_members);
53 : 34 : ::typelib_typedescription_register(&the_newType);
54 : 34 : ::typelib_typedescription_release(the_newType);
55 : 34 : return new ::com::sun::star::uno::Type(::com::sun::star::uno::TypeClass_STRUCT, the_name); // leaked
56 : : }
57 : : };
58 : : } } } } }
59 : :
60 : : namespace com { namespace sun { namespace star { namespace lang {
61 : :
62 : 85 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::com::sun::star::lang::Locale const *) {
63 : 85 : return *detail::theLocaleType::get();
64 : : }
65 : :
66 : : } } } }
67 : :
68 : : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::lang::Locale const *) SAL_THROW(()) {
69 : : return ::cppu::UnoType< ::com::sun::star::lang::Locale >::get();
70 : : }
71 : :
72 : : #endif // INCLUDED_COM_SUN_STAR_LANG_LOCALE_HPP
|