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/.
10 #ifndef INCLUDED_SHELL_INC_SPSUPP_COMOPENDOCUMENTS_HPP
11 #define INCLUDED_SHELL_INC_SPSUPP_COMOPENDOCUMENTS_HPP
14 #pragma clang diagnostic push
15 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
19 #pragma clang diagnostic pop
21 #include "COMRefCounted.hpp"
25 class COMOpenDocuments
: public COMRefCounted
<IOWSNewDocument3
, IObjectSafety
>
31 Error(HRESULT syserr
) : m_nErr(syserr
) {}
32 HRESULT
val() const { return m_nErr
; }
38 virtual ~COMOpenDocuments() override
;
42 HRESULT STDMETHODCALLTYPE
QueryInterface(
44 void **ppvObject
) override
;
48 HRESULT STDMETHODCALLTYPE
GetTypeInfoCount(
49 UINT
*pctinfo
) override
;
51 HRESULT STDMETHODCALLTYPE
GetTypeInfo(
54 ITypeInfo
**ppTInfo
) override
;
56 HRESULT STDMETHODCALLTYPE
GetIDsOfNames(
61 DISPID
*rgDispId
) override
;
63 HRESULT STDMETHODCALLTYPE
Invoke(
68 DISPPARAMS
*pDispParams
,
70 EXCEPINFO
*pExcepInfo
,
71 UINT
*puArgErr
) override
;
73 // IOWSNewDocument methods https://msdn.microsoft.com/en-us/library/cc264316
75 HRESULT STDMETHODCALLTYPE
CreateNewDocument(
76 BSTR bstrTemplateLocation
,
77 BSTR bstrDefaultSaveLocation
,
78 VARIANT_BOOL
*pbResult
) override
;
80 HRESULT STDMETHODCALLTYPE
EditDocument(
81 BSTR bstrDocumentLocation
,
83 VARIANT_BOOL
*pbResult
) override
;
85 // IOWSNewDocument2 methods
87 HRESULT STDMETHODCALLTYPE
ViewDocument(
88 BSTR bstrDocumentLocation
,
90 VARIANT_BOOL
*pbResult
) override
;
92 HRESULT STDMETHODCALLTYPE
ViewDocument2(
94 BSTR bstrDocumentLocation
,
96 VARIANT_BOOL
*pbResult
) override
;
98 HRESULT STDMETHODCALLTYPE
EditDocument2(
100 BSTR bstrDocumentLocation
,
102 VARIANT_BOOL
*pbResult
) override
;
104 HRESULT STDMETHODCALLTYPE
CreateNewDocument2(
106 BSTR bstrTemplateLocation
,
107 BSTR bstrDefaultSaveLocation
,
108 VARIANT_BOOL
*pbResult
) override
;
110 HRESULT STDMETHODCALLTYPE
PromptedOnLastOpen(
111 VARIANT_BOOL
*pbResult
) override
;
113 // IOWSNewDocument3 methods
115 HRESULT STDMETHODCALLTYPE
ViewDocument3(
117 BSTR bstrDocumentLocation
,
120 VARIANT_BOOL
*pbResult
) override
;
122 HRESULT STDMETHODCALLTYPE
CheckinDocument(
123 BSTR bstrDocumentLocation
,
126 VARIANT_BOOL bKeepCheckout
,
127 VARIANT_BOOL
*pbResult
) override
;
129 HRESULT STDMETHODCALLTYPE
DiscardLocalCheckout(
130 BSTR bstrDocumentLocationRaw
,
131 VARIANT_BOOL
*pbResult
) override
;
133 HRESULT STDMETHODCALLTYPE
ViewInExcel(
141 VARIANT varProgID
) override
;
143 HRESULT STDMETHODCALLTYPE
CheckoutDocumentPrompt(
144 BSTR bstrDocumentLocationRaw
,
145 VARIANT_BOOL fEditAfterCheckout
,
147 VARIANT_BOOL
*pbResult
) override
;
149 HRESULT STDMETHODCALLTYPE
EditDocument3(
151 BSTR bstrDocumentLocation
,
152 VARIANT_BOOL fUseLocalCopy
,
154 VARIANT_BOOL
*pbResult
) override
;
156 HRESULT STDMETHODCALLTYPE
NewBlogPost(
159 BSTR bstrBlogName
) override
;
161 // IObjectSafety methods
163 HRESULT STDMETHODCALLTYPE
GetInterfaceSafetyOptions(
165 DWORD
*pdwSupportedOptions
,
166 DWORD
*pdwEnabledOptions
) override
;
168 HRESULT STDMETHODCALLTYPE
SetInterfaceSafetyOptions(
170 DWORD dwOptionSetMask
,
171 DWORD dwEnabledOptions
) override
;
175 static long GetObjectCount();
178 static long m_nObjCount
;
179 static ITypeInfo
* m_pTypeInfo
;
180 static constexpr DWORD iSupportedOptionsMask
= INTERFACESAFE_FOR_UNTRUSTED_CALLER
| INTERFACESAFE_FOR_UNTRUSTED_DATA
;
181 DWORD m_iEnabledOptions
= 0;
186 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */