Account.h 3.89 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/***************************************************************************
 * Copyright (C) 2016 by Savoir-faire Linux                                *
 * Author: Jger Nicolas <nicolas.jager@savoirfairelinux.com>              *
 * Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com>          *
 *                                                                         *
 * This program is free software; you can redistribute it and/or modify    *
 * it under the terms of the GNU General Public License as published by    *
 * the Free Software Foundation; either version 3 of the License, or       *
 * (at your option) any later version.                                     *
 *                                                                         *
 * This program is distributed in the hope that it will be useful,         *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 * GNU General Public License for more details.                            *
 *                                                                         *
 * You should have received a copy of the GNU General Public License       *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
 **************************************************************************/
Nicolas Jager's avatar
Nicolas Jager committed
19
#pragma once
20

Nicolas Jager's avatar
Nicolas Jager committed
21
22
using namespace Platform;
using namespace Windows::UI::Xaml::Data;
Nicolas Jager's avatar
Nicolas Jager committed
23
using namespace Platform::Collections;
24
using namespace Windows::Foundation::Collections;
Nicolas Jager's avatar
Nicolas Jager committed
25
26
27

namespace RingClientUWP
{
28
29
ref class Contact;

Nicolas Jager's avatar
Nicolas Jager committed
30
31
32
public ref class Account sealed : public INotifyPropertyChanged
{
public:
33
34
    Account(String^ name, String^ ringID, String^ accountType, String^ accountID, String^ deviceId, bool upnpState
            , String^ sipHostname, String^ sipUsername, String^ sipPassword);
Nicolas Jager's avatar
Nicolas Jager committed
35
36
37

    virtual event PropertyChangedEventHandler^ PropertyChanged;

38
39
40
    property String^ name_
    {
        String^ get() {
41
            return alias_;
42
43
        }
        void set(String^ value) {
44
            alias_ = value;
45
            NotifyPropertyChanged("name_");
46
47
        }
    }
48
49
50
51
52
53
54
55
56
    property String^ ringID_ {
        String^ get() {
            return ringID__;
        }
        void set(String^ value) {
            ringID__ = value;
            NotifyPropertyChanged("ringID_");
        }
    }
57
    property String^ accountType_; // refacto : create a enum accountType
58
    property String^ accountID_;
Nicolas Jager's avatar
Nicolas Jager committed
59
    property String^ _deviceId;
60
61
    property IVector<String^>^ _devicesIdList {
        IVector<String^>^ get() {
Nicolas Jager's avatar
Nicolas Jager committed
62
63
            return devicesIdList_;
        }
64
        void set(IVector<String^>^ value) {
Nicolas Jager's avatar
Nicolas Jager committed
65
66
            devicesIdList_ = value;
        }
67
68
    };
    property bool _upnpState;
69
70
71
72
73
74
75
76
77
78
79
    property String^ _sipHostname;
    property String^ _sipUsername
    {
        String^ get() {
            return sipUsername_;
        }
        void set(String^ value) {
            sipUsername_ = value;
            NotifyPropertyChanged("_sipUsername");
        }
    }
80
81
82
83
84
85
86
87
88
89
90
91

    property unsigned _unreadMessages
    {
        unsigned get() {
            return unreadMessages_;
        }
        void set(unsigned value) {
            unreadMessages_ = value;
            NotifyPropertyChanged("_unreadMessages");
        }
    }

92
    property String^ _sipPassword; // refacto : think to encrypt password in memory
Nicolas Jager's avatar
Nicolas Jager committed
93

94
95
96
97
98
99
100
101
102
    property IVector<Contact^>^ _contactsList {
        IVector<Contact^>^ get() {
            return contactsList_;
        }
        void set(IVector<Contact^>^ value) {
            contactsList_ = value;
        }
    };

Nicolas Jager's avatar
Nicolas Jager committed
103
104
105
protected:
    void NotifyPropertyChanged(String^ propertyName);

Nicolas Jager's avatar
Nicolas Jager committed
106
private:
107
108
109
    IVector<String^>^ devicesIdList_;
    IVector<Contact^>^ contactsList_;

110
    String^ alias_;
111
    String^ ringID__;
112
    String^ sipUsername_;
113
    unsigned unreadMessages_;
Nicolas Jager's avatar
Nicolas Jager committed
114
115
116
};
}