blob: fe24b44ba0abfaa9e5a0e6e1b0c2c6403ad8f641 [file] [log] [blame]
atraczyk49822a32016-08-26 17:18:44 -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 **************************************************************************/
atraczyk49822a32016-08-26 17:18:44 -040019#pragma once
20
atraczykc25f69d2016-11-22 19:55:16 -050021#include "VCardUtils.h"
22
atraczyk49822a32016-08-26 17:18:44 -040023namespace RingClientUWP
24{
25
26delegate void SelectIndex(int index);
atraczyk2425ddd2016-09-01 13:16:22 -040027delegate void LoadProfileImage();
atraczyk49822a32016-08-26 17:18:44 -040028
29namespace Configuration
30{
31
32/* delegates */
33
34public ref class UserPreferences sealed
35{
36public:
37 /* singleton */
38 static property UserPreferences^ instance
39 {
40 UserPreferences^ get()
41 {
42 static UserPreferences^ instance_ = ref new UserPreferences();
43 return instance_;
44 }
45 }
46
47 /* properties */
atraczykc25f69d2016-11-22 19:55:16 -050048 property int PREF_ACCOUNT_INDEX;
49 property uint64_t PREF_PROFILE_UID;
50 property bool PREF_PROFILE_HASPHOTO;
51 property String^ PREF_PROFILE_FN;
atraczyk49822a32016-08-26 17:18:44 -040052
53 /* functions */
atraczykc25f69d2016-11-22 19:55:16 -050054 void save();
55 void load();
56 String^ Stringify();
57 void Destringify(String^ data);
58 VCardUtils::VCard^ getVCard();
59 void saveProfileToVCard();
atraczyk49822a32016-08-26 17:18:44 -040060
61internal:
atraczykc25f69d2016-11-22 19:55:16 -050062 void sendVCard(std::string callID);
atraczyk49822a32016-08-26 17:18:44 -040063
64 /* events */
atraczykc25f69d2016-11-22 19:55:16 -050065 event SelectIndex^ selectIndex;
atraczyk2425ddd2016-09-01 13:16:22 -040066 event LoadProfileImage^ loadProfileImage;
atraczykc25f69d2016-11-22 19:55:16 -050067
atraczyk49822a32016-08-26 17:18:44 -040068private:
atraczykc25f69d2016-11-22 19:55:16 -050069 VCardUtils::VCard^ vCard_;
70 UserPreferences();
atraczyk49822a32016-08-26 17:18:44 -040071
72};
73
74}
75}