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

import "inspectable.idl";
import "AsyncInfo.idl";
import "EventToken.idl";
import "windowscontracts.idl";
import "Windows.Foundation.idl";
import "Windows.Networking.idl";
import "Windows.Networking.Sockets.idl";
import "Windows.Storage.Streams.idl";

// Forward Declare
namespace Windows
{
    namespace Foundation
    {
        apicontract UniversalApiContract;

        runtimeclass Uri;
    }
}
namespace Windows
{
    namespace Networking
    {
        runtimeclass HostName;
    }
}
namespace Windows
{
    namespace Networking
    {
        namespace Sockets
        {
            runtimeclass StreamSocket;
        }
    }
}
namespace Windows
{
    namespace Storage
    {
        namespace Streams
        {
            interface IBuffer;
        }
    }
}
namespace Windows
{
    namespace Networking
    {
        namespace Proximity
        {
            typedef enum PeerDiscoveryTypes PeerDiscoveryTypes;

            typedef enum PeerRole PeerRole;

            typedef enum PeerWatcherStatus PeerWatcherStatus;

            typedef enum TriggeredConnectState TriggeredConnectState;

            delegate DeviceArrivedEventHandler;

            delegate DeviceDepartedEventHandler;

            delegate MessageReceivedHandler;

            delegate MessageTransmittedHandler;

            interface IConnectionRequestedEventArgs;

            interface IPeerFinderStatics;

            interface IPeerFinderStatics2;

            interface IPeerInformation;

            interface IPeerInformation3;

            interface IPeerInformationWithHostAndService;

            interface IPeerWatcher;

            interface IProximityDevice;

            interface IProximityDeviceStatics;

            interface IProximityMessage;

            interface ITriggeredConnectionStateChangedEventArgs;

            runtimeclass ConnectionRequestedEventArgs;

            runtimeclass PeerFinder;

            runtimeclass PeerInformation;

            runtimeclass PeerWatcher;

            runtimeclass ProximityDevice;

            runtimeclass ProximityMessage;

            runtimeclass TriggeredConnectionStateChangedEventArgs;
        }
    }
}

// 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*>;

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

                interface Windows.Foundation.TypedEventHandler<Windows.Networking.Proximity.PeerWatcher*, Windows.Networking.Proximity.PeerInformation*>;
            }
        }
    }
}

// Type definition
namespace Windows
{
    namespace Networking
    {
        namespace Proximity
        {
            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [flags]
            enum PeerDiscoveryTypes
            {
                None      = 0x0,
                Browse    = 0x1,
                Triggered = 0x2
            };

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            enum PeerRole
            {
                Peer   = 0,
                Host   = 1,
                Client = 2
            };

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            enum PeerWatcherStatus
            {
                Created              = 0,
                Started              = 1,
                EnumerationCompleted = 2,
                Stopping             = 3,
                Stopped              = 4,
                Aborted              = 5
            };

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            enum TriggeredConnectState
            {
                PeerFound  = 0,
                Listening  = 1,
                Connecting = 2,
                Completed  = 3,
                Canceled   = 4,
                Failed     = 5
            };

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [uuid(EFA9DA69-F6E1-49C9-A49E-8E0FC58FB911)]
            delegate
                HRESULT DeviceArrivedEventHandler([in] Windows.Networking.Proximity.ProximityDevice* sender);

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [uuid(EFA9DA69-F6E2-49C9-A49E-8E0FC58FB911)]
            delegate
                HRESULT DeviceDepartedEventHandler([in] Windows.Networking.Proximity.ProximityDevice* sender);

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [uuid(EFAB0782-F6E2-4675-A045-D8E320C24808)]
            delegate
                HRESULT MessageReceivedHandler([in] Windows.Networking.Proximity.ProximityDevice* sender, [in] Windows.Networking.Proximity.ProximityMessage* message);

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

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

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [exclusiveto(Windows.Networking.Proximity.PeerFinder)]
            [uuid(914B3B61-F6E1-47C4-A14C-148A1903D0C6)]
            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);
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [exclusiveto(Windows.Networking.Proximity.PeerFinder)]
            [uuid(D6E73C65-FDD0-4B0B-9312-866408935D82)]
            interface IPeerFinderStatics2 : IInspectable
            {
                [propget] HRESULT Role([out] [retval] Windows.Networking.Proximity.PeerRole* value);
                [propput] HRESULT Role([in] Windows.Networking.Proximity.PeerRole value);
                [propget] HRESULT DiscoveryData([out] [retval] Windows.Storage.Streams.IBuffer** value);
                [propput] HRESULT DiscoveryData([in] Windows.Storage.Streams.IBuffer* value);
                HRESULT CreateWatcher([out] [retval] Windows.Networking.Proximity.PeerWatcher** watcher);
            }

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

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [exclusiveto(Windows.Networking.Proximity.PeerInformation)]
            [uuid(B20F612A-DBD0-40F8-95BD-2D4209C7836F)]
            interface IPeerInformation3 : IInspectable
            {
                [propget] HRESULT Id([out] [retval] HSTRING* value);
                [propget] HRESULT DiscoveryData([out] [retval] Windows.Storage.Streams.IBuffer** value);
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [exclusiveto(Windows.Networking.Proximity.PeerInformation)]
            [uuid(ECC7CCAD-1B70-4E8B-92DB-BBE781419308)]
            interface IPeerInformationWithHostAndService : IInspectable
            {
                [propget] HRESULT HostName([out] [retval] Windows.Networking.HostName** value);
                [propget] HRESULT ServiceName([out] [retval] HSTRING* value);
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [exclusiveto(Windows.Networking.Proximity.PeerWatcher)]
            [uuid(3CEE21F8-2FA6-4679-9691-03C94A420F34)]
            interface IPeerWatcher : IInspectable
            {
                [eventadd] HRESULT Added([in] Windows.Foundation.TypedEventHandler<Windows.Networking.Proximity.PeerWatcher*, Windows.Networking.Proximity.PeerInformation*>* handler, [out] [retval] EventRegistrationToken* token);
                [eventremove] HRESULT Added([in] EventRegistrationToken token);
                [eventadd] HRESULT Removed([in] Windows.Foundation.TypedEventHandler<Windows.Networking.Proximity.PeerWatcher*, Windows.Networking.Proximity.PeerInformation*>* handler, [out] [retval] EventRegistrationToken* token);
                [eventremove] HRESULT Removed([in] EventRegistrationToken token);
                [eventadd] HRESULT Updated([in] Windows.Foundation.TypedEventHandler<Windows.Networking.Proximity.PeerWatcher*, Windows.Networking.Proximity.PeerInformation*>* handler, [out] [retval] EventRegistrationToken* token);
                [eventremove] HRESULT Updated([in] EventRegistrationToken token);
                [eventadd] HRESULT EnumerationCompleted([in] Windows.Foundation.TypedEventHandler<Windows.Networking.Proximity.PeerWatcher*, IInspectable*>* handler, [out] [retval] EventRegistrationToken* token);
                [eventremove] HRESULT EnumerationCompleted([in] EventRegistrationToken token);
                [eventadd] HRESULT Stopped([in] Windows.Foundation.TypedEventHandler<Windows.Networking.Proximity.PeerWatcher*, IInspectable*>* handler, [out] [retval] EventRegistrationToken* token);
                [eventremove] HRESULT Stopped([in] EventRegistrationToken token);
                [propget] HRESULT Status([out] [retval] Windows.Networking.Proximity.PeerWatcherStatus* status);
                HRESULT Start();
                HRESULT Stop();
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [exclusiveto(Windows.Networking.Proximity.ProximityDevice)]
            [uuid(EFA8A552-F6E1-4329-A0FC-AB6B0FD28262)]
            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);
            }

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

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [exclusiveto(Windows.Networking.Proximity.ProximityMessage)]
            [uuid(EFAB0782-F6E1-4675-A045-D8E320C24808)]
            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);
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [exclusiveto(Windows.Networking.Proximity.TriggeredConnectionStateChangedEventArgs)]
            [uuid(C6A780AD-F6E1-4D54-96E2-33F620BCA88A)]
            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);
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [marshaling_behavior(agile)]
            runtimeclass ConnectionRequestedEventArgs
            {
                [default] interface Windows.Networking.Proximity.IConnectionRequestedEventArgs;
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [marshaling_behavior(agile)]
            [static(Windows.Networking.Proximity.IPeerFinderStatics, Windows.Foundation.UniversalApiContract, 1.0)]
            [static(Windows.Networking.Proximity.IPeerFinderStatics2, Windows.Foundation.UniversalApiContract, 1.0)]
            [threading(both)]
            runtimeclass PeerFinder
            {
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [marshaling_behavior(agile)]
            runtimeclass PeerInformation
            {
                [default] interface Windows.Networking.Proximity.IPeerInformation;
                [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Networking.Proximity.IPeerInformation3;
                [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Networking.Proximity.IPeerInformationWithHostAndService;
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [marshaling_behavior(agile)]
            [threading(both)]
            runtimeclass PeerWatcher
            {
                [default] interface Windows.Networking.Proximity.IPeerWatcher;
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [marshaling_behavior(agile)]
            [static(Windows.Networking.Proximity.IProximityDeviceStatics, Windows.Foundation.UniversalApiContract, 1.0)]
            [threading(both)]
            runtimeclass ProximityDevice
            {
                [default] interface Windows.Networking.Proximity.IProximityDevice;
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [marshaling_behavior(agile)]
            runtimeclass ProximityMessage
            {
                [default] interface Windows.Networking.Proximity.IProximityMessage;
            }

            [contract(Windows.Foundation.UniversalApiContract, 1.0)]
            [marshaling_behavior(agile)]
            runtimeclass TriggeredConnectionStateChangedEventArgs
            {
                [default] interface Windows.Networking.Proximity.ITriggeredConnectionStateChangedEventArgs;
            }
        }
    }
}
