Nicolas Jager | b059a66 | 2016-08-30 13:17:30 -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::Data::Json;
|
Nicolas Jager | 0788e96 | 2016-08-26 15:41:06 -0400 | [diff] [blame^] | 22 | using namespace Windows::UI::Xaml;
|
Nicolas Jager | b059a66 | 2016-08-30 13:17:30 -0400 | [diff] [blame] | 23 | using namespace Windows::UI::Xaml::Data;
|
| 24 |
|
| 25 | /* strings required by Windows::Data::Json. Defined here on puprose */
|
| 26 | String^ nameKey = "name";
|
| 27 | String^ ringIDKey = "ringid";
|
| 28 | String^ contactKey = "contact";
|
| 29 | String^ contactListKey = "contactlist";
|
| 30 |
|
| 31 | namespace RingClientUWP
|
| 32 | {
|
| 33 | ref class Conversation;
|
| 34 | public ref class Contact sealed : public INotifyPropertyChanged
|
| 35 | {
|
| 36 | public:
|
| 37 | Contact(String^ name, String^ ringID);
|
| 38 | JsonObject^ ToJsonObject();
|
| 39 |
|
Nicolas Jager | b059a66 | 2016-08-30 13:17:30 -0400 | [diff] [blame] | 40 | virtual event PropertyChangedEventHandler^ PropertyChanged;
|
| 41 |
|
| 42 | property String^ name_;
|
| 43 | property String^ ringID_;
|
| 44 | property Conversation^ _conversation
|
| 45 | {
|
| 46 | Conversation^ get()
|
| 47 | {
|
| 48 | return conversation_;
|
| 49 | }
|
| 50 | }
|
Nicolas Jager | 0788e96 | 2016-08-26 15:41:06 -0400 | [diff] [blame^] | 51 | property Visibility notificationNewMessage
|
| 52 | {
|
| 53 | Visibility get()
|
| 54 | {
|
| 55 | return notificationNewMessage_;
|
| 56 | }
|
| 57 | void set(Visibility visibility)
|
| 58 | {
|
| 59 | notificationNewMessage_ = visibility;
|
| 60 | PropertyChanged(this, ref new PropertyChangedEventArgs("notificationNewMessage"));
|
| 61 | }
|
| 62 | }
|
| 63 | property String^ unreadMessages
|
| 64 | {
|
| 65 | String^ get()
|
| 66 | {
|
| 67 | return unreadMessages_.ToString();
|
| 68 | }
|
| 69 | }
|
Nicolas Jager | b059a66 | 2016-08-30 13:17:30 -0400 | [diff] [blame] | 70 |
|
| 71 | protected:
|
| 72 | void NotifyPropertyChanged(String^ propertyName);
|
| 73 |
|
| 74 | private:
|
| 75 | Conversation^ conversation_;
|
Nicolas Jager | 0788e96 | 2016-08-26 15:41:06 -0400 | [diff] [blame^] | 76 | Visibility notificationNewMessage_;
|
| 77 | unsigned int unreadMessages_;
|
Nicolas Jager | b059a66 | 2016-08-30 13:17:30 -0400 | [diff] [blame] | 78 |
|
| 79 | };
|
| 80 | }
|
| 81 |
|