# DKProxy documentation

### Authors

Niels Grewe (`niels.grewe@halbordnung.de`)

Copyright: (C) 2010 Free Software Foundation, Inc.

### Contents -

1. Software documentation for the DKDBus class
2. Software documentation for the DKProxy class

# Software documentation for the DKDBus class

## DKDBus : DKProxy

> Declared in:
>   DBusKit/DKProxy.h

The DKDBus class exposes the D-Bus objects specifically (i.e. the "org.freedesktop.DBus" service). The instances returned by this class are shared objects: Calling -setPrimaryDBusInterface: on them has no effect. DKDBus instances also emit notifications about the state of the bus they represent. An application can watch for a `DKBusDisconnectedNotification` and `DKBusReconnectedNotification` to be notified about state changes for the bus.

Instance Variables
Method summary

- +busWithBusType:
- +sessionBus
- +systemBus

### busWithBusType:

+ (id) busWithBusType: (DKDBusBusType)type;
Returns a reference to the org.freedesktop.DBus service on the bus specified by type.

### sessionBus

+ (id) sessionBus;
Returns a reference to the org.freedesktop.DBus service on the session message bus.

### systemBus

+ (id) systemBus;
Returns a reference to the org.freedesktop.DBus service on the system message bus.

## Instance Variables for DKDBus Class

### isDisconnected

@protected BOOL isDisconnected;
The isDisconnected flag is set by a bus object that experiences a bus failure and tries to reconnect to the bus.

# Software documentation for the DKProxy class

## DKProxy : NSProxy

> Declared in:
>   DBusKit/DKProxy.h

> Conforms to:
>   NSCoding

The DKProxy class is used to send messages to D-Bus objects. Usually, you don't create them yourself but by using the DKPort and NSConnection classes.
Method summary

- +proxyWithPort:path:
- +proxyWithService:path:bus:
- -hasSameScopeAs:
- -initWithEndpoint:andService:andPath:
- -initWithPort:path:
- -initWithService:path:bus:
- -setPrimaryDBusInterface:

### proxyWithPort: path:

+ (id) proxyWithPort: (DKPort*)aPort path: (NSString*)aPath;
Description forthcoming.

### proxyWithService: path: bus:

+ (id) proxyWithService: (NSString*)aService path: (NSString*)aPath bus: (DKDBusBusType)type;
Description forthcoming.

### hasSameScopeAs:

- (BOOL) hasSameScopeAs: (DKProxy*)aProxy;
Checks whether the to proxies are attached to the same D-Bus service.

### initWithEndpoint: andService: andPath:

- (id) initWithEndpoint: (DKEndpoint*)anEndpoint andService: (NSString*)aService andPath: (NSString*)aPath;
Description forthcoming.

### initWithPort: path:

- (id) initWithPort: (DKPort*)aPort path: (NSString*)aPath;
Description forthcoming.

### initWithService: path: bus:

- (id) initWithService: (NSString*)aService path: (NSString*)aPath bus: (DKDBusBusType)type;
Description forthcoming.

### setPrimaryDBusInterface:

- (void) setPrimaryDBusInterface: (NSString*)anInterface;
D-Bus allows identically named methods to appear in multiple interfaces. By default and in accordance with the D-Bus specification, DKProxy will call the first available implementation unless you specify the interface. If you usually call methods from a specific interface, you can designate the interface as the primary one by calling -setPrimaryDBusInterface: .