1 /***************************************************************************
2  *   Copyright (C) 2011 by David Edmundson <kde@davidedmundson.co.uk>      *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program 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         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
18  ***************************************************************************/
19 
20 #ifndef ADIUMTHEMEMESSAGEINFO_H
21 #define ADIUMTHEMEMESSAGEINFO_H
22 
23 #include "ktpchat_export.h"
24 
25 class QString;
26 class QDateTime;
27 class AdiumThemeMessageInfoPrivate;
28 
29 class KDE_TELEPATHY_CHAT_EXPORT AdiumThemeMessageInfo
30 {
31 public:
32     enum MessageType {
33         RemoteToLocal,
34         LocalToRemote,
35         Status,
36         HistoryRemoteToLocal,
37         HistoryLocalToRemote,
38         HistoryStatus,
39         Invalid
40     };
41 
42     explicit AdiumThemeMessageInfo();
43     explicit AdiumThemeMessageInfo(MessageType);
44     explicit AdiumThemeMessageInfo(const AdiumThemeMessageInfo &other);
45     virtual ~AdiumThemeMessageInfo();
46     AdiumThemeMessageInfo &operator=(const AdiumThemeMessageInfo &other);
47 
48     MessageType type() const;
49 
50     /** The message itself of the message/status. */
51     QString message() const;
52     void setMessage(const QString& message);
53 
54     /** The time at which message/status occurred*/
55     QDateTime time() const;
56     void setTime(const QDateTime& time);
57 
58     /** The sender of the message */
59     QString sender() const;
60     void setSender(const QString& sender);
61 
62     /** Will be replaced with "showIcons" if the "Show user icons" checkbox is selected,*/
63     //FIXME in here or in AdiumThemeView..?
64     QString userIcons() const;
65 
66     QString messageClasses() const;
67     void appendMessageClass(const QString& messageClass);
68 
69     /** The text direction of the message (either rtl or ltr) */
70     QString messageDirection() const;
71 
72     /** The script to be run after appending the message. */
73     QString script() const;
74     void setScript(const QString& script);
75 private:
76     AdiumThemeMessageInfoPrivate *d;
77 };
78 
79 #endif // ADIUMTHEMEMESSAGEINFO_H
80