MainPage.xaml.h 4.34 KB
Newer Older
atraczyk's avatar
atraczyk committed
1
/**************************************************************************
Nicolas Jager's avatar
Nicolas Jager committed
2
3
* Copyright (C) 2016 by Savoir-faire Linux                                *
* Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com>              *
atraczyk's avatar
atraczyk committed
4
* Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com>          *
Nicolas Jager's avatar
Nicolas Jager committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
*                                                                         *
* 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/>.   *
**************************************************************************/
atraczyk's avatar
atraczyk committed
19
20
#pragma once

Nicolas Jager's avatar
Nicolas Jager committed
21
#include "MainPage.g.h"
22
#include "SmartPanelItem.h"
Nicolas Jager's avatar
Nicolas Jager committed
23
24

using namespace Windows::UI::Xaml::Input;
25
using namespace Windows::Foundation;
26
using namespace Windows::ApplicationModel::ExtendedExecution;
27
28
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::Networking::Connectivity;
Nicolas Jager's avatar
Nicolas Jager committed
29
30
31

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

33
34
35
36
37
38
enum class FrameOpen {
    WELCOME,
    MESSAGE,
    VIDEO
};

Nicolas Jager's avatar
Nicolas Jager committed
39
40
41
42
public ref class MainPage sealed
{
public:
    MainPage();
43

44
45
    void showLoadingOverlay(bool load, bool modal);
    void hideLoadingOverlay();
46
47
48
    void OnsetOverlayStatusText(String^ statusText, String^ color);
    void focusOnMessagingTextbox();
    void updateMessageTextPage(SmartPanelItem^ item);
49
50

    property bool isLoading;
atraczyk's avatar
atraczyk committed
51
    property bool isModal;
52
53
54
55
56
57
58
59
    property bool isSmartPanelOpen;

internal:
    property FrameOpen currentFrame {
        FrameOpen get() {
            return _currentFrame;
        }
    };
Nicolas Jager's avatar
Nicolas Jager committed
60
61

protected:
62
    virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
Nicolas Jager's avatar
Nicolas Jager committed
63
    virtual void OnKeyDown(KeyRoutedEventArgs^ e) override;
64
65
66

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

Nicolas Jager's avatar
Nicolas Jager committed
67
private:
68
    // Visibility and suspension
atraczyk's avatar
atraczyk committed
69
    void Application_Suspending(Object^, Windows::ApplicationModel::SuspendingEventArgs^ e);
70
    EventRegistrationToken applicationSuspendingEventToken;
atraczyk's avatar
atraczyk committed
71
    void Application_VisibilityChanged(Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
72
73
74
75
    EventRegistrationToken visibilityChangedEventToken;
    void Application_Resuming(Object^ sender, Object^ args);
    EventRegistrationToken applicationResumingEventToken;

76
77
    // Multi-monitor, DPI, scale factor change, and window resize detection
    void DisplayProperties_DpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
78
    EventRegistrationToken dpiChangedtoken;
79
    Rect bounds;
80
    FrameOpen _currentFrame;
Nicolas Jager's avatar
Nicolas Jager committed
81
    bool editionMode = false;
82

Nicolas Jager's avatar
Nicolas Jager committed
83
    void _toggleSmartBoxButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
84
    void setSmartPanelState(bool open);
Nicolas Jager's avatar
Nicolas Jager committed
85
    void showFrame(Windows::UI::Xaml::Controls::Frame^ frame);
Nicolas Jager's avatar
Nicolas Jager committed
86
    void OnsummonMessageTextPage();
87
    void OnFullScreenToggled(bool state);
Nicolas Jager's avatar
Nicolas Jager committed
88
    void OnsummonWelcomePage();
89
90
    void OnsummonPreviewPage();
    void OnhidePreviewPage();
Nicolas Jager's avatar
Nicolas Jager committed
91
92
    void OnsummonVideoPage();
    void OnpressHangUpCall();
93
    void OnstateChange(Platform::String ^callId, CallStatus state, int code);
94
    void OncloseMessageTextPage();
95
    void OnregistrationStateErrorGeneric(const std::string& accountId);
96
97
    void OnregistrationStateUnregistered(const std::string& accountId);
    void OnregistrationStateRegistered(const std::string& accountId);
98
    void OncallPlaced(Platform::String ^callId);
99
    void OnnameRegistred(bool status, String ^accountId);
100
    void OnvolatileDetailsChanged(const std::string &accountId, const std::map<std::string, std::string>& details);
Nicolas Jager's avatar
Nicolas Jager committed
101
};
atraczyk's avatar
atraczyk committed
102
}