]> git.lyx.org Git - lyx.git/blob - src/support/linkback/LinkBackServer.h
* layouttranslations.review - remove dupes
[lyx.git] / src / support / linkback / LinkBackServer.h
1 //
2 //  LinkBackServer.h
3 //  LinkBack
4 //
5 //  Created by Charles Jolley on Tue Jun 15 2004.
6 //  Copyright (c) 2004, Nisus Software, Inc.
7 //  All rights reserved.
8
9 //  Redistribution and use in source and binary forms, with or without 
10 //  modification, are permitted provided that the following conditions are met:
11 //
12 //  Redistributions of source code must retain the above copyright notice, 
13 //  this list of conditions and the following disclaimer.
14 //
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.
18 //
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.
22 //
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.
34 //
35
36 #import <Cocoa/Cocoa.h>
37
38 @class LinkBack ;
39 @protocol LinkBackServerDelegate, LinkBackClientDelegate ;
40
41 @protocol LinkBackServer
42 - (LinkBack*)initiateLinkBackFromClient:(LinkBack*)clientLinkBack ;
43 @end
44
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) ;
47
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 ;
51     NSString* name ;
52     id<LinkBackServerDelegate> delegate ;
53 }
54
55 + (LinkBackServer*)LinkBackServerWithName:(NSString*)name  ;
56 + (BOOL)publishServerWithName:(NSString*)name delegate:(id<LinkBackServerDelegate>)del ;
57
58 + (LinkBackServer*)LinkBackServerWithName:(NSString*)name inApplication:(NSString*)bundleIdentifier launchIfNeeded:(BOOL)flag fallbackURL:(NSURL*)url appName:(NSString*)appName ;
59
60 // This method is used by clients to connect 
61
62 - (id)initWithName:(NSString*)name delegate:(id<LinkBackServerDelegate>)aDel;
63
64 - (BOOL)publish ; // creates the connection and adds to the list.
65 - (void)retract ;
66
67 @end