MainPage.xaml.h 3.57 KB
Newer Older
Nicolas Jager's avatar
Nicolas Jager committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#pragma once
/**************************************************************************
* Copyright (C) 2016 by Savoir-faire Linux                                *
* Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com>              *
*                                                                         *
* This program is free software; you can redistribute it and/or modify    *
* it under the terms of the GNU General Public License as published by    *
* the Free Software Foundation; either version 3 of the License, or       *
* (at your option) any later version.                                     *
*                                                                         *
* This program is distributed in the hope that it will be useful,         *
* but WITHOUT ANY WARRANTY; without even the implied warranty of          *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
* GNU General Public License for more details.                            *
*                                                                         *
* You should have received a copy of the GNU General Public License       *
* along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
**************************************************************************/
#include "MainPage.g.h"

21
using namespace Windows::UI::Xaml::Controls;
Nicolas Jager's avatar
Nicolas Jager committed
22
using namespace Windows::UI::Xaml::Input;
23
using namespace Windows::Foundation;
24
using namespace Windows::ApplicationModel::ExtendedExecution;
Nicolas Jager's avatar
Nicolas Jager committed
25 26 27

namespace RingClientUWP
{
Nicolas Jager's avatar
Nicolas Jager committed
28

Nicolas Jager's avatar
Nicolas Jager committed
29 30 31 32 33 34
namespace Views {
}
public ref class MainPage sealed
{
public:
    MainPage();
35 36 37 38
    void showLoadingOverlay(bool load, bool modal);
    void hideLoadingOverlay();

    property bool isLoading;
Nicolas Jager's avatar
Nicolas Jager committed
39 40

protected:
41
    virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
Nicolas Jager's avatar
Nicolas Jager committed
42
    virtual void OnKeyDown(KeyRoutedEventArgs^ e) override;
43 44 45 46 47

    void PositionImage();
    void PositionRing();
    void OnResize(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e);

Nicolas Jager's avatar
Nicolas Jager committed
48
private:
49
    // Visibility and suspension
atraczyk's avatar
atraczyk committed
50
    void Application_Suspending(Object^, Windows::ApplicationModel::SuspendingEventArgs^ e);
51
    EventRegistrationToken applicationSuspendingEventToken;
atraczyk's avatar
atraczyk committed
52
    void Application_VisibilityChanged(Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
53 54 55 56 57 58 59 60 61 62 63
    EventRegistrationToken visibilityChangedEventToken;
    void Application_Resuming(Object^ sender, Object^ args);
    EventRegistrationToken applicationResumingEventToken;
    //void Application_Closing(Object^ sender, Windows::UI::Core::^ e);
    //EventRegistrationToken applicationClosingEventToken;

    ExtendedExecutionSession^ session;
    void SessionRevoked(Object^ sender, ExtendedExecutionRevokedEventArgs^ args);
    EventRegistrationToken sessionRevokedToken;
    task<void> BeginExtendedExecution();
    void ClearExtendedExecution();
atraczyk's avatar
atraczyk committed
64

65 66
    // Multi-monitor, DPI, scale factor change, and window resize detection
    void DisplayProperties_DpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
67
    EventRegistrationToken dpiChangedtoken;
68 69
    Rect bounds;

Nicolas Jager's avatar
Nicolas Jager committed
70
    void _toggleSmartBoxButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
71
    void showFrame(Windows::UI::Xaml::Controls::Frame^ frame);
Nicolas Jager's avatar
Nicolas Jager committed
72 73 74 75
    void OnsummonMessageTextPage();
    void OnsummonWelcomePage();
    void OnsummonVideoPage();
    void OnpressHangUpCall();
76
    void OnstateChange(Platform::String ^callId, CallStatus state, int code);
77
    void OncloseMessageTextPage();
Nicolas Jager's avatar
Nicolas Jager committed
78
};
atraczyk's avatar
atraczyk committed
79
}