Falkon
Develop
Cross-platform Qt-based web browser
abstractbuttoninterface.cpp
Go to the documentation of this file.
1
/* ============================================================
2
* Falkon - Qt web browser
3
* Copyright (C) 2018 David Rosca <nowrep@gmail.com>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* ============================================================ */
18
#include "
abstractbuttoninterface.h
"
19
20
AbstractButtonInterface::AbstractButtonInterface
(QObject *parent)
21
: QObject(parent)
22
{
23
}
24
25
bool
AbstractButtonInterface::isValid
()
const
26
{
27
return
!
id
().isEmpty() && !
name
().isEmpty();
28
}
29
30
bool
AbstractButtonInterface::isActive
()
const
31
{
32
return
m_active;
33
}
34
35
void
AbstractButtonInterface::setActive
(
bool
active)
36
{
37
if
(m_active == active) {
38
return
;
39
}
40
41
m_active = active;
42
Q_EMIT
activeChanged
(m_active);
43
}
44
45
bool
AbstractButtonInterface::isVisible
()
const
46
{
47
return
m_visible;
48
}
49
50
void
AbstractButtonInterface::setVisible
(
bool
visible)
51
{
52
if
(m_visible == visible) {
53
return
;
54
}
55
56
m_visible = visible;
57
Q_EMIT
visibleChanged
(m_visible);
58
}
59
60
QString
AbstractButtonInterface::title
()
const
61
{
62
return
m_title;
63
}
64
65
void
AbstractButtonInterface::setTitle
(
const
QString &title)
66
{
67
if
(m_title ==
title
) {
68
return
;
69
}
70
71
m_title =
title
;
72
Q_EMIT
titleChanged
(m_title);
73
}
74
75
QString
AbstractButtonInterface::toolTip
()
const
76
{
77
return
m_toolTip;
78
}
79
80
void
AbstractButtonInterface::setToolTip
(
const
QString &toolTip)
81
{
82
if
(m_toolTip ==
toolTip
) {
83
return
;
84
}
85
86
m_toolTip =
toolTip
;
87
Q_EMIT
toolTipChanged
(m_toolTip);
88
}
89
90
QIcon
AbstractButtonInterface::icon
()
const
91
{
92
return
m_icon;
93
}
94
95
void
AbstractButtonInterface::setIcon
(
const
QIcon &icon)
96
{
97
m_icon =
icon
;
98
Q_EMIT
iconChanged
(
icon
);
99
}
100
101
QString
AbstractButtonInterface::badgeText
()
const
102
{
103
return
m_badgeText;
104
}
105
106
void
AbstractButtonInterface::setBadgeText
(
const
QString &badgeText)
107
{
108
if
(m_badgeText ==
badgeText
) {
109
return
;
110
}
111
112
m_badgeText =
badgeText
;
113
Q_EMIT
badgeTextChanged
(m_badgeText);
114
}
115
116
WebView
*
AbstractButtonInterface::webView
()
const
117
{
118
return
m_view;
119
}
120
121
void
AbstractButtonInterface::setWebView
(
WebView
*view)
122
{
123
if
(m_view == view) {
124
return
;
125
}
126
127
m_view = view;
128
Q_EMIT
webViewChanged
(m_view);
129
}
abstractbuttoninterface.h
AbstractButtonInterface::titleChanged
void titleChanged(const QString &title)
AbstractButtonInterface::webViewChanged
void webViewChanged(WebView *view)
AbstractButtonInterface::title
QString title() const
Definition:
abstractbuttoninterface.cpp:60
AbstractButtonInterface::id
virtual QString id() const =0
AbstractButtonInterface::iconChanged
void iconChanged(const QIcon &icon)
AbstractButtonInterface::icon
QIcon icon() const
Definition:
abstractbuttoninterface.cpp:90
AbstractButtonInterface::webView
WebView * webView() const
Definition:
abstractbuttoninterface.cpp:116
AbstractButtonInterface::setWebView
void setWebView(WebView *view)
Definition:
abstractbuttoninterface.cpp:121
AbstractButtonInterface::setActive
void setActive(bool active)
Definition:
abstractbuttoninterface.cpp:35
AbstractButtonInterface::isVisible
bool isVisible() const
Definition:
abstractbuttoninterface.cpp:45
AbstractButtonInterface::setVisible
void setVisible(bool visible)
Definition:
abstractbuttoninterface.cpp:50
AbstractButtonInterface::setTitle
void setTitle(const QString &text)
Definition:
abstractbuttoninterface.cpp:65
AbstractButtonInterface::isActive
bool isActive() const
Definition:
abstractbuttoninterface.cpp:30
AbstractButtonInterface::badgeTextChanged
void badgeTextChanged(const QString &badgeText)
AbstractButtonInterface::setBadgeText
void setBadgeText(const QString &badgeText)
Definition:
abstractbuttoninterface.cpp:106
AbstractButtonInterface::setToolTip
void setToolTip(const QString &toolTip)
Definition:
abstractbuttoninterface.cpp:80
AbstractButtonInterface::activeChanged
void activeChanged(bool active)
AbstractButtonInterface::name
virtual QString name() const =0
AbstractButtonInterface::AbstractButtonInterface
AbstractButtonInterface(QObject *parent=nullptr)
Definition:
abstractbuttoninterface.cpp:20
AbstractButtonInterface::isValid
bool isValid() const
Definition:
abstractbuttoninterface.cpp:25
AbstractButtonInterface::visibleChanged
void visibleChanged(bool visible)
AbstractButtonInterface::toolTipChanged
void toolTipChanged(const QString &toolTip)
AbstractButtonInterface::badgeText
QString badgeText() const
Definition:
abstractbuttoninterface.cpp:101
AbstractButtonInterface::toolTip
QString toolTip() const
Definition:
abstractbuttoninterface.cpp:75
AbstractButtonInterface::setIcon
void setIcon(const QIcon &icon)
Definition:
abstractbuttoninterface.cpp:95
WebView
Definition:
webview.h:33
src
lib
tools
abstractbuttoninterface.cpp
Generated by
1.9.3