blob: efa59b673cb693ec5f24b8e7706e2f9f04c5a53c [file] [log] [blame]
atraczyk6cae7a62016-11-30 14:56:31 -05001/**************************************************************************
Nicolas Jager998fbd72016-08-08 11:41:28 -04002* Copyright (C) 2016 by Savoir-faire Linux *
3* Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
atraczyk6cae7a62016-11-30 14:56:31 -05004* Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com> *
Nicolas Jager998fbd72016-08-08 11:41:28 -04005* *
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**************************************************************************/
atraczyk6cae7a62016-11-30 14:56:31 -050019#pragma once
20
Nicolas Jager998fbd72016-08-08 11:41:28 -040021#include "MainPage.g.h"
22
Nicolas Jager8a85e1f2016-08-15 15:11:06 -040023using namespace Windows::UI::Xaml::Controls;
Nicolas Jager998fbd72016-08-08 11:41:28 -040024using namespace Windows::UI::Xaml::Input;
atraczyk1ddcb5a2016-09-07 16:18:30 -040025using namespace Windows::Foundation;
atraczyk6290cc32016-10-07 08:47:15 -040026using namespace Windows::ApplicationModel::ExtendedExecution;
Nicolas Jager998fbd72016-08-08 11:41:28 -040027
28namespace RingClientUWP
29{
Nicolas Jagerc551c362016-10-01 19:24:50 -040030
Nicolas Jager998fbd72016-08-08 11:41:28 -040031namespace Views {
32}
33public ref class MainPage sealed
34{
35public:
36 MainPage();
atraczyk1ddcb5a2016-09-07 16:18:30 -040037 void showLoadingOverlay(bool load, bool modal);
38 void hideLoadingOverlay();
39
40 property bool isLoading;
atraczyk6cae7a62016-11-30 14:56:31 -050041 property bool isModal;
Nicolas Jager998fbd72016-08-08 11:41:28 -040042
43protected:
atraczyk61b28422016-08-24 09:25:59 -040044 virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
Nicolas Jager998fbd72016-08-08 11:41:28 -040045 virtual void OnKeyDown(KeyRoutedEventArgs^ e) override;
atraczyk1ddcb5a2016-09-07 16:18:30 -040046
atraczyk1ddcb5a2016-09-07 16:18:30 -040047 void OnResize(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e);
48
Nicolas Jager15861202016-08-12 11:13:05 -040049private:
atraczyk6290cc32016-10-07 08:47:15 -040050 // Visibility and suspension
atraczyk14ba30c2016-09-22 18:31:59 -040051 void Application_Suspending(Object^, Windows::ApplicationModel::SuspendingEventArgs^ e);
atraczyk6290cc32016-10-07 08:47:15 -040052 EventRegistrationToken applicationSuspendingEventToken;
atraczyk14ba30c2016-09-22 18:31:59 -040053 void Application_VisibilityChanged(Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
atraczyk6290cc32016-10-07 08:47:15 -040054 EventRegistrationToken visibilityChangedEventToken;
55 void Application_Resuming(Object^ sender, Object^ args);
56 EventRegistrationToken applicationResumingEventToken;
atraczyk6290cc32016-10-07 08:47:15 -040057
atraczyk1ddcb5a2016-09-07 16:18:30 -040058 // Multi-monitor, DPI, scale factor change, and window resize detection
59 void DisplayProperties_DpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
atraczyk6290cc32016-10-07 08:47:15 -040060 EventRegistrationToken dpiChangedtoken;
atraczyk1ddcb5a2016-09-07 16:18:30 -040061 Rect bounds;
Nicolas Jagerc680e4f2016-12-06 16:02:23 -050062 bool editionMode = false;
atraczyk1ddcb5a2016-09-07 16:18:30 -040063
Nicolas Jager15861202016-08-12 11:13:05 -040064 void _toggleSmartBoxButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
Nicolas Jager8a85e1f2016-08-15 15:11:06 -040065 void showFrame(Windows::UI::Xaml::Controls::Frame^ frame);
Nicolas Jagerc551c362016-10-01 19:24:50 -040066 void OnsummonMessageTextPage();
67 void OnsummonWelcomePage();
atraczykacc4c412016-11-10 22:56:52 -050068 void OnsummonPreviewPage();
69 void OnhidePreviewPage();
Nicolas Jagerc551c362016-10-01 19:24:50 -040070 void OnsummonVideoPage();
71 void OnpressHangUpCall();
Nicolas Jager083b3ae2016-10-04 08:46:19 -040072 void OnstateChange(Platform::String ^callId, CallStatus state, int code);
Nicolas Jagere72856b2016-10-30 15:06:17 -040073 void OncloseMessageTextPage();
Nicolas Jager026a84b2016-11-28 10:58:22 -050074 void OnregistrationStateErrorGeneric(const std::string& accountId);
75 void OnregistrationStateRegistered();
Nicolas Jagercba46f72016-12-02 16:04:50 -050076 void OncallPlaced(Platform::String ^callId);
Nicolas Jagerc680e4f2016-12-06 16:02:23 -050077 void OnnameRegistred(bool status);
78 void OnvolatileDetailsChanged(const std::string &accountId, const std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<const std::string, std::string>>> &details);
Nicolas Jager998fbd72016-08-08 11:41:28 -040079};
atraczyk14ba30c2016-09-22 18:31:59 -040080}