blob: 463f10b4956736d766b1edc7ad8fc15c80b47114 [file] [log] [blame]
Nicolas Jager7c409f32016-09-08 09:35:16 -04001#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**************************************************************************/
20using namespace Platform;
21using namespace Windows::Data::Json;
22using namespace Windows::UI::Xaml;
23using namespace Windows::UI::Xaml::Data;
24
25namespace RingClientUWP
26{
27namespace Controls {
28public ref class SmartPanelItem sealed : public INotifyPropertyChanged
29{
30public:
31 SmartPanelItem();
Nicolas Jager61e6f0e2016-11-04 15:12:08 -040032 void muteVideo(bool state);
Nicolas Jager7c409f32016-09-08 09:35:16 -040033
34 virtual event PropertyChangedEventHandler^ PropertyChanged;
Nicolas Jager7c409f32016-09-08 09:35:16 -040035 property Contact^ _contact;
Nicolas Jager7c409f32016-09-08 09:35:16 -040036
Nicolas Jager083b3ae2016-10-04 08:46:19 -040037 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 Jagerd8e49592016-10-25 08:00:11 -040051 NotifyPropertyChanged("_callStatus");
Nicolas Jager083b3ae2016-10-04 08:46:19 -040052 }
53 }
Nicolas Jager60022a52016-12-05 13:55:14 -050054 property bool _videoMuted // refacto : add set and remove void muteVideo(bool state);
Nicolas Jager61e6f0e2016-11-04 15:12:08 -040055 {
56 bool get()
57 {
58 return videoMuted_;
59 }
60 }
Nicolas Jager9edbea32016-10-03 09:13:53 -040061
Nicolas Jager60022a52016-12-05 13:55:14 -050062 property bool _audioMuted;
63
Nicolas Jager32f301f2016-11-22 14:28:57 -050064 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 Jager9d85be92016-12-10 16:10:31 -050077 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 Jager7c409f32016-09-08 09:35:16 -0400113protected:
114 void NotifyPropertyChanged(String^ propertyName);
115
116private:
Nicolas Jager32f301f2016-11-22 14:28:57 -0500117 Visibility showMe_ = Visibility::Visible;
Nicolas Jager083b3ae2016-10-04 08:46:19 -0400118 CallStatus callStatus_;
119 String^ callId_;
Nicolas Jager61e6f0e2016-11-04 15:12:08 -0400120 bool videoMuted_;
Nicolas Jager9d85be92016-12-10 16:10:31 -0500121 bool isSelected_;
122 bool isHovered_;
Nicolas Jagerc551c362016-10-01 19:24:50 -0400123
Nicolas Jager083b3ae2016-10-04 08:46:19 -0400124 void OncallPlaced(Platform::String ^callId);
Nicolas Jager7c409f32016-09-08 09:35:16 -0400125};
126}
127}
128