//
// Copyright (c) Microsoft Corporation. All rights reserved.
// 
//
// File generated by WinMDIDL version 8.00.0008
//

import "inspectable.idl";
import "AsyncInfo.idl";
import "EventToken.idl";
import "Windows.Foundation.idl";
import "Windows.Networking.Sockets.idl";
import "Windows.Storage.Streams.idl";
// Additional imports to ensure that all required headers are included
cpp_quote("#if defined(__cplusplus)")
cpp_quote("}")
cpp_quote("#endif // defined(__cplusplus)")
cpp_quote("#include <Windows.Foundation.h>")
cpp_quote("#if !defined(__windows2Enetworking2Esockets_h__)")
cpp_quote("#include <Windows.Networking.Sockets.h>")
cpp_quote("#endif // !defined(__windows2Enetworking2Esockets_h__)")
cpp_quote("#if !defined(__windows2Estorage2Estreams_h__)")
cpp_quote("#include <Windows.Storage.Streams.h>")
cpp_quote("#endif // !defined(__windows2Estorage2Estreams_h__)")
cpp_quote("#if defined(__cplusplus)")
cpp_quote("extern \"C\" {")
cpp_quote("#endif // defined(__cplusplus)")

// Forward Declare
namespace Windows
{
    namespace Foundation
    {
        runtimeclass Uri;
    }
}
namespace Windows
{
    namespace Networking
    {
        namespace Sockets
        {
            runtimeclass StreamSocket;
        }
    }
}
namespace Windows
{
    namespace Storage
    {
        namespace Streams
        {
            interface IBuffer;
        }
    }
}
namespace Windows
{
    namespace Networking
    {
        namespace Proximity
        {
            typedef enum TriggeredConnectState TriggeredConnectState;

            typedef enum PeerDiscoveryTypes PeerDiscoveryTypes;

            delegate MessageReceivedHandler;

            delegate MessageTransmittedHandler;

            delegate DeviceArrivedEventHandler;

            delegate DeviceDepartedEventHandler;

            interface IProximityMessage;

            interface IProximityDevice;

            interface IProximityDeviceStatics;

            interface ITriggeredConnectionStateChangedEventArgs;

            interface IPeerInformation;

            interface IConnectionRequestedEventArgs;

            interface IPeerFinderStatics;

            runtimeclass ProximityMessage;

            runtimeclass ProximityDevice;

            runtimeclass TriggeredConnectionStateChangedEventArgs;

            runtimeclass PeerInformation;

            runtimeclass ConnectionRequestedEventArgs;

            runtimeclass PeerFinder;
        }
    }
}

// Generic instantiations
namespace Windows
{
    namespace Networking
    {
        namespace Proximity
        {
            declare
            {
                interface Windows.Foundation.Collections.IIterable<Windows.Networking.Proximity.PeerInformation*>;

                interface Windows.Foundation.Collections.IIterator<Windows.Networking.Proximity.PeerInformation*>;

                interface Windows.Foundation.Collections.IVectorView<Windows.Networking.Proximity.PeerInformation*>;

                interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Networking.Proximity.PeerInformation*>*>;

                interface Windows.Foundation.TypedEventHandler<IInspectable*, Windows.Networking.Proximity.ConnectionRequestedEventArgs*>;

                interface Windows.Foundation.TypedEventHandler<IInspectable*, Windows.Networking.Proximity.TriggeredConnectionStateChangedEventArgs*>;
            }
        }
    }
}

// Type definition
namespace Windows
{
    namespace Networking
    {
        namespace Proximity
        {
            [version(0x06020000)]
            enum TriggeredConnectState
            {
                PeerFound  = 0,
                Listening  = 1,
                Connecting = 2,
                Completed  = 3,
                Canceled   = 4,
                Failed     = 5
            };

            [flags]
            [version(0x06020000)]
            enum PeerDiscoveryTypes
            {
                None      = 0x0,
                Browse    = 0x1,
                Triggered = 0x2
            };

            [uuid(EFAB0782-F6E2-4675-A045-D8E320C24808)]
            [version(0x06020000)]
            delegate
                HRESULT MessageReceivedHandler([in] Windows.Networking.Proximity.ProximityDevice* sender, [in] Windows.Networking.Proximity.ProximityMessage* message);

            [uuid(EFAA0B4A-F6E2-4D7D-856C-78FC8EFC021E)]
            [version(0x06020000)]
            delegate
                HRESULT MessageTransmittedHandler([in] Windows.Networking.Proximity.ProximityDevice* sender, [in] INT64 messageId);

            [uuid(EFA9DA69-F6E1-49C9-A49E-8E0FC58FB911)]
            [version(0x06020000)]
            delegate
                HRESULT DeviceArrivedEventHandler([in] Windows.Networking.Proximity.ProximityDevice* sender);

            [uuid(EFA9DA69-F6E2-49C9-A49E-8E0FC58FB911)]
            [version(0x06020000)]
            delegate
                HRESULT DeviceDepartedEventHandler([in] Windows.Networking.Proximity.ProximityDevice* sender);

            [uuid(EFAB0782-F6E1-4675-A045-D8E320C24808)]
            [exclusiveto(Windows.Networking.Proximity.ProximityMessage)]
            [version(0x06020000)]
            interface IProximityMessage : IInspectable
            {
                [propget] HRESULT MessageType([out] [retval] HSTRING* value);
                [propget] HRESULT SubscriptionId([out] [retval] INT64* value);
                [propget] HRESULT Data([out] [retval] Windows.Storage.Streams.IBuffer** value);
                [propget] HRESULT DataAsString([out] [retval] HSTRING* value);
            }

            [uuid(EFA8A552-F6E1-4329-A0FC-AB6B0FD28262)]
            [version(0x06020000)]
            [exclusiveto(Windows.Networking.Proximity.ProximityDevice)]
            interface IProximityDevice : IInspectable
            {
                HRESULT SubscribeForMessage([in] HSTRING messageType, [in] Windows.Networking.Proximity.MessageReceivedHandler* messageReceivedHandler, [out] [retval] INT64* subscriptionId);
                [overload("PublishMessage")] HRESULT PublishMessage([in] HSTRING messageType, [in] HSTRING message, [out] [retval] INT64* messageId);
                [overload("PublishMessage")] HRESULT PublishMessageWithCallback([in] HSTRING messageType, [in] HSTRING message, [in] Windows.Networking.Proximity.MessageTransmittedHandler* messageTransmittedHandler, [out] [retval] INT64* messageId);
                [overload("PublishBinaryMessage")] HRESULT PublishBinaryMessage([in] HSTRING messageType, [in] Windows.Storage.Streams.IBuffer* message, [out] [retval] INT64* messageId);
                [overload("PublishBinaryMessage")] HRESULT PublishBinaryMessageWithCallback([in] HSTRING messageType, [in] Windows.Storage.Streams.IBuffer* message, [in] Windows.Networking.Proximity.MessageTransmittedHandler* messageTransmittedHandler, [out] [retval] INT64* messageId);
                [overload("PublishUriMessage")] HRESULT PublishUriMessage([in] Windows.Foundation.Uri* message, [out] [retval] INT64* messageId);
                [overload("PublishUriMessage")] HRESULT PublishUriMessageWithCallback([in] Windows.Foundation.Uri* message, [in] Windows.Networking.Proximity.MessageTransmittedHandler* messageTransmittedHandler, [out] [retval] INT64* messageId);
                HRESULT StopSubscribingForMessage([in] INT64 subscriptionId);
                HRESULT StopPublishingMessage([in] INT64 messageId);
                [eventadd] HRESULT DeviceArrived([in] Windows.Networking.Proximity.DeviceArrivedEventHandler* arrivedHandler, [out] [retval] EventRegistrationToken* cookie);
                [eventremove] HRESULT DeviceArrived([in] EventRegistrationToken cookie);
                [eventadd] HRESULT DeviceDeparted([in] Windows.Networking.Proximity.DeviceDepartedEventHandler* departedHandler, [out] [retval] EventRegistrationToken* cookie);
                [eventremove] HRESULT DeviceDeparted([in] EventRegistrationToken cookie);
                [propget] HRESULT MaxMessageBytes([out] [retval] UINT32* value);
                [propget] HRESULT BitsPerSecond([out] [retval] UINT64* value);
                [propget] HRESULT DeviceId([out] [retval] HSTRING* value);
            }

            [uuid(914BA01D-F6E1-47C4-A14C-148A1903D0C6)]
            [version(0x06020000)]
            [exclusiveto(Windows.Networking.Proximity.ProximityDevice)]
            interface IProximityDeviceStatics : IInspectable
            {
                HRESULT GetDeviceSelector([out] [retval] HSTRING* selector);
                HRESULT GetDefault([out] [retval] Windows.Networking.Proximity.ProximityDevice** proximityDevice);
                HRESULT FromId([in] HSTRING deviceInterfaceId, [out] [retval] Windows.Networking.Proximity.ProximityDevice** proximityDevice);
            }

            [uuid(C6A780AD-F6E1-4D54-96E2-33F620BCA88A)]
            [version(0x06020000)]
            [exclusiveto(Windows.Networking.Proximity.TriggeredConnectionStateChangedEventArgs)]
            interface ITriggeredConnectionStateChangedEventArgs : IInspectable
            {
                [propget] HRESULT State([out] [retval] Windows.Networking.Proximity.TriggeredConnectState* value);
                [propget] HRESULT Id([out] [retval] UINT32* value);
                [propget] HRESULT Socket([out] [retval] Windows.Networking.Sockets.StreamSocket** value);
            }

            [uuid(20024F08-9FFF-45F4-B6E9-408B2EBEF373)]
            [exclusiveto(Windows.Networking.Proximity.PeerInformation)]
            [version(0x06020000)]
            interface IPeerInformation : IInspectable
            {
                [propget] HRESULT DisplayName([out] [retval] HSTRING* value);
            }

            [uuid(EB6891AE-4F1E-4C66-BD0D-46924A942E08)]
            [exclusiveto(Windows.Networking.Proximity.ConnectionRequestedEventArgs)]
            [version(0x06020000)]
            interface IConnectionRequestedEventArgs : IInspectable
            {
                [propget] HRESULT PeerInformation([out] [retval] Windows.Networking.Proximity.PeerInformation** value);
            }

            [uuid(914B3B61-F6E1-47C4-A14C-148A1903D0C6)]
            [version(0x06020000)]
            [exclusiveto(Windows.Networking.Proximity.PeerFinder)]
            interface IPeerFinderStatics : IInspectable
            {
                [propget] HRESULT AllowBluetooth([out] [retval] boolean* value);
                [propput] HRESULT AllowBluetooth([in] boolean value);
                [propget] HRESULT AllowInfrastructure([out] [retval] boolean* value);
                [propput] HRESULT AllowInfrastructure([in] boolean value);
                [propget] HRESULT AllowWiFiDirect([out] [retval] boolean* value);
                [propput] HRESULT AllowWiFiDirect([in] boolean value);
                [propget] HRESULT DisplayName([out] [retval] HSTRING* value);
                [propput] HRESULT DisplayName([in] HSTRING value);
                [propget] HRESULT SupportedDiscoveryTypes([out] [retval] Windows.Networking.Proximity.PeerDiscoveryTypes* value);
                [propget] HRESULT AlternateIdentities([out] [retval] Windows.Foundation.Collections.IMap<HSTRING, HSTRING>** value);
                [overload("Start")] HRESULT Start();
                [overload("Start")] HRESULT StartWithMessage([in] HSTRING peerMessage);
                HRESULT Stop();
                [eventadd] HRESULT TriggeredConnectionStateChanged([in] Windows.Foundation.TypedEventHandler<IInspectable*, Windows.Networking.Proximity.TriggeredConnectionStateChangedEventArgs*>* handler, [out] [retval] EventRegistrationToken* cookie);
                [eventremove] HRESULT TriggeredConnectionStateChanged([in] EventRegistrationToken cookie);
                [eventadd] HRESULT ConnectionRequested([in] Windows.Foundation.TypedEventHandler<IInspectable*, Windows.Networking.Proximity.ConnectionRequestedEventArgs*>* handler, [out] [retval] EventRegistrationToken* cookie);
                [eventremove] HRESULT ConnectionRequested([in] EventRegistrationToken cookie);
                HRESULT FindAllPeersAsync([out] [retval] Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Networking.Proximity.PeerInformation*>*>** asyncOp);
                HRESULT ConnectAsync([in] Windows.Networking.Proximity.PeerInformation* peerInformation, [out] [retval] Windows.Foundation.IAsyncOperation<Windows.Networking.Sockets.StreamSocket*>** asyncOp);
            }

            [marshaling_behavior(agile)]
            [version(0x06020000)]
            runtimeclass ProximityMessage
            {
                [default] interface Windows.Networking.Proximity.IProximityMessage;
            }

            [threading(both)]
            [version(0x06020000)]
            [marshaling_behavior(agile)]
            [static(Windows.Networking.Proximity.IProximityDeviceStatics, 0x06020000)]
            runtimeclass ProximityDevice
            {
                [default] interface Windows.Networking.Proximity.IProximityDevice;
            }

            [marshaling_behavior(agile)]
            [version(0x06020000)]
            runtimeclass TriggeredConnectionStateChangedEventArgs
            {
                [default] interface Windows.Networking.Proximity.ITriggeredConnectionStateChangedEventArgs;
            }

            [marshaling_behavior(agile)]
            [version(0x06020000)]
            runtimeclass PeerInformation
            {
                [default] interface Windows.Networking.Proximity.IPeerInformation;
            }

            [version(0x06020000)]
            [marshaling_behavior(agile)]
            runtimeclass ConnectionRequestedEventArgs
            {
                [default] interface Windows.Networking.Proximity.IConnectionRequestedEventArgs;
            }

            [static(Windows.Networking.Proximity.IPeerFinderStatics, 0x06020000)]
            [threading(both)]
            [version(0x06020000)]
            [marshaling_behavior(agile)]
            runtimeclass PeerFinder
            {
            }
        }
    }
}
