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"
29 // Sequences are represented by prepending "[]", e.g. []char, [][]byte, [][][]object, etc.
31 // To make a JScriptValue object to an out parameter, call
32 // "InitOutParam" and to make it a in/out parameter call
35 // If the object represents an out parameter then the value can after the call
36 // be retrieved by "Get".
38 // From JavaScript the functions Get, Set, InitOutParam and InitInOutParam are
39 // used, that is they are accessible through IDispatch. The functions are used
43 public CComObjectRootEx
<CComMultiThreadModel
>,
44 public IJScriptValueObject
,
49 virtual ~JScriptValue();
51 BEGIN_COM_MAP(JScriptValue
)
52 COM_INTERFACE_ENTRY(IDispatch
)
53 COM_INTERFACE_ENTRY(IJScriptValueObject
)
56 // IDispatch -------------------------------------------
57 STDMETHOD( GetTypeInfoCount
)(UINT
*pctinfo
);
59 STDMETHOD( GetTypeInfo
)( UINT iTInfo
,
63 STDMETHOD( GetIDsOfNames
)( REFIID riid
,
69 STDMETHOD( Invoke
)( DISPID dispIdMember
,
73 DISPPARAMS
*pDispParams
,
75 EXCEPINFO
*pExcepInfo
,
77 // IJScriptOutParam --------------------------------------
79 STDMETHOD( Set
)( VARIANT type
, VARIANT value
);
80 STDMETHOD( Get
)( VARIANT
*val
);
81 STDMETHOD( InitOutParam
)();
82 STDMETHOD( InitInOutParam
)( VARIANT type
, VARIANT value
);
83 STDMETHOD( IsOutParam
)( VARIANT_BOOL
* flag
);
84 STDMETHOD( IsInOutParam
)( VARIANT_BOOL
* flag
);
85 STDMETHOD( GetValue
)( BSTR
* type
, VARIANT
*value
);
88 CComVariant m_varValue
;
90 unsigned m_bOutParam
: 1;
91 unsigned m_bInOutParam
: 1;
95 // If a class is implemented in JScript, then its method
96 class JScriptOutParam
:
97 public CComObjectRootEx
<CComMultiThreadModel
>,
102 virtual ~JScriptOutParam();
104 BEGIN_COM_MAP(JScriptOutParam
)
105 COM_INTERFACE_ENTRY(IDispatch
)
108 // IDispatch -------------------------------------------
109 STDMETHOD( GetTypeInfoCount
)(UINT
*pctinfo
);
111 STDMETHOD( GetTypeInfo
)( UINT iTInfo
,
113 ITypeInfo
**ppTInfo
);
115 STDMETHOD( GetIDsOfNames
)( REFIID riid
,
121 STDMETHOD( Invoke
)( DISPID dispIdMember
,
125 DISPPARAMS
*pDispParams
,
127 EXCEPINFO
*pExcepInfo
,
132 CComVariant m_varValue
;
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */