Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 1 | #pragma once
|
| 2 | /**************************************************************************
|
| 3 | * Copyright (C) 2016 by Savoir-faire Linux *
|
| 4 | * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
|
| 5 | * Author: Traczyk Andreas <traczyk.andreas@savoirfairelinux.com> *
|
| 6 | * *
|
| 7 | * This program is free software; you can redistribute it and/or modify *
|
| 8 | * it under the terms of the GNU General Public License as published by *
|
| 9 | * the Free Software Foundation; either version 3 of the License, or *
|
| 10 | * (at your option) any later version. *
|
| 11 | * *
|
| 12 | * This program is distributed in the hope that it will be useful, *
|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
| 15 | * GNU General Public License for more details. *
|
| 16 | * *
|
| 17 | * You should have received a copy of the GNU General Public License *
|
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
| 19 | **************************************************************************/
|
| 20 | using namespace Platform;
|
| 21 | using namespace Windows::Data::Json;
|
| 22 | using namespace Windows::UI::Xaml;
|
| 23 | using namespace Windows::UI::Xaml::Data;
|
| 24 |
|
| 25 | namespace RingClientUWP
|
| 26 | {
|
| 27 | namespace Controls {
|
| 28 | public ref class SmartPanelItem sealed : public INotifyPropertyChanged
|
| 29 | {
|
| 30 | public:
|
| 31 | SmartPanelItem();
|
Nicolas Jager | 61e6f0e | 2016-11-04 15:12:08 -0400 | [diff] [blame] | 32 | void muteVideo(bool state);
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 33 |
|
| 34 | virtual event PropertyChangedEventHandler^ PropertyChanged;
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 35 | property Contact^ _contact;
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 36 |
|
Nicolas Jager | 083b3ae | 2016-10-04 08:46:19 -0400 | [diff] [blame] | 37 | property String^ _callId; /*{
|
| 38 | String^ get() {
|
| 39 | return callId_;
|
| 40 | }
|
| 41 | void set(String^ value) {
|
| 42 | _callId = value;
|
| 43 | }
|
| 44 | }*/
|
| 45 | property CallStatus _callStatus {
|
| 46 | CallStatus get() {
|
| 47 | return callStatus_;
|
| 48 | }
|
| 49 | void set(CallStatus value) {
|
| 50 | callStatus_ = value;
|
Nicolas Jager | d8e4959 | 2016-10-25 08:00:11 -0400 | [diff] [blame] | 51 | NotifyPropertyChanged("_callStatus");
|
Nicolas Jager | 083b3ae | 2016-10-04 08:46:19 -0400 | [diff] [blame] | 52 | }
|
| 53 | }
|
Nicolas Jager | 60022a5 | 2016-12-05 13:55:14 -0500 | [diff] [blame] | 54 | property bool _videoMuted // refacto : add set and remove void muteVideo(bool state);
|
Nicolas Jager | 61e6f0e | 2016-11-04 15:12:08 -0400 | [diff] [blame] | 55 | {
|
| 56 | bool get()
|
| 57 | {
|
| 58 | return videoMuted_;
|
| 59 | }
|
| 60 | }
|
Nicolas Jager | 9edbea3 | 2016-10-03 09:13:53 -0400 | [diff] [blame] | 61 |
|
Nicolas Jager | 60022a5 | 2016-12-05 13:55:14 -0500 | [diff] [blame] | 62 | property bool _audioMuted;
|
| 63 |
|
Nicolas Jager | 32f301f | 2016-11-22 14:28:57 -0500 | [diff] [blame] | 64 | property Visibility _showMe
|
| 65 | {
|
| 66 | Visibility get()
|
| 67 | {
|
| 68 | return showMe_;
|
| 69 | }
|
| 70 | void set(Visibility value)
|
| 71 | {
|
| 72 | showMe_ = value;
|
| 73 | NotifyPropertyChanged("_showMe");
|
| 74 | }
|
| 75 | }
|
| 76 |
|
Nicolas Jager | 9d85be9 | 2016-12-10 16:10:31 -0500 | [diff] [blame] | 77 | property bool _isSelected
|
| 78 | {
|
| 79 | bool get()
|
| 80 | {
|
| 81 | return isSelected_;
|
| 82 | }
|
| 83 | void set(bool value)
|
| 84 | {
|
| 85 | isSelected_ = value;
|
| 86 | NotifyPropertyChanged("_isSelected");
|
| 87 | }
|
| 88 | }
|
| 89 |
|
| 90 | property bool _isHovered
|
| 91 | {
|
| 92 | bool get()
|
| 93 | {
|
| 94 | return isHovered_;
|
| 95 | }
|
| 96 | void set(bool value)
|
| 97 | {
|
| 98 | isHovered_ = value;
|
| 99 | NotifyPropertyChanged("_isHovered");
|
| 100 | NotifyPropertyChanged("_isCallable");
|
| 101 | }
|
| 102 | }
|
| 103 |
|
| 104 | property bool _isCallable
|
| 105 | {
|
| 106 | bool get()
|
| 107 | {
|
| 108 | return ((callStatus_ == CallStatus::ENDED || callStatus_ == CallStatus::NONE) && isHovered_)? true : false;
|
| 109 | }
|
| 110 | }
|
| 111 |
|
| 112 |
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 113 | protected:
|
| 114 | void NotifyPropertyChanged(String^ propertyName);
|
| 115 |
|
| 116 | private:
|
Nicolas Jager | 32f301f | 2016-11-22 14:28:57 -0500 | [diff] [blame] | 117 | Visibility showMe_ = Visibility::Visible;
|
Nicolas Jager | 083b3ae | 2016-10-04 08:46:19 -0400 | [diff] [blame] | 118 | CallStatus callStatus_;
|
| 119 | String^ callId_;
|
Nicolas Jager | 61e6f0e | 2016-11-04 15:12:08 -0400 | [diff] [blame] | 120 | bool videoMuted_;
|
Nicolas Jager | 9d85be9 | 2016-12-10 16:10:31 -0500 | [diff] [blame] | 121 | bool isSelected_;
|
| 122 | bool isHovered_;
|
Nicolas Jager | c551c36 | 2016-10-01 19:24:50 -0400 | [diff] [blame] | 123 |
|
Nicolas Jager | 083b3ae | 2016-10-04 08:46:19 -0400 | [diff] [blame] | 124 | void OncallPlaced(Platform::String ^callId);
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 125 | };
|
| 126 | }
|
| 127 | }
|
| 128 |
|