1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include "wincrap.hxx"
24 #include "comifaces.hxx"
27 // Sequences are represented by prepending "[]", e.g. []char, [][]byte, [][][]object, etc.
29 // To make a JScriptValue object to an out parameter, call
30 // "InitOutParam" and to make it a in/out parameter call
33 // If the object represents an out parameter then the value can after the call
34 // be retrieved by "Get".
36 // From JavaScript the functions Get, Set, InitOutParam and InitInOutParam are
37 // used, that is they are accessible through IDispatch. The functions are used
41 public CComObjectRootEx
<CComMultiThreadModel
>,
42 public IJScriptValueObject
,
47 virtual ~JScriptValue();
49 BEGIN_COM_MAP(JScriptValue
)
50 COM_INTERFACE_ENTRY(IDispatch
)
51 COM_INTERFACE_ENTRY(IJScriptValueObject
)
53 #pragma clang diagnostic push
54 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
58 #pragma clang diagnostic pop
61 // IDispatch -------------------------------------------
62 STDMETHOD( GetTypeInfoCount
)(UINT
*pctinfo
) override
;
64 STDMETHOD( GetTypeInfo
)( UINT iTInfo
,
66 ITypeInfo
**ppTInfo
) override
;
68 STDMETHOD( GetIDsOfNames
)( REFIID riid
,
72 DISPID
*rgDispId
) override
;
74 STDMETHOD( Invoke
)( DISPID dispIdMember
,
78 DISPPARAMS
*pDispParams
,
80 EXCEPINFO
*pExcepInfo
,
81 UINT
*puArgErr
) override
;
82 // IJScriptOutParam --------------------------------------
84 STDMETHOD( Set
)( VARIANT type
, VARIANT value
) override
;
85 STDMETHOD( Get
)( VARIANT
*val
) override
;
86 STDMETHOD( InitOutParam
)() override
;
87 STDMETHOD( InitInOutParam
)( VARIANT type
, VARIANT value
) override
;
88 STDMETHOD( IsOutParam
)( VARIANT_BOOL
* flag
) override
;
89 STDMETHOD( IsInOutParam
)( VARIANT_BOOL
* flag
) override
;
90 STDMETHOD( GetValue
)( BSTR
* type
, VARIANT
*value
) override
;
93 CComVariant m_varValue
;
96 bool m_bInOutParam
: 1;
100 // If a class is implemented in JScript, then its method
101 class JScriptOutParam
:
102 public CComObjectRootEx
<CComMultiThreadModel
>,
107 virtual ~JScriptOutParam();
109 BEGIN_COM_MAP(JScriptOutParam
)
110 COM_INTERFACE_ENTRY(IDispatch
)
111 #if defined __clang__
112 #pragma clang diagnostic push
113 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
116 #if defined __clang__
117 #pragma clang diagnostic pop
120 // IDispatch -------------------------------------------
121 STDMETHOD( GetTypeInfoCount
)(UINT
*pctinfo
) override
;
123 STDMETHOD( GetTypeInfo
)( UINT iTInfo
,
125 ITypeInfo
**ppTInfo
) override
;
127 STDMETHOD( GetIDsOfNames
)( REFIID riid
,
131 DISPID
*rgDispId
) override
;
133 STDMETHOD( Invoke
)( DISPID dispIdMember
,
137 DISPPARAMS
*pDispParams
,
139 EXCEPINFO
*pExcepInfo
,
140 UINT
*puArgErr
) override
;
144 CComVariant m_varValue
;
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */