Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / extensions / source / ole / jscriptclasses.hxx
blobcef993ed04de71dc344f25f835626ca855296cc0
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 #pragma once
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
31 // "InitInOutParam"
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
38 // by the bridge.
40 class JScriptValue:
41 public CComObjectRootEx<CComMultiThreadModel>,
42 public IJScriptValueObject,
43 public IDispatch
45 public:
46 JScriptValue();
47 virtual ~JScriptValue();
49 BEGIN_COM_MAP(JScriptValue)
50 COM_INTERFACE_ENTRY(IDispatch)
51 COM_INTERFACE_ENTRY(IJScriptValueObject)
52 #if defined __clang__
53 #pragma clang diagnostic push
54 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
55 #endif
56 END_COM_MAP()
57 #if defined __clang__
58 #pragma clang diagnostic pop
59 #endif
61 // IDispatch -------------------------------------------
62 STDMETHOD( GetTypeInfoCount)(UINT *pctinfo) override;
64 STDMETHOD( GetTypeInfo)( UINT iTInfo,
65 LCID lcid,
66 ITypeInfo **ppTInfo) override;
68 STDMETHOD( GetIDsOfNames)( REFIID riid,
69 LPOLESTR *rgszNames,
70 UINT cNames,
71 LCID lcid,
72 DISPID *rgDispId) override;
74 STDMETHOD( Invoke)( DISPID dispIdMember,
75 REFIID riid,
76 LCID lcid,
77 WORD wFlags,
78 DISPPARAMS *pDispParams,
79 VARIANT *pVarResult,
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;
94 CComBSTR m_bstrType;
95 bool m_bOutParam: 1;
96 bool m_bInOutParam: 1;
100 // If a class is implemented in JScript, then its method
101 class JScriptOutParam:
102 public CComObjectRootEx<CComMultiThreadModel>,
103 public IDispatch
105 public:
106 JScriptOutParam();
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"
114 #endif
115 END_COM_MAP()
116 #if defined __clang__
117 #pragma clang diagnostic pop
118 #endif
120 // IDispatch -------------------------------------------
121 STDMETHOD( GetTypeInfoCount)(UINT *pctinfo) override;
123 STDMETHOD( GetTypeInfo)( UINT iTInfo,
124 LCID lcid,
125 ITypeInfo **ppTInfo) override;
127 STDMETHOD( GetIDsOfNames)( REFIID riid,
128 LPOLESTR *rgszNames,
129 UINT cNames,
130 LCID lcid,
131 DISPID *rgDispId) override;
133 STDMETHOD( Invoke)( DISPID dispIdMember,
134 REFIID riid,
135 LCID lcid,
136 WORD wFlags,
137 DISPPARAMS *pDispParams,
138 VARIANT *pVarResult,
139 EXCEPINFO *pExcepInfo,
140 UINT *puArgErr) override;
143 private:
144 CComVariant m_varValue;
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */