// WARNING: Please don't edit this file. It was generated by Python/WinRT v3.2.1

#pragma once

#include "pybase.h"
static_assert(winrt::check_version(PYWINRT_VERSION, "3.2.1"), "Mismatched Py/WinRT headers.");
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Media.Animation.h>

#include <winrt/Windows.UI.Xaml.Navigation.h>

namespace py::proj::Windows::UI::Xaml::Navigation
{
}

namespace py
{
    template<>
    inline constexpr const char* buffer_format<winrt::Windows::UI::Xaml::Navigation::NavigationCacheMode> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::UI::Xaml::Navigation::NavigationMode> = "i";


    template<>
    struct py_type<winrt::Windows::UI::Xaml::Navigation::NavigationCacheMode>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.navigation.NavigationCacheMode";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.navigation";
        static constexpr const char* type_name = "NavigationCacheMode";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Navigation::NavigationMode>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.navigation.NavigationMode";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.navigation";
        static constexpr const char* type_name = "NavigationMode";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Navigation::FrameNavigationOptions>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.navigation.FrameNavigationOptions";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.navigation";
        static constexpr const char* type_name = "FrameNavigationOptions";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.navigation.NavigatingCancelEventArgs";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.navigation";
        static constexpr const char* type_name = "NavigatingCancelEventArgs";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.navigation.NavigationEventArgs";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.navigation";
        static constexpr const char* type_name = "NavigationEventArgs";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Navigation::NavigationFailedEventArgs>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.navigation.NavigationFailedEventArgs";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.navigation";
        static constexpr const char* type_name = "NavigationFailedEventArgs";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Navigation::PageStackEntry>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.navigation.PageStackEntry";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.navigation";
        static constexpr const char* type_name = "PageStackEntry";
    };
}

#if __has_include("py.Windows.Foundation.h")
#include "py.Windows.Foundation.h"
#endif

#if __has_include("py.Windows.UI.Xaml.h")
#include "py.Windows.UI.Xaml.h"
#endif

#if __has_include("py.Windows.UI.Xaml.Interop.h")
#include "py.Windows.UI.Xaml.Interop.h"
#endif

#if __has_include("py.Windows.UI.Xaml.Media.Animation.h")
#include "py.Windows.UI.Xaml.Media.Animation.h"
#endif

namespace py::impl::Windows::UI::Xaml::Navigation
{
    struct LoadCompletedEventHandler
    {
        static winrt::Windows::UI::Xaml::Navigation::LoadCompletedEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Foundation::IInspectable const& param0, winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };

    struct NavigatedEventHandler
    {
        static winrt::Windows::UI::Xaml::Navigation::NavigatedEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Foundation::IInspectable const& param0, winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };

    struct NavigatingCancelEventHandler
    {
        static winrt::Windows::UI::Xaml::Navigation::NavigatingCancelEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Foundation::IInspectable const& param0, winrt::Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };

    struct NavigationFailedEventHandler
    {
        static winrt::Windows::UI::Xaml::Navigation::NavigationFailedEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Foundation::IInspectable const& param0, winrt::Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };

    struct NavigationStoppedEventHandler
    {
        static winrt::Windows::UI::Xaml::Navigation::NavigationStoppedEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Foundation::IInspectable const& param0, winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };
}

namespace py::wrapper::Windows::UI::Xaml::Navigation
{
    using FrameNavigationOptions = py::winrt_wrapper<winrt::Windows::UI::Xaml::Navigation::FrameNavigationOptions>;
    using NavigatingCancelEventArgs = py::winrt_wrapper<winrt::Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs>;
    using NavigationEventArgs = py::winrt_wrapper<winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs>;
    using NavigationFailedEventArgs = py::winrt_wrapper<winrt::Windows::UI::Xaml::Navigation::NavigationFailedEventArgs>;
    using PageStackEntry = py::winrt_wrapper<winrt::Windows::UI::Xaml::Navigation::PageStackEntry>;
}

namespace py
{
    template <>
    struct delegate_python_type<winrt::Windows::UI::Xaml::Navigation::LoadCompletedEventHandler>
    {
        using type = py::impl::Windows::UI::Xaml::Navigation::LoadCompletedEventHandler;
    };

    template <>
    struct delegate_python_type<winrt::Windows::UI::Xaml::Navigation::NavigatedEventHandler>
    {
        using type = py::impl::Windows::UI::Xaml::Navigation::NavigatedEventHandler;
    };

    template <>
    struct delegate_python_type<winrt::Windows::UI::Xaml::Navigation::NavigatingCancelEventHandler>
    {
        using type = py::impl::Windows::UI::Xaml::Navigation::NavigatingCancelEventHandler;
    };

    template <>
    struct delegate_python_type<winrt::Windows::UI::Xaml::Navigation::NavigationFailedEventHandler>
    {
        using type = py::impl::Windows::UI::Xaml::Navigation::NavigationFailedEventHandler;
    };

    template <>
    struct delegate_python_type<winrt::Windows::UI::Xaml::Navigation::NavigationStoppedEventHandler>
    {
        using type = py::impl::Windows::UI::Xaml::Navigation::NavigationStoppedEventHandler;
    };

}
