bump product version to 5.0.4.1
[LibreOffice.git] / extensions / source / ole / jscriptclasses.hxx
blob281ac5f4c62241d9a70aae1208846d7c73a8c093
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 .
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
33 // "InitInOutParam"
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
40 // by the bridge.
42 class JScriptValue:
43 public CComObjectRootEx<CComMultiThreadModel>,
44 public IJScriptValueObject,
45 public IDispatch
47 public:
48 JScriptValue();
49 virtual ~JScriptValue();
51 BEGIN_COM_MAP(JScriptValue)
52 COM_INTERFACE_ENTRY(IDispatch)
53 COM_INTERFACE_ENTRY(IJScriptValueObject)
54 END_COM_MAP()
56 // IDispatch -------------------------------------------
57 STDMETHOD( GetTypeInfoCount)(UINT *pctinfo);
59 STDMETHOD( GetTypeInfo)( UINT iTInfo,
60 LCID lcid,
61 ITypeInfo **ppTInfo);
63 STDMETHOD( GetIDsOfNames)( REFIID riid,
64 LPOLESTR *rgszNames,
65 UINT cNames,
66 LCID lcid,
67 DISPID *rgDispId);
69 STDMETHOD( Invoke)( DISPID dispIdMember,
70 REFIID riid,
71 LCID lcid,
72 WORD wFlags,
73 DISPPARAMS *pDispParams,
74 VARIANT *pVarResult,
75 EXCEPINFO *pExcepInfo,
76 UINT *puArgErr);
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;
89 CComBSTR m_bstrType;
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>,
98 public IDispatch
100 public:
101 JScriptOutParam();
102 virtual ~JScriptOutParam();
104 BEGIN_COM_MAP(JScriptOutParam)
105 COM_INTERFACE_ENTRY(IDispatch)
106 END_COM_MAP()
108 // IDispatch -------------------------------------------
109 STDMETHOD( GetTypeInfoCount)(UINT *pctinfo);
111 STDMETHOD( GetTypeInfo)( UINT iTInfo,
112 LCID lcid,
113 ITypeInfo **ppTInfo);
115 STDMETHOD( GetIDsOfNames)( REFIID riid,
116 LPOLESTR *rgszNames,
117 UINT cNames,
118 LCID lcid,
119 DISPID *rgDispId);
121 STDMETHOD( Invoke)( DISPID dispIdMember,
122 REFIID riid,
123 LCID lcid,
124 WORD wFlags,
125 DISPPARAMS *pDispParams,
126 VARIANT *pVarResult,
127 EXCEPINFO *pExcepInfo,
128 UINT *puArgErr);
131 private:
132 CComVariant m_varValue;
135 #endif
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */