10e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org/*
20e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * libjingle
30e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * Copyright 2013, Google Inc.
40e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *
50e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * Redistribution and use in source and binary forms, with or without
60e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * modification, are permitted provided that the following conditions are met:
70e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *
80e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *  1. Redistributions of source code must retain the above copyright notice,
90e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *     this list of conditions and the following disclaimer.
100e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *  2. Redistributions in binary form must reproduce the above copyright notice,
110e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *     this list of conditions and the following disclaimer in the documentation
120e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *     and/or other materials provided with the distribution.
130e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *  3. The name of the author may not be used to endorse or promote products
140e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *     derived from this software without specific prior written permission.
150e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org *
160e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
170e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
180e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
190e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
200e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
210e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
220e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
230e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
240e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
250e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
260e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org */
270e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org
280e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org#import <Foundation/Foundation.h>
290e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org
300e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org#import "GAEChannelClient.h"
310e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org
3252348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@class APPRTCAppClient;
3352348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@protocol APPRTCAppClientDelegate
340e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org
3552348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (void)appClient:(APPRTCAppClient*)appClient
3652348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org    didErrorWithMessage:(NSString*)message;
3752348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (void)appClient:(APPRTCAppClient*)appClient
3852348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org    didReceiveICEServers:(NSArray*)servers;
390e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org
400e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org@end
410e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org
426e2c318450409ed8a96e9acfee1bebb4aa72a5b2henrike@webrtc.org@class RTCMediaConstraints;
436e2c318450409ed8a96e9acfee1bebb4aa72a5b2henrike@webrtc.org
440e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org// Negotiates signaling for chatting with apprtc.appspot.com "rooms".
450e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org// Uses the client<->server specifics of the apprtc AppEngine webapp.
460e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org//
470e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org// To use: create an instance of this object (registering a message handler) and
480e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org// call connectToRoom().  apprtc.appspot.com will signal that is successful via
490e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org// onOpen through the browser channel.  Then you should call sendData() and wait
500e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org// for the registered handler to be called with received messages.
51596929a99d1d5191866a038aab5dd451e76213adtkchin@webrtc.org@interface APPRTCAppClient : NSObject
520e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org
5352348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@property(nonatomic) BOOL initiator;
54bb288156332dd2e684f0dde156bd984c73da210bfischman@webrtc.org@property(nonatomic, copy, readonly) RTCMediaConstraints* videoConstraints;
5552348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@property(nonatomic, weak) id<APPRTCAppClientDelegate> delegate;
560e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org
57596929a99d1d5191866a038aab5dd451e76213adtkchin@webrtc.org- (instancetype)initWithDelegate:(id<APPRTCAppClientDelegate>)delegate
58596929a99d1d5191866a038aab5dd451e76213adtkchin@webrtc.org                  messageHandler:(id<GAEMessageHandler>)handler;
59bb288156332dd2e684f0dde156bd984c73da210bfischman@webrtc.org- (void)connectToRoom:(NSURL*)room;
60bb288156332dd2e684f0dde156bd984c73da210bfischman@webrtc.org- (void)sendData:(NSData*)data;
61bb288156332dd2e684f0dde156bd984c73da210bfischman@webrtc.org
62bb288156332dd2e684f0dde156bd984c73da210bfischman@webrtc.org#ifndef DOXYGEN_SHOULD_SKIP_THIS
63bb288156332dd2e684f0dde156bd984c73da210bfischman@webrtc.org// Disallow init and don't add to documentation
64596929a99d1d5191866a038aab5dd451e76213adtkchin@webrtc.org- (instancetype)init __attribute__((
65bb288156332dd2e684f0dde156bd984c73da210bfischman@webrtc.org    unavailable("init is not a supported initializer for this class.")));
66bb288156332dd2e684f0dde156bd984c73da210bfischman@webrtc.org#endif /* DOXYGEN_SHOULD_SKIP_THIS */
670e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org
680e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org@end
69