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

Nepomuk-Core

  • KTp
message.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 Lasath Fernando <kde@lasath.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 
20 #ifndef KTP_MESSAGE_H
21 #define KTP_MESSAGE_H
22 
23 #include <TelepathyQt/Message>
24 
25 #include <TelepathyLoggerQt4/Types>
26 #include <TelepathyLoggerQt4/TextEvent>
27 
28 #include <KTp/ktp-export.h>
29 #include <KTp/message-context.h>
30 
31 #include <QSharedData>
32 #include <QSharedDataPointer>
33 
34 namespace KTp
35 {
36 
52 class KTP_EXPORT Message
53 {
54  public:
55  enum MessageDirection {
56  LocalToRemote,
57  RemoteToLocal
58  };
59 
60  Message(const KTp::Message &other);
61  KTp::Message& operator=(const KTp::Message &other);
62  virtual ~Message();
63 
67  QString mainMessagePart() const;
68 
73  void setMainMessagePart(const QString &message);
74 
84  void appendMessagePart(const QString &part);
85 
92  void appendScript(const QString &script);
93 
104  QString finalizedMessage() const;
105 
112  QString finalizedScript() const;
113 
129  QVariant property(const char *name) const;
130  void setProperty(const char *name, const QVariant &value);
131 
133  QDateTime time() const;
135  QString token() const;
137  Tp::ChannelTextMessageType type() const;
139  QString senderAlias() const;
141  QString senderId() const;
142 
144  int partsSize() const;
145 
147  bool isHistory() const;
148 
149  MessageDirection direction() const;
150 
151 protected:
152  Message(const Tp::Message &original, const KTp::MessageContext &context);
153  Message(const Tp::ReceivedMessage &original, const KTp::MessageContext &context);
154  Message(const Tpl::TextEventPtr &original, const KTp::MessageContext &context);
155  explicit Message(const QString &messageText, const KTp::MessageContext &context);
156 
157 
158 private:
159  class Private;
160  QSharedDataPointer<Private> d;
161  friend class MessageProcessor;
162 };
163 
164 }
165 
166 
167 #endif // MESSAGE_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Mar 22 2013 10:58:52 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ktp-common-internals API Reference

Skip menu "ktp-common-internals API Reference"
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