blob: 1c6f7798577921a08b184e2270d2e7aa680db3e5 [file] [log] [blame]
atraczyk8ce1dee2016-08-25 18:15:07 -04001/***************************************************************************
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 Jagerbff5fbb2016-08-18 08:58:56 -040019#pragma once
atraczyk8ce1dee2016-08-25 18:15:07 -040020
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040021using namespace Platform;
22using namespace Windows::UI::Xaml::Data;
Nicolas Jager813cf4d2016-10-06 10:54:46 -040023using namespace Platform::Collections;
atraczyk46910032017-03-08 17:57:01 -050024using namespace Windows::Foundation::Collections;
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040025
26namespace RingClientUWP
27{
atraczyk46910032017-03-08 17:57:01 -050028ref class Contact;
29
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040030public ref class Account sealed : public INotifyPropertyChanged
31{
32public:
Nicolas Jager0a7b77d2016-10-26 12:26:43 -040033 Account(String^ name, String^ ringID, String^ accountType, String^ accountID, String^ deviceId, bool upnpState
34 , String^ sipHostname, String^ sipUsername, String^ sipPassword);
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040035
36 virtual event PropertyChangedEventHandler^ PropertyChanged;
37
Nicolas Jager6abfc0d2016-10-21 14:57:47 -040038 property String^ name_
39 {
40 String^ get() {
Nicolas Jager0a7b77d2016-10-26 12:26:43 -040041 return alias_;
Nicolas Jager6abfc0d2016-10-21 14:57:47 -040042 }
43 void set(String^ value) {
Nicolas Jager0a7b77d2016-10-26 12:26:43 -040044 alias_ = value;
Nicolas Jagerd8e49592016-10-25 08:00:11 -040045 NotifyPropertyChanged("name_");
Nicolas Jager6abfc0d2016-10-21 14:57:47 -040046 }
47 }
Nicolas Jager7168df92016-10-25 13:23:03 -040048 property String^ ringID_ {
49 String^ get() {
50 return ringID__;
51 }
52 void set(String^ value) {
53 ringID__ = value;
54 NotifyPropertyChanged("ringID_");
55 }
56 }
Nicolas Jagerd0830772016-10-07 08:45:33 -040057 property String^ accountType_; // refacto : create a enum accountType
atraczyk797fa1a2016-08-31 09:55:53 -040058 property String^ accountID_;
Nicolas Jager813cf4d2016-10-06 10:54:46 -040059 property String^ _deviceId;
atraczyk46910032017-03-08 17:57:01 -050060 property IVector<String^>^ _devicesIdList {
61 IVector<String^>^ get() {
Nicolas Jager813cf4d2016-10-06 10:54:46 -040062 return devicesIdList_;
63 }
atraczyk46910032017-03-08 17:57:01 -050064 void set(IVector<String^>^ value) {
Nicolas Jager813cf4d2016-10-06 10:54:46 -040065 devicesIdList_ = value;
66 }
Nicolas Jager6abfc0d2016-10-21 14:57:47 -040067 };
68 property bool _upnpState;
Nicolas Jager0a7b77d2016-10-26 12:26:43 -040069 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 }
atraczyk46910032017-03-08 17:57:01 -050080
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 Jager0a7b77d2016-10-26 12:26:43 -040092 property String^ _sipPassword; // refacto : think to encrypt password in memory
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040093
atraczyk46910032017-03-08 17:57:01 -050094 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 Jagerbff5fbb2016-08-18 08:58:56 -0400103protected:
104 void NotifyPropertyChanged(String^ propertyName);
105
Nicolas Jager813cf4d2016-10-06 10:54:46 -0400106private:
atraczyk46910032017-03-08 17:57:01 -0500107 IVector<String^>^ devicesIdList_;
108 IVector<Contact^>^ contactsList_;
109
Nicolas Jager0a7b77d2016-10-26 12:26:43 -0400110 String^ alias_;
Nicolas Jager7168df92016-10-25 13:23:03 -0400111 String^ ringID__;
Nicolas Jager0a7b77d2016-10-26 12:26:43 -0400112 String^ sipUsername_;
atraczyk46910032017-03-08 17:57:01 -0500113 unsigned unreadMessages_;
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400114};
115}
116