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

KTextEditor

  • interfaces
  • 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
31namespace KTextEditor {
32
33class View;
34class Document;
35
91class 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
355private:
356 class MessagePrivate * const d;
357};
358
399class 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
433Q_DECLARE_INTERFACE(KTextEditor::MessageInterface, "org.kde.KTextEditor.MessageInterface")
434
435#endif
436
437// kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::Document
A KParts derived class representing a text document.
Definition: document.h:112
KTextEditor::MessageInterface
Message interface for posting interactive Messages to a Document and its Views.
Definition: messageinterface.h:400
KTextEditor::MessageInterface::postMessage
virtual bool postMessage(Message *message)=0
Post message to the Document and its Views.
KTextEditor::Message
This class holds a Message to display in Views.
Definition: messageinterface.h:92
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::BelowView
@ BelowView
show message below view
Definition: messageinterface.h:117
KTextEditor::Message::TopInView
@ TopInView
show message as view overlay in the top right corner
Definition: messageinterface.h:118
KTextEditor::Message::closed
void closed(KTextEditor::Message *message)
This signal is emitted before the message is deleted.
KTextEditor::Message::textChanged
void textChanged(const QString &text)
This signal is emitted whenever setText() is called.
KTextEditor::Message::MessageType
MessageType
Message types used as visual indicator.
Definition: messageinterface.h:104
KTextEditor::Message::Information
@ Information
information message type
Definition: messageinterface.h:106
KTextEditor::Message::Warning
@ Warning
warning message type
Definition: messageinterface.h:107
KTextEditor::Message::AutoHideMode
AutoHideMode
The AutoHideMode determines when to trigger the autoHide timer.
Definition: messageinterface.h:126
KTextEditor::Message::iconChanged
void iconChanged(const QIcon &icon)
This signal is emitted whenever setIcon() is called.
KTextEditor::View
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:146
QAction
QList
QObject
ktexteditor_export.h
Error
Error
MessageType
MessageType
KTextEditor
Namespace for the KDE Text Editor Interfaces.
Definition: annotationinterface.h:31
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.

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

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