kopete/libkopete
kopetemessage.cpp
Go to the documentation of this file.
52 : id(nextId++), direction(Internal), format(Qt::PlainText), type(TypeNormal), importance(Normal), state(StateUnknown),
54 timeStamp( QDateTime::currentDateTime() ), body(new QTextDocument), parsedBodyDirty(true), escapedBodyDirty(true),
304 const QString elem = ( elemEndPos == -1 ? match.toLower() : match.left( elemEndPos ).toLower() );
346 data.replace( QLatin1String( " " ), QLatin1String( " " ) ); //this one is used in jabber: note, we should escape all &#xx;
378 // the escaped body is cached because QRegExp is very expensive, so it shouldn't be used any more than necessary
392 // remove newlines that may be present, since they end up being displayed in the chat window. real newlines are represented with <br>, so we know \n's are meaningless
493 result.replace( QRegExp( QLatin1String("(<a href=\"[^\"]+)( )(\")") ) , QLatin1String("\\1\\3") );
712 QString Message::decodeString( const QByteArray &message, const QTextCodec *providedCodec, bool *success )
735 // if( providedCodec && providedCodec->heuristicContentMatch( message, charsToCheck ) >= charsToCheck )
void setDelayed(bool delay)
Set the "delayed" attribute of the message.
Definition: kopetemessage.cpp:819
void setTimestamp(const QDateTime ×tamp)
Set the message timestamp.
Definition: kopetemessage.cpp:505
QString fromAscii(const char *str, int size)
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
Qt::TextFormat format() const
Accessor method for the format of the message.
Definition: kopetemessage.cpp:575
QString fileName() const
Accessor method for the file name of incoming file transfer.
Definition: kopetemessage.cpp:679
void setImportance(MessageImportance importance)
Set the importance.
Definition: kopetemessage.cpp:281
static QString parseEmoticons(const QString &text, KEmoticonsTheme::ParseMode mode=KEmoticonsTheme::DefaultParse, const QStringList &exclude=QStringList())
Definition: kopeteemoticons.cpp:36
void setForegroundColor(const QColor &color)
Sets the foreground color for the message.
Definition: kopetemessage.cpp:219
void setForcedHtmlBody(const QString &body)
Sets the body of the message, which is used even if formatting is overridden.
Definition: kopetemessage.cpp:244
Message & operator=(const Message &other)
Assignment operator Just like the copy constructor it just refs and doesn't copy. ...
Definition: kopetemessage.cpp:177
QPixmap filePreview() const
Accessor method for the file preview icon.
Definition: kopetemessage.cpp:705
void setHtmlBody(const QString &body)
Sets the body of the message.
Definition: kopetemessage.cpp:239
static QString unescape(const QString &xml)
Unescapes a string, removing XML entity references and returns a plain text.
Definition: kopetemessage.cpp:286
void setFileName(const QString &fileName)
Set file name of incoming file transfer.
Definition: kopetemessage.cpp:671
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
bool isEmpty() const
QString simplified() const
QString join(const QString &separator) const
int length() const
bool fileTransferDisabled() const
Accessor method for the file transfer state.
Definition: kopetemessage.cpp:666
void setFileTransferDisabled(bool disabled)
Set the state of incoming file transfer.
Definition: kopetemessage.cpp:658
QString & remove(int position, int n)
Definition: kopetechatsession.h:74
QColor foregroundColor() const
Accessor method for the foreground color.
Definition: kopetemessage.cpp:540
(Default) Message which are not sent via the network. This is just a notification a plugin can show i...
Definition: kopetemessage.h:92
QString subject() const
Accessor method for the subject of the message.
Definition: kopetemessage.cpp:560
bool isRightToLeft() const
Accesssor method for the direction of the text based on what language it is in.
Definition: kopetemessage.cpp:550
MessageDirection direction() const
Accessor method for the direction of the message.
Definition: kopetemessage.cpp:580
const QTextDocument * body() const
Accessor method for the body of the message This is used internaly, to modify it make a copy of it wi...
Definition: kopetemessage.cpp:570
QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode)
void setDirection(MessageDirection direction)
Set the message direction.
Definition: kopetemessage.cpp:585
QString escapedBody() const
Get the message body as escaped (X)HTML format.
Definition: kopetemessage.cpp:374
static QString escape(const QString &)
Transform a plaintext message into HTML.
Definition: kopetemessage.cpp:351
QString fromUtf8(const char *str, int size)
state of message isn't known (e.g. protocol doesn't support message acknowledgment) ...
Definition: kopetemessage.h:118
void setBackgroundColor(const QColor &color)
Sets the background color for the message.
Definition: kopetemessage.cpp:224
void setManager(ChatSession *manager)
Set the messagemanager for this message.
Definition: kopetemessage.cpp:610
typedef Iterator
QColor backgroundColor() const
Accessor method for the background color of the message.
Definition: kopetemessage.cpp:545
void setPlainBody(const QString &body)
Sets the body of the message.
Definition: kopetemessage.cpp:234
Definition: kopetecontact.h:58
MessageImportance
Specifies the type of notification that will be sent with this message.
Definition: kopetemessage.h:109
iterator end()
QString toLower() const
void setRequestedPlugin(const QString &requestedPlugin)
Set a view plugin which will display the message.
Definition: kopetemessage.cpp:535
bool contains(QChar ch, Qt::CaseSensitivity cs) const
bool delayed() const
Accessor method for the "delayed" attribute of the message.
Definition: kopetemessage.cpp:814
void KDE_DEPRECATED setForegroundOverride(bool enable)
Does nothing.
Definition: kopetemessage.cpp:202
QString requestedPlugin() const
Accessor method for the preferred plugin If null, Kopete will use the user's preferred plugin...
Definition: kopetemessage.cpp:530
unsigned long fileSize() const
Accessor method for the file transfer size.
Definition: kopetemessage.cpp:692
QString & replace(int position, int n, QChar after)
void setBody(const QTextDocument *body)
Sets the body of the message The format is changed to RichText automatically.
Definition: kopetemessage.cpp:266
QTextDocument * clone(QObject *parent) const
QString mid(int position, int n) const
QDateTime timestamp() const
Accessor method for the timestamp of the message.
Definition: kopetemessage.cpp:500
QString escape(const QString &plain)
MessageImportance importance() const
Accessor method for the importance.
Definition: kopetemessage.cpp:590
int length() const
QString left(int n) const
void setFilePreview(const QPixmap &preview)
Set file preview icon for file transfer.
Definition: kopetemessage.cpp:697
QList< Contact * > to() const
Accessor method for the Contacts that this message was sent to.
Definition: kopetemessage.cpp:515
QString getHtmlStyleAttribute() const
Return HTML style attribute for this message.
Definition: kopetemessage.cpp:615
QString plainBody() const
Get the message body back as plain text.
Definition: kopetemessage.cpp:366
QString parsedBody() const
Get the message body as parsed HTML with Emoticons, and URL parsed This should be ready to be shown i...
Definition: kopetemessage.cpp:400
const Contact * from() const
Accessor method for the Contact that sent this message.
Definition: kopetemessage.cpp:510
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
void KDE_DEPRECATED setBackgroundOverride(bool enable)
Does nothing.
Definition: kopetemessage.cpp:197
const QStringList regexpPatterns()
returns QStringList with regexp patterns will be used to look for links in the message ...
Definition: kopetemessage.cpp:420
iterator begin()
QString toUnicode(const QByteArray &a) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.