2020-03-17 02:30:25 +00:00
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "winrt/Microsoft.ReactNative.h"
|
|
|
|
#include "NativeModules.h"
|
|
|
|
#include "ReactWebView.h"
|
|
|
|
|
|
|
|
namespace winrt::ReactNativeWebView::implementation {
|
|
|
|
|
|
|
|
class ReactWebViewManager : public winrt::implements<
|
|
|
|
ReactWebViewManager,
|
|
|
|
winrt::Microsoft::ReactNative::IViewManager,
|
|
|
|
winrt::Microsoft::ReactNative::IViewManagerWithReactContext,
|
|
|
|
winrt::Microsoft::ReactNative::IViewManagerWithNativeProperties,
|
|
|
|
winrt::Microsoft::ReactNative::IViewManagerWithExportedEventTypeConstants,
|
|
|
|
winrt::Microsoft::ReactNative::IViewManagerWithCommands> {
|
|
|
|
public:
|
|
|
|
ReactWebViewManager();
|
|
|
|
// IViewManager
|
|
|
|
winrt::hstring Name() noexcept;
|
|
|
|
winrt::Windows::UI::Xaml::FrameworkElement CreateView() noexcept;
|
|
|
|
|
|
|
|
// IViewManagerWithReactContext
|
|
|
|
winrt::Microsoft::ReactNative::IReactContext ReactContext() noexcept;
|
|
|
|
void ReactContext(winrt::Microsoft::ReactNative::IReactContext reactContext) noexcept;
|
|
|
|
|
|
|
|
// IViewManagerWithNativeProperties
|
|
|
|
winrt::Windows::Foundation::Collections::
|
|
|
|
IMapView<winrt::hstring, winrt::Microsoft::ReactNative::ViewManagerPropertyType>
|
|
|
|
NativeProps() noexcept;
|
|
|
|
|
|
|
|
void UpdateProperties(
|
|
|
|
winrt::Windows::UI::Xaml::FrameworkElement const& view,
|
|
|
|
winrt::Microsoft::ReactNative::IJSValueReader const& propertyMapReader) noexcept;
|
|
|
|
|
|
|
|
// IViewManagerWithExportedEventTypeConstants
|
|
|
|
winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomBubblingEventTypeConstants() noexcept;
|
|
|
|
winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomDirectEventTypeConstants() noexcept;
|
|
|
|
|
|
|
|
// IViewManagerWithCommands
|
2020-05-27 03:55:02 +00:00
|
|
|
winrt::Windows::Foundation::Collections::IVectorView<winrt::hstring> Commands() noexcept;
|
2020-03-17 02:30:25 +00:00
|
|
|
|
|
|
|
void DispatchCommand(
|
|
|
|
winrt::Windows::UI::Xaml::FrameworkElement const& view,
|
2020-05-27 03:55:02 +00:00
|
|
|
winrt::hstring const& commandId,
|
2020-03-17 02:30:25 +00:00
|
|
|
winrt::Microsoft::ReactNative::IJSValueReader const& commandArgsReader) noexcept;
|
|
|
|
|
|
|
|
private:
|
|
|
|
winrt::Microsoft::ReactNative::IReactContext m_reactContext{ nullptr };
|
|
|
|
|
|
|
|
};
|
|
|
|
} // namespace winrt::ReactWebView::implementation
|