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 .
20 #ifndef INCLUDED_EXTENSIONS_SOURCE_OLE_JSCRIPTCLASSES_HXX
21 #define INCLUDED_EXTENSIONS_SOURCE_OLE_JSCRIPTCLASSES_HXX
23 #include "wincrap.hxx"
25 #include "comifaces.hxx"
28 // Sequences are represented by prepending "[]", e.g. []char, [][]byte, [][][]object, etc.
30 // To make a JScriptValue object to an out parameter, call
31 // "InitOutParam" and to make it a in/out parameter call
34 // If the object represents an out parameter then the value can after the call
35 // be retrieved by "Get".
37 // From JavaScript the functions Get, Set, InitOutParam and InitInOutParam are
38 // used, that is they are accessible through IDispatch. The functions are used
42 public CComObjectRootEx
<CComMultiThreadModel
>,
43 public IJScriptValueObject
,
48 virtual ~JScriptValue();
50 BEGIN_COM_MAP(JScriptValue
)
51 COM_INTERFACE_ENTRY(IDispatch
)
52 COM_INTERFACE_ENTRY(IJScriptValueObject
)
54 #pragma clang diagnostic push
55 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
59 #pragma clang diagnostic pop
62 // IDispatch -------------------------------------------
63 STDMETHOD( GetTypeInfoCount
)(UINT
*pctinfo
) override
;
65 STDMETHOD( GetTypeInfo
)( UINT iTInfo
,
67 ITypeInfo
**ppTInfo
) override
;
69 STDMETHOD( GetIDsOfNames
)( REFIID riid
,
73 DISPID
*rgDispId
) override
;
75 STDMETHOD( Invoke
)( DISPID dispIdMember
,
79 DISPPARAMS
*pDispParams
,
81 EXCEPINFO
*pExcepInfo
,
82 UINT
*puArgErr
) override
;
83 // IJScriptOutParam --------------------------------------
85 STDMETHOD( Set
)( VARIANT type
, VARIANT value
) override
;
86 STDMETHOD( Get
)( VARIANT
*val
) override
;
87 STDMETHOD( InitOutParam
)() override
;
88 STDMETHOD( InitInOutParam
)( VARIANT type
, VARIANT value
) override
;
89 STDMETHOD( IsOutParam
)( VARIANT_BOOL
* flag
) override
;
90 STDMETHOD( IsInOutParam
)( VARIANT_BOOL
* flag
) override
;
91 STDMETHOD( GetValue
)( BSTR
* type
, VARIANT
*value
) override
;
94 CComVariant m_varValue
;
97 bool m_bInOutParam
: 1;
101 // If a class is implemented in JScript, then its method
102 class JScriptOutParam
:
103 public CComObjectRootEx
<CComMultiThreadModel
>,
108 virtual ~JScriptOutParam();
110 BEGIN_COM_MAP(JScriptOutParam
)
111 COM_INTERFACE_ENTRY(IDispatch
)
112 #if defined __clang__
113 #pragma clang diagnostic push
114 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
117 #if defined __clang__
118 #pragma clang diagnostic pop
121 // IDispatch -------------------------------------------
122 STDMETHOD( GetTypeInfoCount
)(UINT
*pctinfo
) override
;
124 STDMETHOD( GetTypeInfo
)( UINT iTInfo
,
126 ITypeInfo
**ppTInfo
) override
;
128 STDMETHOD( GetIDsOfNames
)( REFIID riid
,
132 DISPID
*rgDispId
) override
;
134 STDMETHOD( Invoke
)( DISPID dispIdMember
,
138 DISPPARAMS
*pDispParams
,
140 EXCEPINFO
*pExcepInfo
,
141 UINT
*puArgErr
) override
;
145 CComVariant m_varValue
;
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */