• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 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 
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 public:
102  enum MessageType {
103  Positive,
104  Information,
105  Warning,
106  Error
107  };
108 
112  explicit KMessageWidget(QWidget *parent = 0);
113 
114  explicit KMessageWidget(const QString &text, QWidget *parent = 0);
115 
116  ~KMessageWidget();
117 
118  QString text() const;
119 
120  bool wordWrap() const;
121 
122  bool isCloseButtonVisible() const;
123 
124  MessageType messageType() const;
125 
126  void addAction(QAction *action);
127 
128  void removeAction(QAction *action);
129 
130  QSize sizeHint() const;
131 
132  QSize minimumSizeHint() const;
133 
134  int heightForWidth(int width) const;
135 
136 public Q_SLOTS:
137  void setText(const QString &text);
138 
139  void setWordWrap(bool wordWrap);
140 
141  void setCloseButtonVisible(bool visible);
142 
143  void setMessageType(KMessageWidget::MessageType type);
144 
149  void animatedShow();
150 
155  void animatedHide();
156 
157 Q_SIGNALS:
165  void linkActivated(const QString& contents);
166 
167 protected:
168  void paintEvent(QPaintEvent *event);
169 
170  bool event(QEvent *event);
171 
172  void resizeEvent(QResizeEvent *event);
173 
174  void showEvent(QShowEvent *event);
175 
176 private:
177  KMessageWidgetPrivate *const d;
178  friend class KMessageWidgetPrivate;
179 
180  Q_PRIVATE_SLOT(d, void slotTimeLineChanged(qreal))
181  Q_PRIVATE_SLOT(d, void slotTimeLineFinished())
182 };
183 
184 #endif /* KMESSAGEWIDGET_H */
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 20:33:59 by doxygen 1.8.1.1 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.10.5 API Reference

Skip menu "kdelibs-4.10.5 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