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

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • 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 
27 class KMessageWidgetPrivate;
28 
92 class 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)
102 public:
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 
143 public 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 
170 Q_SIGNALS:
178  void linkActivated(const QString& contents);
179 
187  void linkHovered(const QString& contents);
188 
189 protected:
190  void paintEvent(QPaintEvent *event);
191 
192  bool event(QEvent *event);
193 
194  void resizeEvent(QResizeEvent *event);
195 
196  void showEvent(QShowEvent *event);
197 
198 private:
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::Positive
Definition: kmessagewidget.h:104
KMessageWidget::MessageType
MessageType
Definition: kmessagewidget.h:103
QWidget
QString
Error
MessageType
MessageType
KMessageWidget::Warning
Definition: kmessagewidget.h:106
KMessageWidget::Information
Definition: kmessagewidget.h:105
kdeui_export.h
QSize
KMessageWidget
A widget to provide feedback or propose opportunistic interactions.
Definition: kmessagewidget.h:92
QFrame
QAction
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:15 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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