Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/svx/rubydialog.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
21
#ifndef INCLUDED_SVX_RUBYDIALOG_HXX
22
#define INCLUDED_SVX_RUBYDIALOG_HXX
23
24
#include <sfx2/childwin.hxx>
25
#include <sfx2/basedlgs.hxx>
26
#include <svx/svxdllapi.h>
27
#include <rtl/ref.hxx>
28
#include <vcl/weld/Button.hxx>
29
#include <vcl/weld/ComboBox.hxx>
30
#include <vcl/weld/Container.hxx>
31
#include <vcl/weld/Entry.hxx>
32
#include <vcl/weld/Label.hxx>
33
#include <vcl/weld/ScrolledWindow.hxx>
34
#include <vcl/weld/customweld.hxx>
35
36
class SvxRubyDialog;
37
class RubyPreview final : public weld::CustomWidgetController
38
{
39
    virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
40
    SvxRubyDialog* m_pParentDlg;
41
42
public:
43
    RubyPreview();
44
    virtual ~RubyPreview() override;
45
    void setRubyDialog(SvxRubyDialog* pParentDlg)
46
0
    {
47
0
        m_pParentDlg = pParentDlg;
48
0
    }
49
    virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
50
};
51
52
class SVX_DLLPUBLIC SvxRubyChildWindow final : public SfxChildWindow
53
{
54
public:
55
    SvxRubyChildWindow( vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo const * );
56
    SFX_DECL_CHILDWINDOW( SvxRubyChildWindow );
57
};
58
59
class SvxRubyData_Impl;
60
61
class SvxRubyDialog final : public SfxModelessDialogController
62
{
63
    friend class RubyPreview;
64
65
66
    tools::Long                nLastPos;
67
    tools::Long                nCurrentEdit;
68
    bool                bModified;
69
    SfxBindings*        pBindings;
70
    rtl::Reference<SvxRubyData_Impl> m_pImpl;
71
    weld::Entry* aEditArr[8];
72
73
    std::unique_ptr<weld::Entry> m_xLeft1ED;
74
    std::unique_ptr<weld::Entry> m_xRight1ED;
75
    std::unique_ptr<weld::Entry> m_xLeft2ED;
76
    std::unique_ptr<weld::Entry> m_xRight2ED;
77
    std::unique_ptr<weld::Entry> m_xLeft3ED;
78
    std::unique_ptr<weld::Entry> m_xRight3ED;
79
    std::unique_ptr<weld::Entry> m_xLeft4ED;
80
    std::unique_ptr<weld::Entry> m_xRight4ED;
81
82
    std::unique_ptr<weld::ScrolledWindow> m_xScrolledWindow;
83
84
    std::unique_ptr<weld::ComboBox> m_xAdjustLB;
85
86
    std::unique_ptr<weld::ComboBox> m_xPositionLB;
87
88
    std::unique_ptr<weld::Label> m_xCharStyleFT;
89
    std::unique_ptr<weld::ComboBox> m_xCharStyleLB;
90
    std::unique_ptr<weld::Button> m_xStylistPB;
91
92
    std::unique_ptr<weld::Button> m_xSelectionGroupPB;
93
    std::unique_ptr<weld::Button> m_xSelectionMonoPB;
94
95
    std::unique_ptr<weld::Button> m_xApplyPB;
96
    std::unique_ptr<weld::Button> m_xClosePB;
97
98
    std::unique_ptr<weld::Container> m_xContentArea;
99
    std::unique_ptr<weld::Widget> m_xGrid;
100
101
    std::unique_ptr<RubyPreview> m_xPreviewWin;
102
    std::unique_ptr<weld::CustomWeld> m_xPreview;
103
104
    DECL_LINK(SelectionGroup_Impl, weld::Button&, void);
105
    DECL_LINK(SelectionMono_Impl, weld::Button&, void);
106
    DECL_LINK(ApplyHdl_Impl, weld::Button&, void);
107
    DECL_LINK(CloseHdl_Impl, weld::Button&, void);
108
    DECL_LINK(StylistHdl_Impl, weld::Button&, void);
109
    DECL_LINK(ScrollHdl_Impl, weld::ScrolledWindow&, void);
110
    DECL_LINK(PositionHdl_Impl, weld::ComboBox&, void);
111
    DECL_LINK(AdjustHdl_Impl, weld::ComboBox&, void);
112
    DECL_LINK(CharStyleHdl_Impl, weld::ComboBox&, void);
113
    DECL_LINK(EditModifyHdl_Impl, weld::Entry&, void);
114
    DECL_LINK(EditFocusHdl_Impl, weld::Widget&, void);
115
    DECL_LINK(KeyUpDownHdl_Impl, const KeyEvent&, bool);
116
    DECL_LINK(KeyUpDownTabHdl_Impl, const KeyEvent&, bool);
117
118
    bool EditScrollHdl_Impl(sal_Int32 nParam);
119
    bool EditJumpHdl_Impl(sal_Int32 nParam);
120
121
    void                SetRubyText(sal_Int32 nPos, weld::Entry& rLeft, weld::Entry& rRight);
122
    void                GetRubyText();
123
    void                ClearCharStyleList();
124
    void                AssertOneEntry();
125
126
    void                Update();
127
    virtual void        Close() override;
128
129
0
    tools::Long                GetLastPos() const {return nLastPos;}
130
0
    void                SetLastPos(tools::Long nSet) {nLastPos = nSet;}
131
132
0
    bool                IsModified() const {return bModified;}
133
0
    void                SetModified(bool bSet) {bModified = bSet;}
134
135
    void EnableControls(bool bEnable);
136
137
    void                GetCurrentText(OUString& rBase, OUString& rRuby);
138
139
public:
140
    SvxRubyDialog(SfxBindings *pBindings, SfxChildWindow *pCW, weld::Window* pParent);
141
    virtual ~SvxRubyDialog() override;
142
143
    virtual void        Activate() override;
144
};
145
146
#endif // INCLUDED_SVX_RUBYDIALOG_HXX
147
148
149
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */