tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / connectivity / source / inc / ado / Aolevariant.hxx
blobba0653156a94f656bd64525dfe2892929cdbf313
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #pragma once
21 #include <sal/types.h>
22 #include <rtl/ustring.hxx>
23 #include <com/sun/star/uno/Sequence.hxx>
25 #include <oaidl.h>
27 namespace com::sun::star::util
29 struct Date;
30 struct Time;
31 struct DateTime;
34 namespace connectivity::ado
36 class OLEVariant : public ::tagVARIANT
38 public:
39 OLEVariant();
40 OLEVariant(const VARIANT& varSrc);
41 OLEVariant(const OLEVariant& varSrc) ;
42 OLEVariant(bool x) ;
43 OLEVariant(sal_Bool) = delete;
44 OLEVariant(sal_Int8 n) ;
45 OLEVariant(sal_Int16 n) ;
46 OLEVariant(sal_Int32 n) ;
47 OLEVariant(sal_Int64 x) ;
49 OLEVariant(std::u16string_view us);
50 OLEVariant(const OUString& us)
51 : OLEVariant(std::u16string_view(us))
54 ~OLEVariant() ;
55 OLEVariant(const css::util::Date& x );
56 OLEVariant(const css::util::Time& x );
57 OLEVariant(const css::util::DateTime& x );
58 OLEVariant(float x);
59 OLEVariant(const double &x);
60 OLEVariant(IDispatch* pDispInterface);
61 OLEVariant(const css::uno::Sequence< sal_Int8 >& x);
62 OLEVariant& operator=(const OLEVariant& varSrc);
63 // Assign a const VARIANT& (::VariantCopy handles everything)
65 OLEVariant& operator=(const tagVARIANT& varSrc);
66 // Assign a const VARIANT* (::VariantCopy handles everything)
68 OLEVariant& operator=(const VARIANT* pSrc);
69 void setByte(sal_uInt8 n) ;
70 void setInt16(sal_Int16 n) ;
71 void setInt32(sal_Int32 n) ;
72 void setFloat(float f) ;
73 void setDouble(double d) ;
74 void setDate(DATE d) ;
75 void setChar(unsigned char a) ;
76 void setCurrency(double aCur) ;
77 void setBool(bool b) ;
78 void setString(std::u16string_view us);
79 void setNoArg() ;
81 void setIDispatch(IDispatch* pDispInterface);
82 void setNull() ;
83 void setEmpty() ;
85 void setUI1SAFEARRAYPtr(SAFEARRAY* pSafeAr);
86 void setArray(SAFEARRAY* pSafeArray, VARTYPE vtType);
87 bool isNull() const ;
88 bool isEmpty() const ;
90 VARTYPE getType() const ;
91 void ChangeType(VARTYPE vartype, const OLEVariant* pSrc);
93 OUString getString() const;
94 bool getBool() const;
95 IUnknown* getIUnknown() const;
96 IDispatch* getIDispatch() const;
97 sal_uInt8 getByte() const;
98 sal_Int16 getInt16() const;
99 sal_Int8 getInt8() const;
100 sal_Int32 getInt32() const;
101 sal_uInt32 getUInt32() const;
102 float getFloat() const;
103 double getDouble() const;
104 double getDateAsDouble() const;
105 CY getCurrency() const;
106 css::util::Date getDate() const;
107 css::util::Time getTime() const;
108 css::util::DateTime getDateTime() const;
109 css::uno::Sequence<sal_Int8> getByteSequence() const;
110 SAFEARRAY* getUI1SAFEARRAYPtr() const;
111 css::uno::Any makeAny() const;
113 static VARIANT_BOOL VariantBool(bool bEinBoolean);
115 private:
116 void CHS();
118 void set(double n);
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */