LibreOffice Module shell (master) 1
COMOpenDocuments.hpp
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3* This file is part of the LibreOffice project.
4*
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*/
9
10#ifndef INCLUDED_SHELL_INC_SPSUPP_COMOPENDOCUMENTS_HPP
11#define INCLUDED_SHELL_INC_SPSUPP_COMOPENDOCUMENTS_HPP
12
13#include <spsupp_h.h>
14#include "COMRefCounted.hpp"
15#include <Objsafe.h>
16#include <assert.h>
17
18class COMOpenDocuments : public COMRefCounted<IOWSNewDocument3, IObjectSafety>
19{
20public:
21
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;
28 };
29
31 virtual ~COMOpenDocuments() override;
32
33 // IUnknown methods
34
35 HRESULT STDMETHODCALLTYPE QueryInterface(
36 REFIID riid,
37 void **ppvObject) override;
38
39 // IDispatch methods
40
41 HRESULT STDMETHODCALLTYPE GetTypeInfoCount(
42 UINT *pctinfo) override;
43
44 HRESULT STDMETHODCALLTYPE GetTypeInfo(
45 UINT iTInfo,
46 LCID lcid,
47 ITypeInfo **ppTInfo) override;
48
49 HRESULT STDMETHODCALLTYPE GetIDsOfNames(
50 REFIID riid,
51 LPOLESTR *rgszNames,
52 UINT cNames,
53 LCID lcid,
54 DISPID *rgDispId) override;
55
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;
65
66 // IOWSNewDocument methods https://msdn.microsoft.com/en-us/library/cc264316
67
68 HRESULT STDMETHODCALLTYPE CreateNewDocument(
69 BSTR bstrTemplateLocation,
70 BSTR bstrDefaultSaveLocation,
71 VARIANT_BOOL *pbResult) override;
72
73 HRESULT STDMETHODCALLTYPE EditDocument(
74 BSTR bstrDocumentLocation,
75 VARIANT varProgID,
76 VARIANT_BOOL *pbResult) override;
77
78 // IOWSNewDocument2 methods
79
80 HRESULT STDMETHODCALLTYPE ViewDocument(
81 BSTR bstrDocumentLocation,
82 VARIANT varProgID,
83 VARIANT_BOOL *pbResult) override;
84
85 HRESULT STDMETHODCALLTYPE ViewDocument2(
86 IDispatch *pdisp,
87 BSTR bstrDocumentLocation,
88 VARIANT varProgID,
89 VARIANT_BOOL *pbResult) override;
90
91 HRESULT STDMETHODCALLTYPE EditDocument2(
92 IDispatch *pdisp,
93 BSTR bstrDocumentLocation,
94 VARIANT varProgID,
95 VARIANT_BOOL *pbResult) override;
96
97 HRESULT STDMETHODCALLTYPE CreateNewDocument2(
98 IDispatch *pdisp,
99 BSTR bstrTemplateLocation,
100 BSTR bstrDefaultSaveLocation,
101 VARIANT_BOOL *pbResult) override;
102
103 HRESULT STDMETHODCALLTYPE PromptedOnLastOpen(
104 VARIANT_BOOL *pbResult) override;
105
106 // IOWSNewDocument3 methods
107
108 HRESULT STDMETHODCALLTYPE ViewDocument3(
109 IDispatch *pdisp,
110 BSTR bstrDocumentLocation,
111 int OpenType,
112 VARIANT varProgID,
113 VARIANT_BOOL *pbResult) override;
114
115 HRESULT STDMETHODCALLTYPE CheckinDocument(
116 BSTR bstrDocumentLocation,
117 int CheckinType,
118 BSTR CheckinComment,
119 VARIANT_BOOL bKeepCheckout,
120 VARIANT_BOOL *pbResult) override;
121
122 HRESULT STDMETHODCALLTYPE DiscardLocalCheckout(
123 BSTR bstrDocumentLocationRaw,
124 VARIANT_BOOL *pbResult) override;
125
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;
135
136 HRESULT STDMETHODCALLTYPE CheckoutDocumentPrompt(
137 BSTR bstrDocumentLocationRaw,
138 VARIANT_BOOL fEditAfterCheckout,
139 VARIANT varProgID,
140 VARIANT_BOOL *pbResult) override;
141
142 HRESULT STDMETHODCALLTYPE EditDocument3(
143 IDispatch *pdisp,
144 BSTR bstrDocumentLocation,
145 VARIANT_BOOL fUseLocalCopy,
146 VARIANT varProgID,
147 VARIANT_BOOL *pbResult) override;
148
149 HRESULT STDMETHODCALLTYPE NewBlogPost(
150 BSTR bstrProviderId,
151 BSTR bstrBlogUrl,
152 BSTR bstrBlogName) override;
153
154 // IObjectSafety methods
155
156 HRESULT STDMETHODCALLTYPE GetInterfaceSafetyOptions(
157 REFIID riid,
158 DWORD *pdwSupportedOptions,
159 DWORD *pdwEnabledOptions) override;
160
161 HRESULT STDMETHODCALLTYPE SetInterfaceSafetyOptions(
162 REFIID riid,
163 DWORD dwOptionSetMask,
164 DWORD dwEnabledOptions) override;
165
166 // Non-COM methods
167
168 static LONG GetObjectCount();
169
170private:
172 static ITypeInfo* m_pTypeInfo;
173 static constexpr DWORD iSupportedOptionsMask = INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA;
175};
176
177#endif
178
179/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOColumn Column
HRESULT STDMETHODCALLTYPE EditDocument2(IDispatch *pdisp, BSTR bstrDocumentLocation, VARIANT varProgID, VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) override
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject) override
HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) override
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo) override
static ITypeInfo * m_pTypeInfo
HRESULT STDMETHODCALLTYPE PromptedOnLastOpen(VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE EditDocument3(IDispatch *pdisp, BSTR bstrDocumentLocation, VARIANT_BOOL fUseLocalCopy, VARIANT varProgID, VARIANT_BOOL *pbResult) override
static constexpr DWORD iSupportedOptionsMask
static LONG GetObjectCount()
virtual ~COMOpenDocuments() override
HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) override
HRESULT STDMETHODCALLTYPE DiscardLocalCheckout(BSTR bstrDocumentLocationRaw, VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE EditDocument(BSTR bstrDocumentLocation, VARIANT varProgID, VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE CheckinDocument(BSTR bstrDocumentLocation, int CheckinType, BSTR CheckinComment, VARIANT_BOOL bKeepCheckout, VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) override
HRESULT STDMETHODCALLTYPE GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) override
HRESULT STDMETHODCALLTYPE CreateNewDocument(BSTR bstrTemplateLocation, BSTR bstrDefaultSaveLocation, VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE NewBlogPost(BSTR bstrProviderId, BSTR bstrBlogUrl, BSTR bstrBlogName) override
HRESULT STDMETHODCALLTYPE ViewDocument(BSTR bstrDocumentLocation, VARIANT varProgID, VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE CheckoutDocumentPrompt(BSTR bstrDocumentLocationRaw, VARIANT_BOOL fEditAfterCheckout, VARIANT varProgID, VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE CreateNewDocument2(IDispatch *pdisp, BSTR bstrTemplateLocation, BSTR bstrDefaultSaveLocation, VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE ViewInExcel(BSTR SiteUrl, BSTR FileName, BSTR SessionId, BSTR Cmd, BSTR Sheet, int Row, int Column, VARIANT varProgID) override
HRESULT STDMETHODCALLTYPE ViewDocument2(IDispatch *pdisp, BSTR bstrDocumentLocation, VARIANT varProgID, VARIANT_BOOL *pbResult) override
HRESULT STDMETHODCALLTYPE ViewDocument3(IDispatch *pdisp, BSTR bstrDocumentLocation, int OpenType, VARIANT varProgID, VARIANT_BOOL *pbResult) override
unsigned short WORD
Definition: lngconvex.cxx:25
LONG