/* FILE: TrystController.h
 *
 * Project              Tryst
 * Class                TrystController
 * Creator              Chris B. Vetter
 * Maintainer           Chris B. Vetter
 * Creation Date        Mon Jan  8 16:12:07 CET 2007
 *
 * Copyright (c) 2007
 *
 * Tryst is free software under the terms of a dual BSD/LGPL license.
 * For a full copyright description, see the COPYRIGHT file.
 *
 ***************************************************************************/

#ifndef _TRYSTCONTROLLER_H_
#define _TRYSTCONTROLLER_H_ 1
/***************************************************************************/

//
// Include
//

#import <Foundation/NSObject.h>

//
// Define
//

//
// Typedef
//

//
// Public
//

//
// Referenced Classes
//

@class	NSNetService,
        NSNetServiceBrowser,
        NSString,
        NSSocketPort,
        NSMutableArray;

//
// Interface
//

/**
 * <unit>
 *   <heading>
 *     TrystController class description
 *   </heading>
 *   <p>
 *     <!-- Foreword -->
 *   </p>
 *   <unit />
 *   <p>
 *     <!-- Afterword -->
 *   </p>
 * </unit>
 * <em>Description forthcoming</em>
 */

@interface TrystController : NSObject
{
  @private
  NSNetService		*_service;
  
  NSString		*_serviceName,
                        *_serviceType;
  BOOL       	    	 _browsing,
                         _publishing;
  
  NSNetServiceBrowser	*_serviceBrowser,
                        *_domainBrowser;
  
  NSSocketPort		*_socketPort;
  int			 _portNumber;
  
  NSMutableArray	*_discoveredServicesWithInfo;
  
  id			 _delegate;
}

//
// Factory Methods
//

//
// Instance Methods
//
- (id) initWithName: (NSString *) name
               type: (NSString *) type
               port: (int) port;

- (void) refreshBrowsing;

- (void) activateBrowsing: (BOOL) flag;
- (void) activatePublishing: (BOOL) flag;

//
// Accessor Methods
//

- (BOOL) isBrowsing;
- (BOOL) isPublished;

- (NSArray *) discoveredServicesWithInfo;

- (id) delegate;
- (void) setDelegate: (id) object;

- (NSString *) name;
- (void) setName: (NSString *) name;

- (NSSocketPort *) socket;

- (NSString *) ipForName: (NSString *) name;
- (int) portForName: (NSString *) name;

@end

//
// Interface
//

/**
 * <unit>
 *   <heading>
 *     NSObject (TrystControllerDelegate) category description
 *   </heading>
 *   <p>
 *     <!-- Foreword -->
 *   </p>
 *   <unit />
 *   <p>
 *     <!-- Afterword -->
 *   </p>
 * </unit>
 * <em>Description forthcoming</em>
 */

@interface NSObject (TrystControllerDelegate)

- (void) discoveredServicesDidChange: (id) sender;

@end

//
// Prototypes
//

/***************************************************************************/
#endif


syntax highlighted by Code2HTML, v. 0.9.1