atraczyk | 49822a3 | 2016-08-26 17:18:44 -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 | **************************************************************************/
|
atraczyk | 49822a3 | 2016-08-26 17:18:44 -0400 | [diff] [blame] | 19 | #pragma once
|
| 20 |
|
atraczyk | c25f69d | 2016-11-22 19:55:16 -0500 | [diff] [blame] | 21 | #include "VCardUtils.h"
|
| 22 |
|
atraczyk | 49822a3 | 2016-08-26 17:18:44 -0400 | [diff] [blame] | 23 | namespace RingClientUWP
|
| 24 | {
|
| 25 |
|
| 26 | delegate void SelectIndex(int index);
|
atraczyk | 2425ddd | 2016-09-01 13:16:22 -0400 | [diff] [blame] | 27 | delegate void LoadProfileImage();
|
atraczyk | 49822a3 | 2016-08-26 17:18:44 -0400 | [diff] [blame] | 28 |
|
| 29 | namespace Configuration
|
| 30 | {
|
| 31 |
|
| 32 | /* delegates */
|
| 33 |
|
| 34 | public ref class UserPreferences sealed
|
| 35 | {
|
| 36 | public:
|
| 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 */
|
atraczyk | c25f69d | 2016-11-22 19:55:16 -0500 | [diff] [blame] | 48 | property int PREF_ACCOUNT_INDEX;
|
| 49 | property uint64_t PREF_PROFILE_UID;
|
| 50 | property bool PREF_PROFILE_HASPHOTO;
|
| 51 | property String^ PREF_PROFILE_FN;
|
atraczyk | 49822a3 | 2016-08-26 17:18:44 -0400 | [diff] [blame] | 52 |
|
| 53 | /* functions */
|
atraczyk | c25f69d | 2016-11-22 19:55:16 -0500 | [diff] [blame] | 54 | void save();
|
| 55 | void load();
|
| 56 | String^ Stringify();
|
| 57 | void Destringify(String^ data);
|
| 58 | VCardUtils::VCard^ getVCard();
|
| 59 | void saveProfileToVCard();
|
atraczyk | 49822a3 | 2016-08-26 17:18:44 -0400 | [diff] [blame] | 60 |
|
| 61 | internal:
|
atraczyk | c25f69d | 2016-11-22 19:55:16 -0500 | [diff] [blame] | 62 | void sendVCard(std::string callID);
|
atraczyk | 49822a3 | 2016-08-26 17:18:44 -0400 | [diff] [blame] | 63 |
|
| 64 | /* events */
|
atraczyk | c25f69d | 2016-11-22 19:55:16 -0500 | [diff] [blame] | 65 | event SelectIndex^ selectIndex;
|
atraczyk | 2425ddd | 2016-09-01 13:16:22 -0400 | [diff] [blame] | 66 | event LoadProfileImage^ loadProfileImage;
|
atraczyk | c25f69d | 2016-11-22 19:55:16 -0500 | [diff] [blame] | 67 |
|
atraczyk | 49822a3 | 2016-08-26 17:18:44 -0400 | [diff] [blame] | 68 | private:
|
atraczyk | c25f69d | 2016-11-22 19:55:16 -0500 | [diff] [blame] | 69 | VCardUtils::VCard^ vCard_;
|
| 70 | UserPreferences();
|
atraczyk | 49822a3 | 2016-08-26 17:18:44 -0400 | [diff] [blame] | 71 |
|
| 72 | };
|
| 73 |
|
| 74 | }
|
| 75 | } |