summaryrefslogtreecommitdiff
path: root/vcl/inc/qt5/QtInstanceWidget.hxx
blob: fc84a4adda59608c3847c123d0a7e7c2ba26e2ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#pragma once

#include "QtInstance.hxx"
#include <QtWidgets/QApplication>
#include <QtWidgets/QWidget>
#include <QtWidgets/QMessageBox>
#include "QtTools.hxx"
#include <vcl/weld.hxx>
#include <string_view>
#include <rtl/ustring.hxx>
#include <vcl/sysdata.hxx>

class QtInstanceWidget : public QObject, public virtual weld::Widget
{
    Q_OBJECT

    QWidget* m_pWidget;

public:
    QtInstanceWidget(QWidget* pWidget);

    virtual QWidget* getQWidget() const { return m_pWidget; }

    virtual void set_sensitive(bool bSensitive) override;

    virtual bool get_sensitive() const override;

    virtual bool get_visible() const override;

    virtual bool is_visible() const override;

    virtual void set_can_focus(bool bCanFocus) override;

    virtual void grab_focus() override;

    virtual bool has_focus() const override;

    virtual bool is_active() const override;

    virtual bool has_child_focus() const override;

    virtual void show() override;

    virtual void hide() override;

    virtual void set_size_request(int nWidth, int nHeight) override;

    virtual Size get_size_request() const override;

    virtual Size get_preferred_size() const override;

    virtual float get_approximate_digit_width() const override;

    virtual int get_text_height() const override;

    virtual Size get_pixel_size(const OUString&) const override;

    virtual vcl::Font get_font() override;

    virtual OUString get_buildable_name() const override;

    virtual void set_buildable_name(const OUString&) override;

    virtual void set_help_id(const OUString& rHelpId) override;

    virtual OUString get_help_id() const override;

    virtual void set_grid_left_attach(int) override;

    virtual int get_grid_left_attach() const override;

    virtual void set_grid_width(int) override;

    virtual void set_grid_top_attach(int) override;

    virtual int get_grid_top_attach() const override;

    virtual void set_hexpand(bool) override;

    virtual bool get_hexpand() const override;

    virtual void set_vexpand(bool) override;

    virtual bool get_vexpand() const override;

    virtual void set_margin_top(int) override;

    virtual void set_margin_bottom(int) override;

    virtual void set_margin_start(int) override;

    virtual void set_margin_end(int) override;

    virtual int get_margin_top() const override;

    virtual int get_margin_bottom() const override;

    virtual int get_margin_start() const override;

    virtual int get_margin_end() const override;

    virtual void set_accessible_name(const OUString& rName) override;

    virtual void set_accessible_description(const OUString& rDescription) override;

    virtual OUString get_accessible_name() const override;

    virtual OUString get_accessible_description() const override;

    virtual OUString get_accessible_id() const override;

    virtual void set_accessible_relation_labeled_by(weld::Widget*) override;

    virtual void set_tooltip_text(const OUString& rTip) override;

    virtual OUString get_tooltip_text() const override;

    virtual void set_cursor_data(void*) override;

    virtual void grab_add() override;

    virtual bool has_grab() const override;

    virtual void grab_remove() override;

    virtual bool get_extents_relative_to(const Widget& rRelative, int& rX, int& rY, int& rWidth,
                                         int& rHeight) const override;

    virtual bool get_direction() const override;

    virtual void set_direction(bool) override;

    virtual void freeze() override;

    virtual void thaw() override;

    virtual void set_busy_cursor(bool) override;

    virtual std::unique_ptr<weld::Container> weld_parent() const override;

    virtual void queue_resize() override;

    virtual void help_hierarchy_foreach(const std::function<bool(const OUString&)>&) override;

    virtual OUString strip_mnemonic(const OUString&) const override;

    virtual OUString escape_ui_str(const OUString& rLabel) const override;

    virtual VclPtr<VirtualDevice> create_virtual_device() const override;

    virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() override;

    virtual css::uno::Reference<css::datatransfer::clipboard::XClipboard>
    get_clipboard() const override;

    virtual void connect_get_property_tree(const Link<tools::JsonWriter&, void>&) override;

    virtual void get_property_tree(tools::JsonWriter&) override;

    virtual void call_attention_to() override;

    virtual void set_stack_background() override;

    virtual void set_title_background() override;

    virtual void set_toolbar_background() override;

    virtual void set_highlight_background() override;

    virtual void set_background(const Color& rBackColor) override;

    virtual void draw(OutputDevice&, const Point&, const Size&) override;

    static void setHelpId(QWidget& rWidget, const OUString& rHelpId);

private Q_SLOTS:
    void applicationFocusChanged(QWidget* pOldFocus, QWidget* pNewFocus);
};

/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */