michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #pragma once michael@0: michael@0: #include "mozwrlbase.h" michael@0: michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: michael@0: class MetroWidget; michael@0: michael@0: namespace mozilla { michael@0: namespace widget { michael@0: namespace winrt { michael@0: michael@0: class MetroApp : public Microsoft::WRL::RuntimeClass michael@0: { michael@0: InspectableClass(L"MetroApp", TrustLevel::BaseTrust) michael@0: michael@0: typedef ABI::Windows::UI::Core::CoreDispatcherPriority CoreDispatcherPriority; michael@0: typedef ABI::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs LaunchActivatedEventArgs; michael@0: typedef ABI::Windows::ApplicationModel::ISuspendingEventArgs ISuspendingEventArgs; michael@0: typedef ABI::Windows::ApplicationModel::Core::IFrameworkView IFrameworkView; michael@0: typedef ABI::Windows::ApplicationModel::Core::ICoreApplication ICoreApplication; michael@0: michael@0: public: michael@0: // IFrameworkViewSource michael@0: STDMETHODIMP CreateView(IFrameworkView **viewProvider); michael@0: michael@0: // ICoreApplication event michael@0: HRESULT OnSuspending(IInspectable* aSender, ISuspendingEventArgs* aArgs); michael@0: HRESULT OnResuming(IInspectable* aSender, IInspectable* aArgs); michael@0: michael@0: // nsIWinMetroUtils tile related async callbacks michael@0: HRESULT OnAsyncTileCreated(ABI::Windows::Foundation::IAsyncOperation* aOperation, AsyncStatus aStatus); michael@0: michael@0: void Run(); michael@0: void CoreExit(); michael@0: void Shutdown(); michael@0: void ActivateBaseView(); michael@0: michael@0: // Set when gecko enters xpcom shutdown. michael@0: static bool sGeckoShuttingDown; michael@0: michael@0: // Shared pointers between framework and widget michael@0: void SetWidget(MetroWidget* aPtr); michael@0: michael@0: static void PostSuspendResumeProcessNotification(bool aIsSuspend); michael@0: static void PostSleepWakeNotification(bool aIsSuspend); michael@0: michael@0: private: michael@0: EventRegistrationToken mSuspendEvent; michael@0: EventRegistrationToken mResumeEvent; michael@0: }; michael@0: michael@0: } } }