Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / winaccessibility / source / UAccCOM / UAccCOM.cxx
blob43c3188b4f0323e80bf97d00cb4d0e3d09124337
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "stdafx.h"
21 #include "Resource.h"
22 #include <initguid.h>
23 #include <accHelper.hxx>
25 #if defined __clang__
26 #pragma clang diagnostic push
27 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
28 #endif
29 #include <UAccCOM.h>
30 #if defined __clang__
31 #pragma clang diagnostic pop
32 #endif
34 #if defined __clang__
35 #pragma clang diagnostic push
36 #pragma clang diagnostic ignored "-Wextra-tokens"
37 // "#endif !_MIDL_USE_GUIDDEF_" in midl-generated code
38 #endif
39 #include <UAccCOM_i.c>
40 #include <ia2_api_all_i.c>
41 #if defined __clang__
42 #pragma clang diagnostic pop
43 #endif
45 #include "MAccessible.h"
46 #include "EnumVariant.h"
47 #include "UNOXWrapper.h"
48 #include "AccComponent.h"
49 #include "AccRelation.h"
50 #include "AccAction.h"
51 #include "AccText.h"
52 #include "AccEditableText.h"
53 #include "AccImage.h"
54 #include "AccValue.h"
55 #include "AccTable.h"
56 #include "AccHyperLink.h"
57 #include "AccHypertext.h"
60 CComModule _Module;
62 BEGIN_OBJECT_MAP(ObjectMap)
63 OBJECT_ENTRY(CLSID_MAccessible, CMAccessible)
64 OBJECT_ENTRY(CLSID_EnumVariant, CEnumVariant)
65 OBJECT_ENTRY(CLSID_AccComponent, CAccComponent)
66 OBJECT_ENTRY(CLSID_AccRelation, CAccRelation)
67 OBJECT_ENTRY(CLSID_AccAction, CAccAction)
68 OBJECT_ENTRY(CLSID_AccText, CAccText)
69 OBJECT_ENTRY(CLSID_AccEditableText, CAccEditableText)
70 OBJECT_ENTRY(CLSID_AccImage, CAccImage)
71 OBJECT_ENTRY(CLSID_AccValue, CAccValue)
72 OBJECT_ENTRY(CLSID_AccTable, CAccTable)
73 OBJECT_ENTRY(CLSID_AccHyperLink, CAccHyperLink)
74 OBJECT_ENTRY(CLSID_AccHypertext, CAccHypertext)
75 #if defined __clang__
76 #pragma clang diagnostic push
77 #pragma clang diagnostic ignored "-Wmissing-field-initializers"
78 #endif
79 END_OBJECT_MAP()
80 #if defined __clang__
81 #pragma clang diagnostic pop
82 #endif
84 // DLL Entry Point
86 extern "C"
87 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
89 if (dwReason == DLL_PROCESS_ATTACH)
91 _Module.Init(ObjectMap, hInstance, &LIBID_UACCCOMLib);
92 DisableThreadLibraryCalls(hInstance);
94 else if (dwReason == DLL_PROCESS_DETACH)
95 _Module.Term();
96 return TRUE; // ok
100 // Used to determine whether the DLL can be unloaded by OLE
102 STDAPI DllCanUnloadNow()
104 return (_Module.GetLockCount()==0) ? S_OK : E_FAIL;
108 // Returns a class factory to create an object of the requested type
110 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
112 return _Module.GetClassObject(rclsid, riid, ppv);
116 IMAccessible * UAccCOMCreateInstance()
118 IMAccessible * pIMA = nullptr;
119 HRESULT hr = createInstance<CMAccessible>(IID_IMAccessible, &pIMA);
120 return (S_OK == hr) ? pIMA : nullptr;
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */