LibreOffice Module sd (master) 1
OSXNetworkService.mm
Go to the documentation of this file.
1/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9#include <osl/conditn.hxx>
10
11#include <premac.h>
12 #import <CoreFoundation/CoreFoundation.h>
13 #import "OSXNetworkService.h"
14#include <postmac.h>
15
16@implementation OSXBonjourService
17
18- (void) publishImpressRemoteServiceOnLocalNetworkWithName:(NSString *)sName
19{
20 netService = [[NSNetService alloc] initWithDomain:@"local" type:@"_impressremote._tcp" name:sName port:1599];
21
22 if (netService != nil)
23 {
24 [netService setDelegate:self];
25 [netService scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
26 [netService publish];
27 }
28}
29
30-(void)netService:(NSNetService *)aNetService
31 didNotPublish:(NSDictionary *)dict {
32 NSLog(@"Service %p did not publish: %@", aNetService, dict);
33}
34
35- (void)dealloc {
36 [netService stop];
37 [netService release];
38 [super dealloc];
39}
40
41@end
42
43/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
NSNetService * netService