xmloff: ODF export: stop producing decorative on draw:frame etc.
[LibreOffice.git] / shell / inc / spsupp / COMOpenDocuments.hpp
blob07cc8c3d36a5dc0cfd5997a5dbe1136eae9b0f4d
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/.
8 */
10 #ifndef INCLUDED_SHELL_INC_SPSUPP_COMOPENDOCUMENTS_HPP
11 #define INCLUDED_SHELL_INC_SPSUPP_COMOPENDOCUMENTS_HPP
13 #include <spsupp_h.h>
14 #include "COMRefCounted.hpp"
15 #include <Objsafe.h>
16 #include <assert.h>
18 class COMOpenDocuments : public COMRefCounted<IOWSNewDocument3, IObjectSafety>
20 public:
22 class Error {
23 public:
24 Error(HRESULT syserr) : m_nErr(syserr) {}
25 HRESULT val() const { return m_nErr; }
26 private:
27 HRESULT m_nErr;
30 COMOpenDocuments();
31 virtual ~COMOpenDocuments() override;
33 // IUnknown methods
35 HRESULT STDMETHODCALLTYPE QueryInterface(
36 REFIID riid,
37 void **ppvObject) override;
39 // IDispatch methods
41 HRESULT STDMETHODCALLTYPE GetTypeInfoCount(
42 UINT *pctinfo) override;
44 HRESULT STDMETHODCALLTYPE GetTypeInfo(
45 UINT iTInfo,
46 LCID lcid,
47 ITypeInfo **ppTInfo) override;
49 HRESULT STDMETHODCALLTYPE GetIDsOfNames(
50 REFIID riid,
51 LPOLESTR *rgszNames,
52 UINT cNames,
53 LCID lcid,
54 DISPID *rgDispId) override;
56 HRESULT STDMETHODCALLTYPE Invoke(
57 DISPID dispIdMember,
58 REFIID riid,
59 LCID lcid,
60 WORD wFlags,
61 DISPPARAMS *pDispParams,
62 VARIANT *pVarResult,
63 EXCEPINFO *pExcepInfo,
64 UINT *puArgErr) override;
66 // IOWSNewDocument methods https://msdn.microsoft.com/en-us/library/cc264316
68 HRESULT STDMETHODCALLTYPE CreateNewDocument(
69 BSTR bstrTemplateLocation,
70 BSTR bstrDefaultSaveLocation,
71 VARIANT_BOOL *pbResult) override;
73 HRESULT STDMETHODCALLTYPE EditDocument(
74 BSTR bstrDocumentLocation,
75 VARIANT varProgID,
76 VARIANT_BOOL *pbResult) override;
78 // IOWSNewDocument2 methods
80 HRESULT STDMETHODCALLTYPE ViewDocument(
81 BSTR bstrDocumentLocation,
82 VARIANT varProgID,
83 VARIANT_BOOL *pbResult) override;
85 HRESULT STDMETHODCALLTYPE ViewDocument2(
86 IDispatch *pdisp,
87 BSTR bstrDocumentLocation,
88 VARIANT varProgID,
89 VARIANT_BOOL *pbResult) override;
91 HRESULT STDMETHODCALLTYPE EditDocument2(
92 IDispatch *pdisp,
93 BSTR bstrDocumentLocation,
94 VARIANT varProgID,
95 VARIANT_BOOL *pbResult) override;
97 HRESULT STDMETHODCALLTYPE CreateNewDocument2(
98 IDispatch *pdisp,
99 BSTR bstrTemplateLocation,
100 BSTR bstrDefaultSaveLocation,
101 VARIANT_BOOL *pbResult) override;
103 HRESULT STDMETHODCALLTYPE PromptedOnLastOpen(
104 VARIANT_BOOL *pbResult) override;
106 // IOWSNewDocument3 methods
108 HRESULT STDMETHODCALLTYPE ViewDocument3(
109 IDispatch *pdisp,
110 BSTR bstrDocumentLocation,
111 int OpenType,
112 VARIANT varProgID,
113 VARIANT_BOOL *pbResult) override;
115 HRESULT STDMETHODCALLTYPE CheckinDocument(
116 BSTR bstrDocumentLocation,
117 int CheckinType,
118 BSTR CheckinComment,
119 VARIANT_BOOL bKeepCheckout,
120 VARIANT_BOOL *pbResult) override;
122 HRESULT STDMETHODCALLTYPE DiscardLocalCheckout(
123 BSTR bstrDocumentLocationRaw,
124 VARIANT_BOOL *pbResult) override;
126 HRESULT STDMETHODCALLTYPE ViewInExcel(
127 BSTR SiteUrl,
128 BSTR FileName,
129 BSTR SessionId,
130 BSTR Cmd,
131 BSTR Sheet,
132 int Row,
133 int Column,
134 VARIANT varProgID) override;
136 HRESULT STDMETHODCALLTYPE CheckoutDocumentPrompt(
137 BSTR bstrDocumentLocationRaw,
138 VARIANT_BOOL fEditAfterCheckout,
139 VARIANT varProgID,
140 VARIANT_BOOL *pbResult) override;
142 HRESULT STDMETHODCALLTYPE EditDocument3(
143 IDispatch *pdisp,
144 BSTR bstrDocumentLocation,
145 VARIANT_BOOL fUseLocalCopy,
146 VARIANT varProgID,
147 VARIANT_BOOL *pbResult) override;
149 HRESULT STDMETHODCALLTYPE NewBlogPost(
150 BSTR bstrProviderId,
151 BSTR bstrBlogUrl,
152 BSTR bstrBlogName) override;
154 // IObjectSafety methods
156 HRESULT STDMETHODCALLTYPE GetInterfaceSafetyOptions(
157 REFIID riid,
158 DWORD *pdwSupportedOptions,
159 DWORD *pdwEnabledOptions) override;
161 HRESULT STDMETHODCALLTYPE SetInterfaceSafetyOptions(
162 REFIID riid,
163 DWORD dwOptionSetMask,
164 DWORD dwEnabledOptions) override;
166 // Non-COM methods
168 static LONG GetObjectCount();
170 private:
171 static LONG m_nObjCount;
172 static ITypeInfo* m_pTypeInfo;
173 static constexpr DWORD iSupportedOptionsMask = INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA;
174 DWORD m_iEnabledOptions = 0;
177 #endif
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */