LibreOffice Module winaccessibility (master) 1
UAccCOM.cxx
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 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include "stdafx.h"
21#include "Resource.h"
22#include <initguid.h>
23#include <UAccCOM.h>
24#include <accHelper.hxx>
25
26#if defined __clang__
27#pragma clang diagnostic push
28#pragma clang diagnostic ignored \
29 "-Wextra-tokens" // "#endif !_MIDL_USE_GUIDDEF_" in midl-generated code
30#endif
31#include <UAccCOM_i.c>
32#include <ia2_api_all_i.c>
33#if defined __clang__
34#pragma clang diagnostic pop
35#endif
36
37#include "MAccessible.h"
38#include "EnumVariant.h"
39#include "UNOXWrapper.h"
40#include "AccComponent.h"
41#include "AccRelation.h"
42#include "AccAction.h"
43#include "AccText.h"
44#include "AccEditableText.h"
45#include "AccImage.h"
46#include "AccValue.h"
47#include "AccTable.h"
48#include "AccTableCell.h"
49#include "AccHyperLink.h"
50#include "AccHypertext.h"
51
52CComModule _Module;
53
54BEGIN_OBJECT_MAP(ObjectMap)
55OBJECT_ENTRY(CLSID_MAccessible, CMAccessible)
56OBJECT_ENTRY(CLSID_EnumVariant, CEnumVariant)
57OBJECT_ENTRY(CLSID_AccComponent, CAccComponent)
58OBJECT_ENTRY(CLSID_AccRelation, CAccRelation)
59OBJECT_ENTRY(CLSID_AccAction, CAccAction)
60OBJECT_ENTRY(CLSID_AccText, CAccText)
61OBJECT_ENTRY(CLSID_AccEditableText, CAccEditableText)
62OBJECT_ENTRY(CLSID_AccImage, CAccImage)
63OBJECT_ENTRY(CLSID_AccValue, CAccValue)
64OBJECT_ENTRY(CLSID_AccTable, CAccTable)
65OBJECT_ENTRY(CLSID_AccTableCell, CAccTableCell)
66OBJECT_ENTRY(CLSID_AccHyperLink, CAccHyperLink)
67OBJECT_ENTRY(CLSID_AccHypertext, CAccHypertext)
68#if defined __clang__
69#pragma clang diagnostic push
70#pragma clang diagnostic ignored "-Wmissing-field-initializers"
71#endif
72END_OBJECT_MAP()
73#if defined __clang__
74#pragma clang diagnostic pop
75#endif
76
77// DLL Entry Point
78
79extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
80{
81 if (dwReason == DLL_PROCESS_ATTACH)
82 {
83 _Module.Init(ObjectMap, hInstance, &LIBID_UACCCOMLib);
84 DisableThreadLibraryCalls(hInstance);
85 }
86 else if (dwReason == DLL_PROCESS_DETACH)
87 _Module.Term();
88 return TRUE; // ok
89}
90
91// Used to determine whether the DLL can be unloaded by OLE
92
93STDAPI DllCanUnloadNow() { return (_Module.GetLockCount() == 0) ? S_OK : E_FAIL; }
94
95// Returns a class factory to create an object of the requested type
96
97STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
98{
99 return _Module.GetClassObject(rclsid, riid, ppv);
100}
101
103{
104 IMAccessible* pIMA = nullptr;
105 HRESULT hr = createInstance<CMAccessible>(IID_IMAccessible, &pIMA);
106 return (S_OK == hr) ? pIMA : nullptr;
107}
108
109/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
Definition: UAccCOM.cxx:79
STDAPI DllCanUnloadNow()
Definition: UAccCOM.cxx:93
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: UAccCOM.cxx:97
CComModule _Module
Definition: UAccCOM.cxx:52
IMAccessible * UAccCOMCreateInstance()
Definition: UAccCOM.cxx:102
CAccAction implements IAccessibleAction interface.
Definition: AccAction.h:33
CAccComponent implements IAccessibleComponent interface.
Definition: AccComponent.h:39
CAccEditableText implements IAccessibleEditableText interface.
CAccHypertext implements IAccessibleHypertext interface.
Definition: AccHypertext.h:36
CAccImage implements IAccessibleImage interface.
Definition: AccImage.h:36
CAccRelation implements IAccessibleRelation interface.
Definition: AccRelation.h:36
CAccTableCell implements the IAccessibleTableCell interface.
Definition: AccTableCell.h:36
CAccTable implements the IAccessibleTable and IAccessibleTable2 interfaces.
Definition: AccTable.h:38
CAccText implements IAccessibleText interface.
Definition: AccText.h:34
CAccValue implements IAccessibleValue interface.
Definition: AccValue.h:36
CEnumVariant implements IEnumVARIANT interface.
Definition: EnumVariant.h:35
This class implements IMAccessible interface, which inherits from IAccessible2, and in turn inherits ...
Definition: MAccessible.h:50
#define TRUE
const wchar_t *typedef BOOL
return hr