Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/vcl/inc/salobj.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
#include <vcl/dllapi.h>
23
#include <vcl/syschild.hxx>
24
#include <com/sun/star/uno/Sequence.hxx>
25
#include "salwtype.hxx"
26
27
struct SystemEnvData;
28
29
typedef void (*SALOBJECTPROC)(SystemChildWindow* pInst, SalObjEvent nEvent);
30
31
class VCL_PLUGIN_PUBLIC SalObject
32
{
33
    VclPtr<SystemChildWindow> m_pInst;
34
    SALOBJECTPROC       m_pCallback;
35
    bool                m_bMouseTransparent:1,
36
                        m_bEraseBackground:1;
37
public:
38
0
            SalObject() : m_pInst( nullptr ), m_pCallback( nullptr ), m_bMouseTransparent( false ), m_bEraseBackground( true ) {}
39
            virtual ~SalObject();
40
41
    virtual void                    ResetClipRegion() = 0;
42
    virtual void                    BeginSetClipRegion( sal_uInt32 nRects ) = 0;
43
    virtual void                    UnionClipRegion( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0;
44
    virtual void                    EndSetClipRegion() = 0;
45
46
    virtual void                    SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0;
47
    virtual void                    Show( bool bVisible ) = 0;
48
0
    virtual void                    Enable( bool /* nEnable */ ) {} // overridden by WinSalObject
49
0
    virtual void                    GrabFocus() {}
50
0
    virtual void                    Reparent(SalFrame* /*pFrame*/) {}
51
52
0
    virtual void                    SetForwardKey( bool /* bEnable */ ) {}
53
54
0
    virtual void                    SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& /*rLeaveArgs*/, const css::uno::Sequence<css::uno::Any>& /*rEnterArgs*/) {}
55
56
    virtual const SystemEnvData&    GetSystemData() const = 0;
57
58
0
    virtual Size GetOptimalSize() const { return Size(); }
59
60
    void                            SetCallback( SystemChildWindow* pInst, SALOBJECTPROC pProc )
61
0
                                        { m_pInst = pInst; m_pCallback = pProc; }
62
    void                            CallCallback( SalObjEvent nEvent )
63
0
                                        { if (m_pCallback) m_pCallback( m_pInst, nEvent ); }
64
65
    void                            SetMouseTransparent( bool bMouseTransparent )
66
0
                                        { m_bMouseTransparent = bMouseTransparent; }
67
    bool                            IsMouseTransparent() const
68
0
                                        { return m_bMouseTransparent; }
69
70
    void                            EnableEraseBackground( bool bEnable )
71
0
                                        { m_bEraseBackground = bEnable; }
72
    bool                            IsEraseBackgroundEnabled() const
73
0
                                        { return m_bEraseBackground; }
74
};
75
76
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */