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

KTextEditor

  • kde-4.14
  • applications
  • kate
  • ktexteditor
messageinterface.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2012-2013 Dominik Haumann <dhaumann@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 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  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef KTEXTEDITOR_MESSAGEINTERFACE_H
22 #define KTEXTEDITOR_MESSAGEINTERFACE_H
23 
24 #include <QtCore/QObject>
25 #include <QtCore/QList>
26 #include <QtGui/QAction>
27 #include <QtGui/QIcon>
28 
29 #include <ktexteditor/ktexteditor_export.h>
30 
31 namespace KTextEditor {
32 
33 class View;
34 class Document;
35 
91 class KTEXTEDITOR_EXPORT Message : public QObject
92 {
93  Q_OBJECT
94 
95  //
96  // public data types
97  //
98  public:
104  enum MessageType {
105  Positive = 0,
106  Information,
107  Warning,
108  Error
109  };
110 
115  enum MessagePosition {
116  AboveView = 0,
117  BelowView,
118  TopInView,
119  BottomInView
120  };
121 
126  enum AutoHideMode {
127  Immediate = 0,
128  AfterUserInteraction
129  };
130 
131  public:
137  Message(const QString& richtext, MessageType type = Message::Information);
138 
142  virtual ~Message();
143 
147  QString text() const;
148 
153  QIcon icon() const;
154 
158  MessageType messageType() const;
159 
180  void addAction(QAction* action, bool closeOnTrigger = true);
181 
186  QList<QAction*> actions() const;
187 
198  void setAutoHide(int autoHideTimer = 0);
199 
206  int autoHide() const;
207 
214  void setAutoHideMode(KTextEditor::Message::AutoHideMode mode);
215 
221  KTextEditor::Message::AutoHideMode autoHideMode() const;
222 
232  void setWordWrap(bool wordWrap);
233 
239  bool wordWrap() const;
240 
248  void setPriority(int priority);
249 
255  int priority() const;
256 
263  void setView(KTextEditor::View* view);
264 
269  KTextEditor::View* view() const;
270 
278  void setDocument(KTextEditor::Document* document);
279 
284  KTextEditor::Document* document() const;
285 
291  void setPosition(MessagePosition position);
292 
296  MessagePosition position() const;
297 
298  public Q_SLOTS:
309  void setText(const QString& richtext);
310 
316  void setIcon(const QIcon& icon);
317 
318  Q_SIGNALS:
327  void closed(KTextEditor::Message* message);
328 
340  void textChanged(const QString& text);
341 
353  void iconChanged(const QIcon& icon);
354 
355 private:
356  class MessagePrivate * const d;
357 };
358 
399 class KTEXTEDITOR_EXPORT MessageInterface
400 {
401  public:
405  MessageInterface();
409  virtual ~MessageInterface();
410 
425  virtual bool postMessage(Message* message) = 0;
426 
427  private:
428  class MessageInterfacePrivate * const d;
429 };
430 
431 }
432 
433 Q_DECLARE_INTERFACE(KTextEditor::MessageInterface, "org.kde.KTextEditor.MessageInterface")
434 
435 #endif
436 
437 // kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::Message::BelowView
show message below view
Definition: messageinterface.h:117
ktexteditor_export.h
KTextEditor::Document
A KParts derived class representing a text document.
Definition: document.h:111
QObject
KTEXTEDITOR_EXPORT
#define KTEXTEDITOR_EXPORT
Definition: ktexteditor_export.h:35
QString
QList< QAction * >
KTextEditor::Message::MessagePosition
MessagePosition
Message position used to place the message either above or below of the KTextEditor::View.
Definition: messageinterface.h:115
KTextEditor::Message::MessageType
MessageType
Message types used as visual indicator.
Definition: messageinterface.h:104
QAction
KTextEditor::Message::TopInView
show message as view overlay in the top right corner
Definition: messageinterface.h:118
KTextEditor::Message::AutoHideMode
AutoHideMode
The AutoHideMode determines when to trigger the autoHide timer.
Definition: messageinterface.h:126
KTextEditor::Message::Information
information message type
Definition: messageinterface.h:106
KTextEditor::View
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:145
KTextEditor::Message
This class holds a Message to display in Views.
Definition: messageinterface.h:91
KTextEditor::Message::Warning
warning message type
Definition: messageinterface.h:107
QIcon
KTextEditor::MessageInterface
Message interface for posting interactive Messages to a Document and its Views.
Definition: messageinterface.h:399
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTextEditor

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

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