5 // Created by Charles Jolley on Tue Jun 15 2004.
6 // Copyright (c) 2004, Nisus Software, Inc.
7 // All rights reserved.
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are met:
12 // Redistributions of source code must retain the above copyright notice,
13 // this list of conditions and the following disclaimer.
15 // Redistributions in binary form must reproduce the above copyright notice,
16 // this list of conditions and the following disclaimer in the documentation
17 // and/or other materials provided with the distribution.
19 // Neither the name of the Nisus Software, Inc. nor the names of its
20 // contributors may be used to endorse or promote products derived from this
21 // software without specific prior written permission.
23 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
24 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
27 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 #import <Cocoa/Cocoa.h>
39 @protocol LinkBackServerDelegate, LinkBackClientDelegate ;
41 @protocol LinkBackServer
42 - (LinkBack*)initiateLinkBackFromClient:(LinkBack*)clientLinkBack ;
45 // This method is used as the standard way of constructing the actual server name a live link connection is posted under. It is constructed from the name and identifier.
46 NSString* MakeLinkBackServerName(NSString* bundleIdentifier, NSString* name) ;
48 // a LinkBack server is created for each published server. This simply responds to connection requests to create new live links.
49 @interface LinkBackServer : NSObject <LinkBackServer> {
50 NSConnection* listener ;
52 id<LinkBackServerDelegate> delegate ;
55 + (LinkBackServer*)LinkBackServerWithName:(NSString*)name ;
56 + (BOOL)publishServerWithName:(NSString*)name delegate:(id<LinkBackServerDelegate>)del ;
58 + (LinkBackServer*)LinkBackServerWithName:(NSString*)name inApplication:(NSString*)bundleIdentifier launchIfNeeded:(BOOL)flag fallbackURL:(NSURL*)url appName:(NSString*)appName ;
60 // This method is used by clients to connect
62 - (id)initWithName:(NSString*)name delegate:(id<LinkBackServerDelegate>)aDel;
64 - (BOOL)publish ; // creates the connection and adds to the list.