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 20 : inline Locale::Locale() SAL_THROW(())
21 : : Language()
22 : , Country()
23 20 : , Variant()
24 : {
25 20 : }
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 12 : ::com::sun::star::uno::Type * operator()() const
41 : {
42 12 : ::rtl::OUString the_name( "com.sun.star.lang.Locale" );
43 12 : ::rtl::OUString the_tname0( "string" );
44 12 : ::rtl::OUString the_name0( "Language" );
45 12 : ::rtl::OUString the_name1( "Country" );
46 12 : ::rtl::OUString the_name2( "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 12 : { { typelib_TypeClass_STRING, the_tname0.pData, the_name2.pData }, false } };
51 12 : ::typelib_TypeDescription * the_newType = 0;
52 12 : ::typelib_typedescription_newStruct(&the_newType, the_name.pData, 0, 3, the_members);
53 12 : ::typelib_typedescription_register(&the_newType);
54 12 : ::typelib_typedescription_release(the_newType);
55 12 : 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 36 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::lang::Locale const *) {
63 36 : return *detail::theLocaleType::get();
64 : }
65 :
66 : } } } }
67 :
68 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER css::lang::Locale const *) SAL_THROW(()) {
69 : return ::cppu::UnoType< css::lang::Locale >::get();
70 : }
71 :
72 : #endif // INCLUDED_COM_SUN_STAR_LANG_LOCALE_HPP
|