//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PBackgroundLSSimpleRequest_h
#define PBackgroundLSSimpleRequest_h

#include "mozilla/Attributes.h"
#include "IPCMessageStart.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "mozilla/MozPromise.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/ipc/ByteBuf.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "mozilla/ipc/IPCForwards.h"
#include "mozilla/ipc/Shmem.h"

// Headers for typedefs
#include "mozilla/ipc/IPDLStructMember.h"
#include "mozilla/dom/PBackgroundLSSharedTypes.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct LSSimpleRequestPreloadedResponse|
//
namespace mozilla {
namespace dom {
class LSSimpleRequestPreloadedResponse final
{
private:

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    LSSimpleRequestPreloadedResponse() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT LSSimpleRequestPreloadedResponse(const bool& _preloaded) :
        preloaded_(_preloaded)
    {
    }

    MOZ_IMPLICIT LSSimpleRequestPreloadedResponse(bool&& _preloaded) :
        preloaded_(std::move(_preloaded))
    {
    }

    bool&
    preloaded()
    {
        return preloaded_;
    }
    const bool&
    preloaded() const
    {
        return preloaded_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<bool> preloaded_;
};
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::LSSimpleRequestPreloadedResponse>
{
    typedef ::mozilla::dom::LSSimpleRequestPreloadedResponse paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct LSSimpleRequestGetStateResponse|
//
namespace mozilla {
namespace dom {
class LSSimpleRequestGetStateResponse final
{
private:
    typedef ::mozilla::dom::LSItemInfo LSItemInfo;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    LSSimpleRequestGetStateResponse() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT LSSimpleRequestGetStateResponse(const nsTArray<LSItemInfo>& _itemInfos) :
        itemInfos_(_itemInfos)
    {
    }

    MOZ_IMPLICIT LSSimpleRequestGetStateResponse(nsTArray<LSItemInfo>&& _itemInfos) :
        itemInfos_(std::move(_itemInfos))
    {
    }

    nsTArray<LSItemInfo>&
    itemInfos()
    {
        return itemInfos_;
    }
    const nsTArray<LSItemInfo>&
    itemInfos() const
    {
        return itemInfos_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<CopyableTArray<LSItemInfo>> itemInfos_;
};
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::LSSimpleRequestGetStateResponse>
{
    typedef ::mozilla::dom::LSSimpleRequestGetStateResponse paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union LSSimpleRequestResponse|
//
namespace mozilla {
namespace dom {
class LSSimpleRequestResponse final
{
public:
    enum Type {
        T__None,
        Tnsresult = 1,
        TLSSimpleRequestPreloadedResponse,
        TLSSimpleRequestGetStateResponse,
        T__Last = TLSSimpleRequestGetStateResponse
    };

private:
    typedef ::nsresult nsresult;
    typedef ::mozilla::dom::LSSimpleRequestPreloadedResponse LSSimpleRequestPreloadedResponse;
    typedef ::mozilla::dom::LSSimpleRequestGetStateResponse LSSimpleRequestGetStateResponse;
    typedef nsresult nsresult__tdef;
    typedef LSSimpleRequestPreloadedResponse LSSimpleRequestPreloadedResponse__tdef;
    typedef LSSimpleRequestGetStateResponse LSSimpleRequestGetStateResponse__tdef;

    nsresult*
    ptr_nsresult()
    {
        return (&(mVnsresult));
    }
    const nsresult*
    constptr_nsresult() const
    {
        return (&(mVnsresult));
    }
    LSSimpleRequestPreloadedResponse*
    ptr_LSSimpleRequestPreloadedResponse()
    {
        return (&(mVLSSimpleRequestPreloadedResponse));
    }
    const LSSimpleRequestPreloadedResponse*
    constptr_LSSimpleRequestPreloadedResponse() const
    {
        return (&(mVLSSimpleRequestPreloadedResponse));
    }
    LSSimpleRequestGetStateResponse*
    ptr_LSSimpleRequestGetStateResponse()
    {
        return (&(mVLSSimpleRequestGetStateResponse));
    }
    const LSSimpleRequestGetStateResponse*
    constptr_LSSimpleRequestGetStateResponse() const
    {
        return (&(mVLSSimpleRequestGetStateResponse));
    }

    void
    MaybeDestroy();

    void
    AssertSanity() const
    {
        MOZ_RELEASE_ASSERT((T__None) <= (mType), "invalid type tag");
        MOZ_RELEASE_ASSERT((mType) <= (T__Last), "invalid type tag");
    }
    void
    AssertSanity(Type aType) const
    {
        AssertSanity();
        MOZ_RELEASE_ASSERT((mType) == (aType), "unexpected type tag");
    }

public:
    MOZ_IMPLICIT LSSimpleRequestResponse() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT LSSimpleRequestResponse(const nsresult& aOther);

    MOZ_IMPLICIT LSSimpleRequestResponse(nsresult&& aOther);

    MOZ_IMPLICIT LSSimpleRequestResponse(const LSSimpleRequestPreloadedResponse& aOther);

    MOZ_IMPLICIT LSSimpleRequestResponse(LSSimpleRequestPreloadedResponse&& aOther);

    MOZ_IMPLICIT LSSimpleRequestResponse(const LSSimpleRequestGetStateResponse& aOther);

    MOZ_IMPLICIT LSSimpleRequestResponse(LSSimpleRequestGetStateResponse&& aOther);

    MOZ_IMPLICIT LSSimpleRequestResponse(const LSSimpleRequestResponse& aOther);

    MOZ_IMPLICIT LSSimpleRequestResponse(LSSimpleRequestResponse&& aOther);

    ~LSSimpleRequestResponse();

    Type
    type() const
    {
        return mType;
    }

    LSSimpleRequestResponse&
    operator=(const nsresult& aRhs);

    LSSimpleRequestResponse&
    operator=(nsresult&& aRhs);

    LSSimpleRequestResponse&
    operator=(const LSSimpleRequestPreloadedResponse& aRhs);

    LSSimpleRequestResponse&
    operator=(LSSimpleRequestPreloadedResponse&& aRhs);

    LSSimpleRequestResponse&
    operator=(const LSSimpleRequestGetStateResponse& aRhs);

    LSSimpleRequestResponse&
    operator=(LSSimpleRequestGetStateResponse&& aRhs);

    LSSimpleRequestResponse&
    operator=(const LSSimpleRequestResponse& aRhs);

    LSSimpleRequestResponse&
    operator=(LSSimpleRequestResponse&& aRhs);

    nsresult&
    get_nsresult()
    {
        AssertSanity(Tnsresult);
        return (*(ptr_nsresult()));
    }
    const nsresult&
    get_nsresult() const
    {
        AssertSanity(Tnsresult);
        return (*(constptr_nsresult()));
    }
    operator nsresult&()
    {
        return get_nsresult();
    }
    operator const nsresult&() const
    {
        return get_nsresult();
    }

    LSSimpleRequestPreloadedResponse&
    get_LSSimpleRequestPreloadedResponse()
    {
        AssertSanity(TLSSimpleRequestPreloadedResponse);
        return (*(ptr_LSSimpleRequestPreloadedResponse()));
    }
    const LSSimpleRequestPreloadedResponse&
    get_LSSimpleRequestPreloadedResponse() const
    {
        AssertSanity(TLSSimpleRequestPreloadedResponse);
        return (*(constptr_LSSimpleRequestPreloadedResponse()));
    }
    operator LSSimpleRequestPreloadedResponse&()
    {
        return get_LSSimpleRequestPreloadedResponse();
    }
    operator const LSSimpleRequestPreloadedResponse&() const
    {
        return get_LSSimpleRequestPreloadedResponse();
    }

    LSSimpleRequestGetStateResponse&
    get_LSSimpleRequestGetStateResponse()
    {
        AssertSanity(TLSSimpleRequestGetStateResponse);
        return (*(ptr_LSSimpleRequestGetStateResponse()));
    }
    const LSSimpleRequestGetStateResponse&
    get_LSSimpleRequestGetStateResponse() const
    {
        AssertSanity(TLSSimpleRequestGetStateResponse);
        return (*(constptr_LSSimpleRequestGetStateResponse()));
    }
    operator LSSimpleRequestGetStateResponse&()
    {
        return get_LSSimpleRequestGetStateResponse();
    }
    operator const LSSimpleRequestGetStateResponse&() const
    {
        return get_LSSimpleRequestGetStateResponse();
    }

private:
    union {
        nsresult mVnsresult;
        LSSimpleRequestPreloadedResponse mVLSSimpleRequestPreloadedResponse;
        LSSimpleRequestGetStateResponse mVLSSimpleRequestGetStateResponse;
    };
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::LSSimpleRequestResponse>
{
    typedef ::mozilla::dom::LSSimpleRequestResponse paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC

namespace mozilla {
namespace dom {
class PBackgroundLSSimpleRequestParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PBackgroundLSSimpleRequestChild;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PBackgroundLSSimpleRequestChild and PBackgroundLSSimpleRequestParent
//
namespace mozilla {
namespace dom {
namespace PBackgroundLSSimpleRequest {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::dom::PBackgroundLSSimpleRequestParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::PBackgroundLSSimpleRequestChild>* aChild);

enum MessageType {
    PBackgroundLSSimpleRequestStart = PBackgroundLSSimpleRequestMsgStart << 16,
    Msg___delete____ID,
    Reply___delete____ID,
    PBackgroundLSSimpleRequestEnd
};

mozilla::UniquePtr<IPC::Message>
Msg___delete__(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply___delete__(IPC::Message::routeid_t routingId);



} // namespace PBackgroundLSSimpleRequest
} // namespace dom
} // namespace mozilla

#endif // ifndef PBackgroundLSSimpleRequest_h
