atraczyk | 8ce1dee | 2016-08-25 18:15:07 -0400 | [diff] [blame] | 1 | /***************************************************************************
|
| 2 | * Copyright (C) 2016 by Savoir-faire Linux *
|
| 3 | * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
|
| 4 | * Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com> *
|
| 5 | * *
|
| 6 | * This program is free software; you can redistribute it and/or modify *
|
| 7 | * it under the terms of the GNU General Public License as published by *
|
| 8 | * the Free Software Foundation; either version 3 of the License, or *
|
| 9 | * (at your option) any later version. *
|
| 10 | * *
|
| 11 | * This program is distributed in the hope that it will be useful, *
|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
| 14 | * GNU General Public License for more details. *
|
| 15 | * *
|
| 16 | * You should have received a copy of the GNU General Public License *
|
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
| 18 | **************************************************************************/
|
Nicolas Jager | bff5fbb | 2016-08-18 08:58:56 -0400 | [diff] [blame] | 19 | #pragma once
|
atraczyk | 8ce1dee | 2016-08-25 18:15:07 -0400 | [diff] [blame] | 20 |
|
Nicolas Jager | bff5fbb | 2016-08-18 08:58:56 -0400 | [diff] [blame] | 21 | using namespace Platform;
|
| 22 | using namespace Windows::UI::Xaml::Data;
|
Nicolas Jager | 813cf4d | 2016-10-06 10:54:46 -0400 | [diff] [blame] | 23 | using namespace Platform::Collections;
|
atraczyk | 4691003 | 2017-03-08 17:57:01 -0500 | [diff] [blame^] | 24 | using namespace Windows::Foundation::Collections;
|
Nicolas Jager | bff5fbb | 2016-08-18 08:58:56 -0400 | [diff] [blame] | 25 |
|
| 26 | namespace RingClientUWP
|
| 27 | {
|
atraczyk | 4691003 | 2017-03-08 17:57:01 -0500 | [diff] [blame^] | 28 | ref class Contact;
|
| 29 |
|
Nicolas Jager | bff5fbb | 2016-08-18 08:58:56 -0400 | [diff] [blame] | 30 | public ref class Account sealed : public INotifyPropertyChanged
|
| 31 | {
|
| 32 | public:
|
Nicolas Jager | 0a7b77d | 2016-10-26 12:26:43 -0400 | [diff] [blame] | 33 | Account(String^ name, String^ ringID, String^ accountType, String^ accountID, String^ deviceId, bool upnpState
|
| 34 | , String^ sipHostname, String^ sipUsername, String^ sipPassword);
|
Nicolas Jager | bff5fbb | 2016-08-18 08:58:56 -0400 | [diff] [blame] | 35 |
|
| 36 | virtual event PropertyChangedEventHandler^ PropertyChanged;
|
| 37 |
|
Nicolas Jager | 6abfc0d | 2016-10-21 14:57:47 -0400 | [diff] [blame] | 38 | property String^ name_
|
| 39 | {
|
| 40 | String^ get() {
|
Nicolas Jager | 0a7b77d | 2016-10-26 12:26:43 -0400 | [diff] [blame] | 41 | return alias_;
|
Nicolas Jager | 6abfc0d | 2016-10-21 14:57:47 -0400 | [diff] [blame] | 42 | }
|
| 43 | void set(String^ value) {
|
Nicolas Jager | 0a7b77d | 2016-10-26 12:26:43 -0400 | [diff] [blame] | 44 | alias_ = value;
|
Nicolas Jager | d8e4959 | 2016-10-25 08:00:11 -0400 | [diff] [blame] | 45 | NotifyPropertyChanged("name_");
|
Nicolas Jager | 6abfc0d | 2016-10-21 14:57:47 -0400 | [diff] [blame] | 46 | }
|
| 47 | }
|
Nicolas Jager | 7168df9 | 2016-10-25 13:23:03 -0400 | [diff] [blame] | 48 | property String^ ringID_ {
|
| 49 | String^ get() {
|
| 50 | return ringID__;
|
| 51 | }
|
| 52 | void set(String^ value) {
|
| 53 | ringID__ = value;
|
| 54 | NotifyPropertyChanged("ringID_");
|
| 55 | }
|
| 56 | }
|
Nicolas Jager | d083077 | 2016-10-07 08:45:33 -0400 | [diff] [blame] | 57 | property String^ accountType_; // refacto : create a enum accountType
|
atraczyk | 797fa1a | 2016-08-31 09:55:53 -0400 | [diff] [blame] | 58 | property String^ accountID_;
|
Nicolas Jager | 813cf4d | 2016-10-06 10:54:46 -0400 | [diff] [blame] | 59 | property String^ _deviceId;
|
atraczyk | 4691003 | 2017-03-08 17:57:01 -0500 | [diff] [blame^] | 60 | property IVector<String^>^ _devicesIdList {
|
| 61 | IVector<String^>^ get() {
|
Nicolas Jager | 813cf4d | 2016-10-06 10:54:46 -0400 | [diff] [blame] | 62 | return devicesIdList_;
|
| 63 | }
|
atraczyk | 4691003 | 2017-03-08 17:57:01 -0500 | [diff] [blame^] | 64 | void set(IVector<String^>^ value) {
|
Nicolas Jager | 813cf4d | 2016-10-06 10:54:46 -0400 | [diff] [blame] | 65 | devicesIdList_ = value;
|
| 66 | }
|
Nicolas Jager | 6abfc0d | 2016-10-21 14:57:47 -0400 | [diff] [blame] | 67 | };
|
| 68 | property bool _upnpState;
|
Nicolas Jager | 0a7b77d | 2016-10-26 12:26:43 -0400 | [diff] [blame] | 69 | property String^ _sipHostname;
|
| 70 | property String^ _sipUsername
|
| 71 | {
|
| 72 | String^ get() {
|
| 73 | return sipUsername_;
|
| 74 | }
|
| 75 | void set(String^ value) {
|
| 76 | sipUsername_ = value;
|
| 77 | NotifyPropertyChanged("_sipUsername");
|
| 78 | }
|
| 79 | }
|
atraczyk | 4691003 | 2017-03-08 17:57:01 -0500 | [diff] [blame^] | 80 |
|
| 81 | property unsigned _unreadMessages
|
| 82 | {
|
| 83 | unsigned get() {
|
| 84 | return unreadMessages_;
|
| 85 | }
|
| 86 | void set(unsigned value) {
|
| 87 | unreadMessages_ = value;
|
| 88 | NotifyPropertyChanged("_unreadMessages");
|
| 89 | }
|
| 90 | }
|
| 91 |
|
Nicolas Jager | 0a7b77d | 2016-10-26 12:26:43 -0400 | [diff] [blame] | 92 | property String^ _sipPassword; // refacto : think to encrypt password in memory
|
Nicolas Jager | bff5fbb | 2016-08-18 08:58:56 -0400 | [diff] [blame] | 93 |
|
atraczyk | 4691003 | 2017-03-08 17:57:01 -0500 | [diff] [blame^] | 94 | property IVector<Contact^>^ _contactsList {
|
| 95 | IVector<Contact^>^ get() {
|
| 96 | return contactsList_;
|
| 97 | }
|
| 98 | void set(IVector<Contact^>^ value) {
|
| 99 | contactsList_ = value;
|
| 100 | }
|
| 101 | };
|
| 102 |
|
Nicolas Jager | bff5fbb | 2016-08-18 08:58:56 -0400 | [diff] [blame] | 103 | protected:
|
| 104 | void NotifyPropertyChanged(String^ propertyName);
|
| 105 |
|
Nicolas Jager | 813cf4d | 2016-10-06 10:54:46 -0400 | [diff] [blame] | 106 | private:
|
atraczyk | 4691003 | 2017-03-08 17:57:01 -0500 | [diff] [blame^] | 107 | IVector<String^>^ devicesIdList_;
|
| 108 | IVector<Contact^>^ contactsList_;
|
| 109 |
|
Nicolas Jager | 0a7b77d | 2016-10-26 12:26:43 -0400 | [diff] [blame] | 110 | String^ alias_;
|
Nicolas Jager | 7168df9 | 2016-10-25 13:23:03 -0400 | [diff] [blame] | 111 | String^ ringID__;
|
Nicolas Jager | 0a7b77d | 2016-10-26 12:26:43 -0400 | [diff] [blame] | 112 | String^ sipUsername_;
|
atraczyk | 4691003 | 2017-03-08 17:57:01 -0500 | [diff] [blame^] | 113 | unsigned unreadMessages_;
|
Nicolas Jager | bff5fbb | 2016-08-18 08:58:56 -0400 | [diff] [blame] | 114 | };
|
| 115 | }
|
| 116 |
|