Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/vcl/inc/headless/svpframe.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/sysdata.hxx>
23
24
#include <salframe.hxx>
25
26
#include <vector>
27
28
#ifdef IOS
29
#include <quartz/salgdi.h>
30
#define SvpSalInstance AquaSalInstance
31
#define SvpSalGraphics AquaSalGraphics
32
#endif
33
34
class SvpSalInstance;
35
class SvpSalGraphics;
36
37
class SvpSalFrame : public SalFrame
38
{
39
    SvpSalInstance*                     m_pInstance;
40
    SvpSalFrame*                        m_pParent;       // pointer to parent frame
41
    std::vector< SvpSalFrame* >         m_aChildren;     // Vector of child frames
42
    SalFrameStyleFlags                  m_nStyle;
43
    bool                                m_bVisible;
44
#ifndef IOS
45
    cairo_surface_t*                    m_pSurface;
46
#endif
47
    tools::Long                                m_nMinWidth;
48
    tools::Long                                m_nMinHeight;
49
    tools::Long                                m_nMaxWidth;
50
    tools::Long                                m_nMaxHeight;
51
52
    SystemEnvData                       m_aSystemChildData;
53
54
    std::vector< SvpSalGraphics* >      m_aGraphics;
55
56
    static SvpSalFrame*       s_pFocusFrame;
57
    OUString m_sTitle;
58
59
public:
60
    SvpSalFrame( SvpSalInstance* pInstance,
61
                 SalFrame* pParent,
62
                 SalFrameStyleFlags nSalFrameStyle );
63
    virtual ~SvpSalFrame() override;
64
65
    void GetFocus();
66
    void LoseFocus();
67
    void PostPaint() const;
68
69
0
    const OUString& title() const { return m_sTitle; }
70
0
    SalFrameStyleFlags style() const { return m_nStyle; }
71
0
    bool isVisible() const { return m_bVisible; }
72
0
    bool hasFocus() const { return s_pFocusFrame == this; }
73
74
    // SalFrame
75
    virtual SalGraphics*        AcquireGraphics() override;
76
    virtual void                ReleaseGraphics( SalGraphics* pGraphics ) override;
77
78
    virtual bool                PostEvent(std::unique_ptr<ImplSVEvent> pData) override;
79
80
    virtual void                SetTitle( const OUString& rTitle ) override;
81
    virtual void                SetIcon( sal_uInt16 nIcon ) override;
82
    virtual void                SetMenu( SalMenu* pMenu ) override;
83
84
    virtual void                SetExtendedFrameStyle( SalExtStyle nExtStyle ) override;
85
    virtual void                Show( bool bVisible, bool bNoActivate = false ) override;
86
    virtual void                SetMinClientSize( tools::Long nWidth, tools::Long nHeight ) override;
87
    virtual void                SetMaxClientSize( tools::Long nWidth, tools::Long nHeight ) override;
88
    virtual void                SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags ) override;
89
    virtual void                GetClientSize( tools::Long& rWidth, tools::Long& rHeight ) override;
90
    virtual void                GetWorkArea( AbsoluteScreenPixelRectangle& rRect ) override;
91
    virtual SalFrame*           GetParent() const override;
92
    virtual void SetWindowState(const vcl::WindowData*) override;
93
    virtual bool GetWindowState(vcl::WindowData*) override;
94
    virtual void                ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) override;
95
    virtual void                StartPresentation( bool bStart ) override;
96
    virtual void                SetAlwaysOnTop( bool bOnTop ) override;
97
    virtual void                ToTop( SalFrameToTop nFlags ) override;
98
    virtual void                SetPointer( PointerStyle ePointerStyle ) override;
99
    virtual void                CaptureMouse( bool bMouse ) override;
100
    virtual void                SetPointerPos( tools::Long nX, tools::Long nY ) override;
101
    using SalFrame::Flush;
102
    virtual void                Flush() override;
103
    virtual void                SetInputContext( SalInputContext* pContext ) override;
104
    virtual void                EndExtTextInput( EndExtTextInputFlags nFlags ) override;
105
    virtual OUString            GetKeyName( sal_uInt16 nKeyCode ) override;
106
    virtual bool                MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) override;
107
    virtual LanguageType        GetInputLanguage() override;
108
    virtual void                UpdateSettings( AllSettings& rSettings ) override;
109
    virtual void                Beep() override;
110
    virtual const SystemEnvData& GetSystemData() const override;
111
    virtual SalPointerState     GetPointerState() override;
112
    virtual KeyIndicatorState   GetIndicatorState() override;
113
    virtual void                SimulateKeyPress( sal_uInt16 nKeyCode ) override;
114
    virtual void                SetParent( SalFrame* pNewParent ) override;
115
    virtual void                SetPluginParent( SystemParentData* pNewParent ) override;
116
    virtual void                ResetClipRegion() override;
117
    virtual void                BeginSetClipRegion( sal_uInt32 nRects ) override;
118
    virtual void                UnionClipRegion( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override;
119
    virtual void                EndSetClipRegion() override;
120
121
    /*TODO: functional implementation */
122
0
    virtual void                SetScreenNumber( unsigned int ) override {}
123
7.35k
    virtual void                SetApplicationID(const OUString &) override {}
124
125
private:
126
    basegfx::B2IVector GetSurfaceFrameSize() const;
127
};
128
129
template <typename charT, typename traits>
130
inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& stream,
131
                                                     const SvpSalFrame& frame)
132
{
133
    stream << &frame << " (vis " << frame.isVisible() <<  " focus " << frame.hasFocus();
134
    stream << " style " << std::hex << std::setfill('0') << std::setw(8) << static_cast<sal_uInt32>(frame.style());
135
    OUString sTitle = frame.title();
136
    if (!sTitle.isEmpty())
137
        stream << " '" << sTitle << "'";
138
    stream << ")";
139
    return stream;
140
}
141
142
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */