blob: 6a9a04c34b399bb3f2759bd784f7ee437719540d [file] [log] [blame]
Nicolas Jager58c70b02016-08-26 09:50:45 -04001#pragma once
2/**************************************************************************
3* Copyright (C) 2016 by Savoir-faire Linux *
4* Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
5* Author: Traczyk Andreas <traczyk.andreas@savoirfairelinux.com> *
6* *
7* This program is free software; you can redistribute it and/or modify *
8* it under the terms of the GNU General Public License as published by *
9* the Free Software Foundation; either version 3 of the License, or *
10* (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**************************************************************************/
20using namespace Platform;
21using namespace Windows::UI::Xaml::Data;
22
atraczykf5be5462016-08-31 14:23:06 -040023/* strings required by Windows::Data::Json. Defined here on puprose */
24String^ conversationKey = "conversation";
25String^ messageKey = "message";
26String^ dateKey = "date";
27String^ fromContactKey = "fromContact";
28String^ payloadKey = "payload";
29
Nicolas Jager58c70b02016-08-26 09:50:45 -040030namespace RingClientUWP
31{
32public ref class ConversationMessage sealed
33{
34public:
35 property String^ Date;
36 property bool FromContact;
37 property String^ Payload;
atraczykf5be5462016-08-31 14:23:06 -040038
39 /* functions */
40 JsonObject^ ToJsonObject();
Nicolas Jager58c70b02016-08-26 09:50:45 -040041};
42
43public ref class Conversation sealed
44{
45private:
46
47
48public:
Nicolas Jager93abfea2016-08-30 12:33:07 -040049 /* functions */
Nicolas Jager58c70b02016-08-26 09:50:45 -040050 Conversation();
51 void addMessage(String^ date, bool fromContact, String^ payload);
52
Nicolas Jager93abfea2016-08-30 12:33:07 -040053internal:
54 /* properties */
55 property Vector<ConversationMessage^>^ _messages
56 {
57 Vector<ConversationMessage^>^ get()
58 {
59 return messagesList_;
60 }
61 }
62
Nicolas Jager58c70b02016-08-26 09:50:45 -040063private:
Nicolas Jager93abfea2016-08-30 12:33:07 -040064 /* members */
65 Vector<ConversationMessage^>^ messagesList_;
Nicolas Jager58c70b02016-08-26 09:50:45 -040066
67};
68#define MSG_FROM_CONTACT true
69#define MSG_FROM_ME false
70}
71