• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
kmessagewidget.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 *
3 * Copyright (c) 2011 Aurélien Gâteau <agateau@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library 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 GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 */
20#ifndef KMESSAGEWIDGET_H
21#define KMESSAGEWIDGET_H
22
23#include <kdeui_export.h>
24
25#include <QFrame>
26
27class KMessageWidgetPrivate;
28
92class KDEUI_EXPORT KMessageWidget : public QFrame
93{
94 Q_OBJECT
95 Q_ENUMS(MessageType)
96
97 Q_PROPERTY(QString text READ text WRITE setText)
98 Q_PROPERTY(bool wordWrap READ wordWrap WRITE setWordWrap)
99 Q_PROPERTY(bool closeButtonVisible READ isCloseButtonVisible WRITE setCloseButtonVisible)
100 Q_PROPERTY(MessageType messageType READ messageType WRITE setMessageType)
101 Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
102public:
103 enum MessageType {
104 Positive,
105 Information,
106 Warning,
107 Error
108 };
109
113 explicit KMessageWidget(QWidget *parent = 0);
114
115 explicit KMessageWidget(const QString &text, QWidget *parent = 0);
116
117 ~KMessageWidget();
118
119 QString text() const;
120
121 bool wordWrap() const;
122
123 bool isCloseButtonVisible() const;
124
125 MessageType messageType() const;
126
127 void addAction(QAction *action);
128
129 void removeAction(QAction *action);
130
131 QSize sizeHint() const;
132
133 QSize minimumSizeHint() const;
134
135 int heightForWidth(int width) const;
136
141 QIcon icon() const;
142
143public Q_SLOTS:
144 void setText(const QString &text);
145
146 void setWordWrap(bool wordWrap);
147
148 void setCloseButtonVisible(bool visible);
149
150 void setMessageType(KMessageWidget::MessageType type);
151
156 void animatedShow();
157
162 void animatedHide();
163
168 void setIcon(const QIcon &icon);
169
170Q_SIGNALS:
178 void linkActivated(const QString& contents);
179
187 void linkHovered(const QString& contents);
188
189protected:
190 void paintEvent(QPaintEvent *event);
191
192 bool event(QEvent *event);
193
194 void resizeEvent(QResizeEvent *event);
195
196 void showEvent(QShowEvent *event);
197
198private:
199 KMessageWidgetPrivate *const d;
200 friend class KMessageWidgetPrivate;
201
202 Q_PRIVATE_SLOT(d, void slotTimeLineChanged(qreal))
203 Q_PRIVATE_SLOT(d, void slotTimeLineFinished())
204};
205
206#endif /* KMESSAGEWIDGET_H */
KMessageWidget
A widget to provide feedback or propose opportunistic interactions.
Definition: kmessagewidget.h:93
KMessageWidget::linkActivated
void linkActivated(const QString &contents)
This signal is emitted when the user clicks a link in the text label.
KMessageWidget::linkHovered
void linkHovered(const QString &contents)
This signal is emitted when the user hovers over a link in the text label.
KMessageWidget::MessageType
MessageType
Definition: kmessagewidget.h:103
KMessageWidget::Information
@ Information
Definition: kmessagewidget.h:105
KMessageWidget::Positive
@ Positive
Definition: kmessagewidget.h:104
KMessageWidget::Warning
@ Warning
Definition: kmessagewidget.h:106
QAction
QFrame
QWidget
kdeui_export.h
MessageType
MessageType
Error
Error
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal