1 /*
2  * %kadu copyright begin%
3  * Copyright 2014 Bartosz Brachaczek (b.brachaczek@gmail.com)
4  * Copyright 2011, 2012, 2013, 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com)
5  * %kadu copyright end%
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include "chat/chat.h"
22 #include "contacts/contact.h"
23 #include "core/injected-factory.h"
24 #include "html/normalized-html-string.h"
25 
26 #include "message.h"
27 
28 KaduSharedBaseClassImpl(Message)
29 
30 Message Message::null;
31 
Message()32 Message::Message()
33 {
34 }
35 
Message(MessageShared * data)36 Message::Message(MessageShared *data) :
37 		SharedBase<MessageShared>(data)
38 {
39 }
40 
Message(QObject * data)41 Message::Message(QObject *data)
42 {
43 	MessageShared *shared = qobject_cast<MessageShared *>(data);
44 	if (shared)
45 		setData(shared);
46 }
47 
Message(const Message & copy)48 Message::Message(const Message &copy) :
49 		SharedBase<MessageShared>(copy)
50 {
51 }
52 
~Message()53 Message::~Message()
54 {
55 }
56 
57 KaduSharedBase_PropertyDefCRW(Message, Chat, messageChat, MessageChat, Chat::null)
58 KaduSharedBase_PropertyDefCRW(Message, Contact, messageSender, MessageSender, Contact::null)
59 KaduSharedBase_PropertyDefCRW(Message, NormalizedHtmlString, content, Content, NormalizedHtmlString())
60 KaduSharedBase_PropertyDefCRW(Message, QDateTime, receiveDate, ReceiveDate, QDateTime())
61 KaduSharedBase_PropertyDefCRW(Message, QDateTime, sendDate, SendDate, QDateTime())
62 KaduSharedBase_PropertyDef(Message, MessageStatus, status, Status, MessageStatusUnknown)
63 KaduSharedBase_PropertyDef(Message, MessageType, type, Type, MessageTypeUnknown)
64 KaduSharedBase_PropertyDefCRW(Message, QString, id, Id, QString())
65