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