1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/windows/winrt/MetroApp.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#pragma once 1.10 + 1.11 +#include "mozwrlbase.h" 1.12 + 1.13 +#include <windows.system.h> 1.14 +#include <windows.ui.core.h> 1.15 +#include <Windows.ApplicationModel.core.h> 1.16 +#include <Windows.ApplicationModel.h> 1.17 +#include <Windows.Applicationmodel.Activation.h> 1.18 + 1.19 +class MetroWidget; 1.20 + 1.21 +namespace mozilla { 1.22 +namespace widget { 1.23 +namespace winrt { 1.24 + 1.25 +class MetroApp : public Microsoft::WRL::RuntimeClass<ABI::Windows::ApplicationModel::Core::IFrameworkViewSource> 1.26 +{ 1.27 + InspectableClass(L"MetroApp", TrustLevel::BaseTrust) 1.28 + 1.29 + typedef ABI::Windows::UI::Core::CoreDispatcherPriority CoreDispatcherPriority; 1.30 + typedef ABI::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs LaunchActivatedEventArgs; 1.31 + typedef ABI::Windows::ApplicationModel::ISuspendingEventArgs ISuspendingEventArgs; 1.32 + typedef ABI::Windows::ApplicationModel::Core::IFrameworkView IFrameworkView; 1.33 + typedef ABI::Windows::ApplicationModel::Core::ICoreApplication ICoreApplication; 1.34 + 1.35 +public: 1.36 + // IFrameworkViewSource 1.37 + STDMETHODIMP CreateView(IFrameworkView **viewProvider); 1.38 + 1.39 + // ICoreApplication event 1.40 + HRESULT OnSuspending(IInspectable* aSender, ISuspendingEventArgs* aArgs); 1.41 + HRESULT OnResuming(IInspectable* aSender, IInspectable* aArgs); 1.42 + 1.43 + // nsIWinMetroUtils tile related async callbacks 1.44 + HRESULT OnAsyncTileCreated(ABI::Windows::Foundation::IAsyncOperation<bool>* aOperation, AsyncStatus aStatus); 1.45 + 1.46 + void Run(); 1.47 + void CoreExit(); 1.48 + void Shutdown(); 1.49 + void ActivateBaseView(); 1.50 + 1.51 + // Set when gecko enters xpcom shutdown. 1.52 + static bool sGeckoShuttingDown; 1.53 + 1.54 + // Shared pointers between framework and widget 1.55 + void SetWidget(MetroWidget* aPtr); 1.56 + 1.57 + static void PostSuspendResumeProcessNotification(bool aIsSuspend); 1.58 + static void PostSleepWakeNotification(bool aIsSuspend); 1.59 + 1.60 +private: 1.61 + EventRegistrationToken mSuspendEvent; 1.62 + EventRegistrationToken mResumeEvent; 1.63 +}; 1.64 + 1.65 +} } }