Avoid potential negative array index access to cached text.
[LibreOffice.git] / toolkit / inc / helper / unowrapper.hxx
blobdfed1b1215f13343cfd4a69b8537aee5f0ebccb5
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 #ifndef INCLUDED_TOOLKIT_INC_HELPER_UNOWRAPPER_HXX
21 #define INCLUDED_TOOLKIT_INC_HELPER_UNOWRAPPER_HXX
23 #include <com/sun/star/awt/XToolkit.hpp>
24 #include <com/sun/star/awt/XGraphics.hpp>
25 #include <com/sun/star/awt/XVclWindowPeer.hpp>
26 #include <com/sun/star/accessibility/XAccessible.hpp>
28 #include <vcl/toolkit/unowrap.hxx>
29 #include <vcl/window.hxx>
31 #include <helper/accessibilityclient.hxx>
35 class UnoWrapper final : public UnoWrapperBase
37 private:
38 css::uno::Reference< css::awt::XToolkit> mxToolkit;
39 ::toolkit::AccessibilityClient maAccessibleFactoryAccess;
41 public:
42 UnoWrapper( const css::uno::Reference< css::awt::XToolkit>& rxToolkit );
44 virtual void Destroy() override;
46 // Toolkit
47 virtual css::uno::Reference< css::awt::XToolkit> GetVCLToolkit() override;
49 // Graphics
50 virtual css::uno::Reference< css::awt::XGraphics> CreateGraphics( OutputDevice* pOutDev ) override;
51 virtual void ReleaseAllGraphics( OutputDevice* pOutDev ) override;
53 // Window
54 virtual css::uno::Reference< css::awt::XVclWindowPeer> GetWindowInterface( vcl::Window* pWindow ) override;
55 virtual void SetWindowInterface( vcl::Window* pWindow, const css::uno::Reference< css::awt::XVclWindowPeer> & xIFace ) override;
56 virtual VclPtr<vcl::Window> GetWindow(const css::uno::Reference<css::awt::XWindow>& rxWindow) override;
58 // Menu
59 virtual css::uno::Reference<css::awt::XPopupMenu> CreateMenuInterface( PopupMenu* pPopupMenu ) override;
61 void WindowDestroyed( vcl::Window* pWindow ) override;
63 // Accessibility
64 virtual css::uno::Reference< css::accessibility::XAccessible >
65 CreateAccessible( Menu* pMenu, bool bIsMenuBar ) override;
67 private:
68 virtual ~UnoWrapper();
71 #endif // INCLUDED_TOOLKIT_INC_HELPER_UNOWRAPPER_HXX
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */