blob: e92e97aa1b9adc145e2a590181ee92f97ad45e00 [file] [log] [blame]
Nicolas Jagere069c412016-08-15 15:00:17 -04001#pragma once
atraczyke9919eb2016-09-15 15:58:18 -04002/**************************************************************************
3* Copyright (C) 2016 by Savoir-faire Linux *
4* Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
5* Author: Traczyk Andreas <andreas.traczyk@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**************************************************************************/
Nicolas Jagere069c412016-08-15 15:00:17 -040020#include "VideoPage.g.h"
atraczyk5c395ea2016-09-20 17:28:09 -040021#include "MessageTextPage.xaml.h"
Nicolas Jagere069c412016-08-15 15:00:17 -040022
23using namespace Windows::Media::Capture;
24using namespace Windows::UI::Xaml::Navigation;
25
atraczyk14ba30c2016-09-22 18:31:59 -040026using namespace Windows::UI::Xaml;
27using namespace Windows::ApplicationModel::Core;
28using namespace Windows::Devices::Enumeration;
29
30
Nicolas Jagere069c412016-08-15 15:00:17 -040031namespace RingClientUWP
32{
33/* delegate */
34delegate void PressHangUpCall();
35delegate void PauseCall();
36delegate void ChatPanelCall();
37delegate void AddContactCall();
38delegate void TransferCall();
39delegate void SwitchMicrophoneStateCall();
40delegate void SwitchVideoStateCall();
41delegate void ReccordVideoCall();
42delegate void QualityVideoLevelCall();
43
44namespace Views
45{
46
47public ref class VideoPage sealed
48{
49public:
50 VideoPage();
atraczyke9919eb2016-09-15 15:58:18 -040051 void updatePageContent();
52
Nicolas Jagere069c412016-08-15 15:00:17 -040053 property bool barFading
54 {
55 bool get()
56 {
57 return barFading_;
58 }
59 void set(bool value)
60 {
61 barFading_ = value;
62 }
63 }
64
atraczyk5c395ea2016-09-20 17:28:09 -040065 property bool chatOpen
66 {
67 bool get()
68 {
69 return chatOpen_;
70 }
71 void set(bool value)
72 {
73 chatOpen_ = value;
74 }
75 }
76
77 void scrollDown();
78
Nicolas Jagere069c412016-08-15 15:00:17 -040079protected:
Nicolas Jagere069c412016-08-15 15:00:17 -040080 virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
Nicolas Jagere069c412016-08-15 15:00:17 -040081
82internal:
83 /* events */
84 event PressHangUpCall^ pressHangUpCall;
85 event PauseCall^ pauseCall;
86 event ChatPanelCall^ chatPanelCall;
87 event AddContactCall^ addContactCall;
88 event TransferCall^ transferCall;
89 event SwitchMicrophoneStateCall^ switchMicrophoneStateCall;
90 event SwitchVideoStateCall^ switchVideoStateCall;
91 event ReccordVideoCall^ reccordVideoCall;
92 event QualityVideoLevelCall^ qualityVideoLevelCall;
93
94private:
95 bool barFading_;
atraczyk5c395ea2016-09-20 17:28:09 -040096 bool chatOpen_;
97
98 void _sendBtn__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
99 void _messageTextBox__KeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
100 void sendMessage();
Nicolas Jagere069c412016-08-15 15:00:17 -0400101
atraczyk14ba30c2016-09-22 18:31:59 -0400102 Concurrency::task<void> WriteFrameAsSoftwareBitmapAsync(String^ id, uint8_t* buf, int width, int height);
103
Nicolas Jagere069c412016-08-15 15:00:17 -0400104 void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
105 void _btnCancel__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
106 void _btnHangUp__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
107 void _btnPause__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
108 void _btnChat__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
109 void _btnAddFriend__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
110 void _btnSwitch__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
111 void _btnMicrophone__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
112 void _btnMemo__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
113 void _btnHQ__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
114 void _btnVideo__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
115 void _videoControl__PointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
116 void btnAny_entered(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
117 void btnAny_exited(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
Nicolas Jagerd57809f2016-10-06 11:31:55 -0400118 void OnincomingMessage(Platform::String ^callId, Platform::String ^payload);
Nicolas Jagere069c412016-08-15 15:00:17 -0400119};
120}
121}