atraczyk | b724d33 | 2016-08-30 15:25:59 -0400 | [diff] [blame^] | 1 | /***************************************************************************
|
| 2 | * Copyright (C) 2016 by Savoir-faire Linux *
|
| 3 | * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
|
| 4 | * *
|
| 5 | * This program is free software; you can redistribute it and/or modify *
|
| 6 | * it under the terms of the GNU General Public License as published by *
|
| 7 | * the Free Software Foundation; either version 3 of the License, or *
|
| 8 | * (at your option) any later version. *
|
| 9 | * *
|
| 10 | * This program is distributed in the hope that it will be useful, *
|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
| 13 | * GNU General Public License for more details. *
|
| 14 | * *
|
| 15 | * You should have received a copy of the GNU General Public License *
|
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
| 17 | **************************************************************************/
|
| 18 | #pragma once
|
| 19 |
|
| 20 | using namespace concurrency;
|
| 21 |
|
| 22 | namespace RingClientUWP
|
| 23 | {
|
| 24 |
|
| 25 | /* delegate */
|
| 26 | delegate void IncomingCall(String^ accountId, String^ callId, String^ from);
|
| 27 | delegate void StateChange(String^ callId, String^ state, int code);
|
| 28 |
|
| 29 | public ref class RingD sealed
|
| 30 | {
|
| 31 | public:
|
| 32 | /* functions */
|
| 33 |
|
| 34 | /* properties */
|
| 35 | static property RingD^ instance
|
| 36 | {
|
| 37 | RingD^ get()
|
| 38 | {
|
| 39 | static RingD^ instance_ = ref new RingD();
|
| 40 | return instance_;
|
| 41 | }
|
| 42 | }
|
| 43 |
|
| 44 | property bool daemonRunning
|
| 45 | {
|
| 46 | bool get()
|
| 47 | {
|
| 48 | return daemonRunning_;
|
| 49 | }
|
| 50 | }
|
| 51 |
|
| 52 | internal:
|
| 53 | /* functions */
|
| 54 | void startDaemon();
|
| 55 | void reloadAccountList();
|
| 56 |
|
| 57 | /* TODO : move members */
|
| 58 | bool hasConfig;
|
| 59 | std::string accountName;
|
| 60 |
|
| 61 | /* events */
|
| 62 | event IncomingCall^ incomingCall;
|
| 63 | event StateChange^ stateChange;
|
| 64 |
|
| 65 | private:
|
| 66 | /* sub classes */
|
| 67 | enum class Request { None };
|
| 68 | ref class Task
|
| 69 | {
|
| 70 | public:
|
| 71 | property Request request;
|
| 72 | };
|
| 73 |
|
| 74 | /* functions */
|
| 75 | RingD(); // singleton
|
| 76 | void dequeueTasks();
|
| 77 |
|
| 78 | /* members */
|
| 79 | std::string localFolder_;
|
| 80 | bool daemonRunning_ = false;
|
| 81 | std::queue<Task^> tasksList_;
|
| 82 | };
|
Nicolas Jager | 32ed1a2 | 2016-08-17 08:36:02 -0400 | [diff] [blame] | 83 | } |