Nicolas Jager | 58c70b0 | 2016-08-26 09:50:45 -0400 | [diff] [blame] | 1 | #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 | **************************************************************************/
|
| 20 | using namespace Platform;
|
| 21 | using namespace Windows::UI::Xaml::Data;
|
| 22 |
|
atraczyk | f5be546 | 2016-08-31 14:23:06 -0400 | [diff] [blame] | 23 | /* strings required by Windows::Data::Json. Defined here on puprose */
|
| 24 | String^ conversationKey = "conversation";
|
| 25 | String^ messageKey = "message";
|
| 26 | String^ dateKey = "date";
|
| 27 | String^ fromContactKey = "fromContact";
|
| 28 | String^ payloadKey = "payload";
|
| 29 |
|
Nicolas Jager | 58c70b0 | 2016-08-26 09:50:45 -0400 | [diff] [blame] | 30 | namespace RingClientUWP
|
| 31 | {
|
| 32 | public ref class ConversationMessage sealed
|
| 33 | {
|
| 34 | public:
|
| 35 | property String^ Date;
|
| 36 | property bool FromContact;
|
| 37 | property String^ Payload;
|
atraczyk | f5be546 | 2016-08-31 14:23:06 -0400 | [diff] [blame] | 38 |
|
| 39 | /* functions */
|
| 40 | JsonObject^ ToJsonObject();
|
Nicolas Jager | 58c70b0 | 2016-08-26 09:50:45 -0400 | [diff] [blame] | 41 | };
|
| 42 |
|
| 43 | public ref class Conversation sealed
|
| 44 | {
|
| 45 | private:
|
| 46 |
|
| 47 |
|
| 48 | public:
|
Nicolas Jager | 93abfea | 2016-08-30 12:33:07 -0400 | [diff] [blame] | 49 | /* functions */
|
Nicolas Jager | 58c70b0 | 2016-08-26 09:50:45 -0400 | [diff] [blame] | 50 | Conversation();
|
| 51 | void addMessage(String^ date, bool fromContact, String^ payload);
|
| 52 |
|
Nicolas Jager | 93abfea | 2016-08-30 12:33:07 -0400 | [diff] [blame] | 53 | internal:
|
| 54 | /* properties */
|
| 55 | property Vector<ConversationMessage^>^ _messages
|
| 56 | {
|
| 57 | Vector<ConversationMessage^>^ get()
|
| 58 | {
|
| 59 | return messagesList_;
|
| 60 | }
|
| 61 | }
|
| 62 |
|
Nicolas Jager | 58c70b0 | 2016-08-26 09:50:45 -0400 | [diff] [blame] | 63 | private:
|
Nicolas Jager | 93abfea | 2016-08-30 12:33:07 -0400 | [diff] [blame] | 64 | /* members */
|
| 65 | Vector<ConversationMessage^>^ messagesList_;
|
Nicolas Jager | 58c70b0 | 2016-08-26 09:50:45 -0400 | [diff] [blame] | 66 |
|
| 67 | };
|
| 68 | #define MSG_FROM_CONTACT true
|
| 69 | #define MSG_FROM_ME false
|
| 70 | }
|
| 71 |
|