1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _CONNECTIVITY_ADO_AOLEVARIANT_HXX_
29 #define _CONNECTIVITY_ADO_AOLEVARIANT_HXX_
31 #include <sal/types.h>
35 #include <rtl/ustring.hxx>
36 #include <com/sun/star/uno/Sequence.hxx>
38 #include "ado_pre_sys_include.h"
40 #include "ado_post_sys_include.h"
57 namespace connectivity
66 OLEString(const BSTR
& _sBStr
);
67 OLEString(const ::rtl::OUString
& _sBStr
);
68 OLEString(const OLEString
& _rRh
)
70 OLEString::operator=(_rRh
);
73 OLEString
& operator=(const ::rtl::OUString
& _rSrc
);
74 OLEString
& operator=(const BSTR
& _rSrc
);
75 OLEString
& operator=(const OLEString
& _rSrc
);
76 operator ::rtl::OUString() const;
77 operator BSTR() const;
79 sal_Int32
length() const;
82 class OLEVariant
: public ::tagVARIANT
86 OLEVariant(const VARIANT
& varSrc
);
87 OLEVariant(const OLEVariant
& varSrc
) ;
88 OLEVariant(sal_Bool x
) ;
89 OLEVariant(sal_Int8 n
) ;
90 OLEVariant(sal_Int16 n
) ;
91 OLEVariant(sal_Int32 n
) ;
92 OLEVariant(sal_Int64 x
) ;
94 OLEVariant(const rtl::OUString
& us
) ;
96 OLEVariant(const ::com::sun::star::util::Date
& x
);
97 OLEVariant(const ::com::sun::star::util::Time
& x
);
98 OLEVariant(const ::com::sun::star::util::DateTime
& x
);
99 OLEVariant(const float &x
);
100 OLEVariant(const double &x
);
101 OLEVariant(IDispatch
* pDispInterface
);
102 OLEVariant(const ::com::sun::star::uno::Sequence
< sal_Int8
>& x
);
103 OLEVariant
& operator=(const OLEVariant
& varSrc
);
104 // Assign a const VARIANT& (::VariantCopy handles everything)
106 OLEVariant
& operator=(const tagVARIANT
& varSrc
);
107 // Assign a const VARIANT* (::VariantCopy handles everything)
109 OLEVariant
& operator=(const VARIANT
* pSrc
);
110 void setByte(sal_uInt8 n
) ;
111 void setInt16(sal_Int16 n
) ;
112 void setInt32(sal_Int32 n
) ;
113 void setFloat(float f
) ;
114 void setDouble(double d
) ;
115 void setDate(DATE d
) ;
116 void setChar(unsigned char a
) ;
117 void setCurrency(double aCur
) ;
118 void setBool(sal_Bool b
) ;
119 void setString(const rtl::OUString
& us
) ;
122 void setIDispatch(IDispatch
* pDispInterface
);
126 void setUI1SAFEARRAYPtr(SAFEARRAY
* pSafeAr
);
127 void setArray(SAFEARRAY
* pSafeArray
, VARTYPE vtType
);
128 sal_Bool
isNull() const ;
129 sal_Bool
isEmpty() const ;
131 VARTYPE
getType() const ;
132 void ChangeType(VARTYPE vartype
, const OLEVariant
* pSrc
);
135 operator ::rtl::OUString() const;
137 operator sal_Bool() const { return getBool(); }
138 operator sal_Int8() const { return getInt8(); }
139 operator sal_Int16() const { return getInt16(); }
140 operator sal_Int32() const { return getInt32(); }
141 operator float() const { return getFloat(); }
142 operator double() const { return getDouble(); }
144 operator ::com::sun::star::uno::Sequence
< sal_Int8
>() const;
145 operator ::com::sun::star::util::Date() const ;
146 operator ::com::sun::star::util::Time() const ;
147 operator ::com::sun::star::util::DateTime()const ;
148 ::rtl::OUString
getString() const;
149 sal_Bool
getBool() const;
150 IUnknown
* getIUnknown() const;
151 IDispatch
* getIDispatch() const;
152 sal_uInt8
getByte() const;
153 sal_Int16
getInt16() const;
154 sal_Int8
getInt8() const;
155 sal_Int32
getInt32() const;
156 sal_uInt32
getUInt32() const;
157 float getFloat() const;
158 double getDouble() const;
159 double getDate() const;
160 CY
getCurrency() const;
161 SAFEARRAY
* getUI1SAFEARRAYPtr() const;
162 ::com::sun::star::uno::Any
makeAny() const;
164 static VARIANT_BOOL
VariantBool(sal_Bool bEinBoolean
);
175 #endif // _CONNECTIVITY_ADO_AOLEVARIANT_HXX_
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */