blob: a8b1934f524ab3fdd9c432f58226983540a15182 [file] [log] [blame]
Nicolas Jager998fbd72016-08-08 11:41:28 -04001#pragma once
2/**************************************************************************
3* Copyright (C) 2016 by Savoir-faire Linux *
4* Author: Jäger Nicolas <nicolas.jager@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**************************************************************************/
19#include "MainPage.g.h"
20
Nicolas Jager8a85e1f2016-08-15 15:11:06 -040021using namespace Windows::UI::Xaml::Controls;
Nicolas Jager998fbd72016-08-08 11:41:28 -040022using namespace Windows::UI::Xaml::Input;
atraczyk1ddcb5a2016-09-07 16:18:30 -040023using namespace Windows::Foundation;
atraczyk6290cc32016-10-07 08:47:15 -040024using namespace Windows::ApplicationModel::ExtendedExecution;
Nicolas Jager998fbd72016-08-08 11:41:28 -040025
26namespace RingClientUWP
27{
Nicolas Jagerc551c362016-10-01 19:24:50 -040028
Nicolas Jager998fbd72016-08-08 11:41:28 -040029namespace Views {
30}
31public ref class MainPage sealed
32{
33public:
34 MainPage();
atraczyk1ddcb5a2016-09-07 16:18:30 -040035 void showLoadingOverlay(bool load, bool modal);
36 void hideLoadingOverlay();
37
38 property bool isLoading;
Nicolas Jager998fbd72016-08-08 11:41:28 -040039
40protected:
atraczyk61b28422016-08-24 09:25:59 -040041 virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
Nicolas Jager998fbd72016-08-08 11:41:28 -040042 virtual void OnKeyDown(KeyRoutedEventArgs^ e) override;
atraczyk1ddcb5a2016-09-07 16:18:30 -040043
44 void PositionImage();
45 void PositionRing();
46 void OnResize(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e);
47
Nicolas Jager15861202016-08-12 11:13:05 -040048private:
atraczyk6290cc32016-10-07 08:47:15 -040049 // Visibility and suspension
atraczyk14ba30c2016-09-22 18:31:59 -040050 void Application_Suspending(Object^, Windows::ApplicationModel::SuspendingEventArgs^ e);
atraczyk6290cc32016-10-07 08:47:15 -040051 EventRegistrationToken applicationSuspendingEventToken;
atraczyk14ba30c2016-09-22 18:31:59 -040052 void Application_VisibilityChanged(Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
atraczyk6290cc32016-10-07 08:47:15 -040053 EventRegistrationToken visibilityChangedEventToken;
54 void Application_Resuming(Object^ sender, Object^ args);
55 EventRegistrationToken applicationResumingEventToken;
56 //void Application_Closing(Object^ sender, Windows::UI::Core::^ e);
57 //EventRegistrationToken applicationClosingEventToken;
58
59 ExtendedExecutionSession^ session;
60 void SessionRevoked(Object^ sender, ExtendedExecutionRevokedEventArgs^ args);
61 EventRegistrationToken sessionRevokedToken;
62 task<void> BeginExtendedExecution();
63 void ClearExtendedExecution();
atraczyk14ba30c2016-09-22 18:31:59 -040064
atraczyk1ddcb5a2016-09-07 16:18:30 -040065 // Multi-monitor, DPI, scale factor change, and window resize detection
66 void DisplayProperties_DpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
atraczyk6290cc32016-10-07 08:47:15 -040067 EventRegistrationToken dpiChangedtoken;
atraczyk1ddcb5a2016-09-07 16:18:30 -040068 Rect bounds;
69
Nicolas Jager15861202016-08-12 11:13:05 -040070 void _toggleSmartBoxButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
Nicolas Jager8a85e1f2016-08-15 15:11:06 -040071 void showFrame(Windows::UI::Xaml::Controls::Frame^ frame);
Nicolas Jagerc551c362016-10-01 19:24:50 -040072 void OnsummonMessageTextPage();
73 void OnsummonWelcomePage();
74 void OnsummonVideoPage();
75 void OnpressHangUpCall();
Nicolas Jager083b3ae2016-10-04 08:46:19 -040076 void OnstateChange(Platform::String ^callId, CallStatus state, int code);
Nicolas Jager998fbd72016-08-08 11:41:28 -040077};
atraczyk14ba30c2016-09-22 18:31:59 -040078}