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 #include "COMRefCounted.hpp"
18 class COMOpenDocuments
: public COMRefCounted
<IOWSNewDocument3
, IObjectSafety
>
24 Error(HRESULT syserr
) : m_nErr(syserr
) {}
25 HRESULT
val() const { return m_nErr
; }
31 virtual ~COMOpenDocuments() override
;
35 HRESULT STDMETHODCALLTYPE
QueryInterface(
37 void **ppvObject
) override
;
41 HRESULT STDMETHODCALLTYPE
GetTypeInfoCount(
42 UINT
*pctinfo
) override
;
44 HRESULT STDMETHODCALLTYPE
GetTypeInfo(
47 ITypeInfo
**ppTInfo
) override
;
49 HRESULT STDMETHODCALLTYPE
GetIDsOfNames(
54 DISPID
*rgDispId
) override
;
56 HRESULT STDMETHODCALLTYPE
Invoke(
61 DISPPARAMS
*pDispParams
,
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
,
76 VARIANT_BOOL
*pbResult
) override
;
78 // IOWSNewDocument2 methods
80 HRESULT STDMETHODCALLTYPE
ViewDocument(
81 BSTR bstrDocumentLocation
,
83 VARIANT_BOOL
*pbResult
) override
;
85 HRESULT STDMETHODCALLTYPE
ViewDocument2(
87 BSTR bstrDocumentLocation
,
89 VARIANT_BOOL
*pbResult
) override
;
91 HRESULT STDMETHODCALLTYPE
EditDocument2(
93 BSTR bstrDocumentLocation
,
95 VARIANT_BOOL
*pbResult
) override
;
97 HRESULT STDMETHODCALLTYPE
CreateNewDocument2(
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(
110 BSTR bstrDocumentLocation
,
113 VARIANT_BOOL
*pbResult
) override
;
115 HRESULT STDMETHODCALLTYPE
CheckinDocument(
116 BSTR bstrDocumentLocation
,
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(
134 VARIANT varProgID
) override
;
136 HRESULT STDMETHODCALLTYPE
CheckoutDocumentPrompt(
137 BSTR bstrDocumentLocationRaw
,
138 VARIANT_BOOL fEditAfterCheckout
,
140 VARIANT_BOOL
*pbResult
) override
;
142 HRESULT STDMETHODCALLTYPE
EditDocument3(
144 BSTR bstrDocumentLocation
,
145 VARIANT_BOOL fUseLocalCopy
,
147 VARIANT_BOOL
*pbResult
) override
;
149 HRESULT STDMETHODCALLTYPE
NewBlogPost(
152 BSTR bstrBlogName
) override
;
154 // IObjectSafety methods
156 HRESULT STDMETHODCALLTYPE
GetInterfaceSafetyOptions(
158 DWORD
*pdwSupportedOptions
,
159 DWORD
*pdwEnabledOptions
) override
;
161 HRESULT STDMETHODCALLTYPE
SetInterfaceSafetyOptions(
163 DWORD dwOptionSetMask
,
164 DWORD dwEnabledOptions
) override
;
168 static LONG
GetObjectCount();
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;
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */