Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/vcl/toolkit/unowrap.hxx
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
#pragma once
21
22
#if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS)
23
#error "don't use this in new code"
24
#endif
25
26
#include <config_options.h>
27
#include <com/sun/star/uno/Reference.h>
28
#include <vcl/dllapi.h>
29
#include <vcl/vclptr.hxx>
30
31
namespace vcl { class Window; }
32
class Menu;
33
class OutputDevice;
34
class PopupMenu;
35
namespace com::sun::star::awt {
36
    class XGraphics;
37
    class XPopupMenu;
38
    class XToolkit;
39
    class XWindow;
40
    class XVclWindowPeer;
41
}
42
namespace com::sun::star::accessibility {
43
    class XAccessible;
44
}
45
46
class VCL_DLLPUBLIC UnoWrapperBase
47
{
48
public:
49
    virtual void                Destroy() = 0;
50
51
    // Toolkit
52
    virtual css::uno::Reference< css::awt::XToolkit > GetVCLToolkit() = 0;
53
54
    // Graphics
55
    virtual css::uno::Reference< css::awt::XGraphics >    CreateGraphics( OutputDevice* pOutDev ) = 0;
56
    virtual void                ReleaseAllGraphics( OutputDevice* pOutDev ) = 0;
57
58
    // Window
59
    virtual css::uno::Reference<css::awt::XVclWindowPeer> GetWindowInterface( vcl::Window* pWindow ) = 0;
60
    virtual void                SetWindowInterface( vcl::Window* pWindow, const css::uno::Reference< css::awt::XVclWindowPeer > & xIFace ) = 0;
61
    virtual VclPtr<vcl::Window> GetWindow(const css::uno::Reference<css::awt::XWindow>& rxWindow) = 0;
62
63
    // PopupMenu
64
    virtual css::uno::Reference<css::awt::XPopupMenu> CreateMenuInterface( PopupMenu* pPopupMenu ) = 0;
65
66
    virtual void                WindowDestroyed( vcl::Window* pWindow ) = 0;
67
68
    /** Get the application's UNO wrapper object.
69
70
     Note that this static function will only ever try to create UNO wrapper object once, and
71
     if it fails then it will not ever try again, even if the function is called multiple times.
72
73
     @param     bCreateIfNotExists  Create the UNO wrapper object if it doesn't exist when true.
74
75
     @return UNO wrapper object.
76
    */
77
    static UnoWrapperBase*      GetUnoWrapper( bool bCreateIfNotExists = true );
78
79
    /** Sets the application's UNO Wrapper object.
80
81
     @param     pWrapper        Pointer to UNO wrapper object.
82
    */
83
    static void                 SetUnoWrapper( UnoWrapperBase* pWrapper );
84
85
protected:
86
0
    ~UnoWrapperBase() {}
87
};
88
89
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */