/src/libreoffice/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
Line | Count | Source |
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 | | |
21 | | #include <svx/AccessibleShapeTreeInfo.hxx> |
22 | | #include <vcl/svapp.hxx> |
23 | | #include <vcl/window.hxx> |
24 | | |
25 | | using namespace ::com::sun::star; |
26 | | using namespace ::com::sun::star::accessibility; |
27 | | using ::com::sun::star::uno::Reference; |
28 | | |
29 | | namespace accessibility { |
30 | | |
31 | | AccessibleShapeTreeInfo::AccessibleShapeTreeInfo() |
32 | 0 | : mpView (nullptr), |
33 | 0 | mpWindow (nullptr), |
34 | 0 | mpViewForwarder (nullptr) |
35 | 0 | { |
36 | | // Empty. |
37 | 0 | } |
38 | | |
39 | | |
40 | | AccessibleShapeTreeInfo::AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo& rInfo) |
41 | 0 | : mxDocumentWindow (rInfo.mxDocumentWindow), |
42 | 0 | mxModelBroadcaster (rInfo.mxModelBroadcaster), |
43 | 0 | mpView (rInfo.mpView), |
44 | 0 | mxController (rInfo.mxController), |
45 | 0 | mpWindow (rInfo.mpWindow), |
46 | 0 | mpViewForwarder (rInfo.mpViewForwarder) |
47 | 0 | { |
48 | | // Empty. |
49 | 0 | } |
50 | | |
51 | | void AccessibleShapeTreeInfo::dispose() |
52 | 0 | { |
53 | 0 | mxDocumentWindow.clear(); |
54 | 0 | mxModelBroadcaster.clear(); |
55 | 0 | mpView = nullptr; |
56 | 0 | mxController.clear(); |
57 | 0 | mpWindow.reset(); |
58 | 0 | mpViewForwarder = nullptr; |
59 | 0 | } |
60 | | |
61 | | AccessibleShapeTreeInfo& AccessibleShapeTreeInfo::operator= (const AccessibleShapeTreeInfo& rInfo) |
62 | 0 | { |
63 | 0 | if ( this != &rInfo ) |
64 | 0 | { |
65 | 0 | mxDocumentWindow = rInfo.mxDocumentWindow; |
66 | 0 | mxModelBroadcaster = rInfo.mxModelBroadcaster; |
67 | 0 | mpView = rInfo.mpView; |
68 | 0 | mxController = rInfo.mxController; |
69 | 0 | mpWindow = rInfo.mpWindow; |
70 | 0 | mpViewForwarder = rInfo.mpViewForwarder; |
71 | 0 | } |
72 | 0 | return *this; |
73 | 0 | } |
74 | | |
75 | | AccessibleShapeTreeInfo::~AccessibleShapeTreeInfo() |
76 | 0 | { |
77 | 0 | if (mpWindow) |
78 | 0 | { |
79 | 0 | SolarMutexGuard g; |
80 | 0 | mpWindow.reset(); |
81 | 0 | } |
82 | 0 | } |
83 | | |
84 | | void AccessibleShapeTreeInfo::SetDocumentWindow ( |
85 | | const Reference<XAccessibleComponent>& rxDocumentWindow) |
86 | 0 | { |
87 | 0 | if (mxDocumentWindow != rxDocumentWindow) |
88 | 0 | mxDocumentWindow = rxDocumentWindow; |
89 | 0 | } |
90 | | |
91 | | void AccessibleShapeTreeInfo::SetModelBroadcaster ( |
92 | | const Reference<document::XShapeEventBroadcaster>& rxModelBroadcaster) |
93 | 0 | { |
94 | 0 | mxModelBroadcaster = rxModelBroadcaster; |
95 | 0 | } |
96 | | |
97 | | void AccessibleShapeTreeInfo::SetSdrView (SdrView* pView) |
98 | 0 | { |
99 | 0 | mpView = pView; |
100 | 0 | } |
101 | | |
102 | | void AccessibleShapeTreeInfo::SetController ( |
103 | | const Reference<frame::XController>& rxController) |
104 | 0 | { |
105 | 0 | mxController = rxController; |
106 | 0 | } |
107 | | |
108 | | void AccessibleShapeTreeInfo::SetWindow(vcl::Window* pDevice) |
109 | 0 | { |
110 | 0 | mpWindow = pDevice; |
111 | 0 | } |
112 | | |
113 | | void AccessibleShapeTreeInfo::SetViewForwarder (const IAccessibleViewForwarder* pViewForwarder) |
114 | 0 | { |
115 | 0 | mpViewForwarder = pViewForwarder; |
116 | 0 | } |
117 | | |
118 | | } // end of namespace accessibility |
119 | | |
120 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |