Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Cyberdog Programmer's Kit / Part 3 - Cyberdog Reference
Chapter 7 - Classes and Methods


CyberService

Superclasses
ODObject
Subclasses
none
An object of the CyberService class represents a network service or protocol.

Description

A CyberService object represents a Cyberdog service, an object that, along with companion objects, provides support for accessing data using a particular network protocol. The CyberService class is an abstract superclass that you subclass and implement to provide a service. Cyberdog includes CyberService subclasses to support common network protocols, such as HTTP, Gopher, and FTP. You can use the existing CyberService subclasses or create a new CyberService subclass to support a new service.

Cyberdog determines which services are supported by checking for 'srvc' resources. When a Cyberdog session is initialized, it creates a Cyberdog service for each 'srvc' resource in your shared library. The 'srvc' resource identifies the SOM class of the Cyberdog service to create as well as other configuration attributes of the service. Cyberdog selects the appropriate service object as needed to access network data. Cyberdog services are deleted when the Cyberdog session is deleted.

If you are developing a Cyberdog display part, you should not need to access service objects directly. In most cases, other classes in Cyberdog mediate between Cyberdog display parts and service objects. For example, to create a Cyberdog item from a URL, a display part calls the CyberSession::CreateCyberItemFromURL method. This method iterates over all of the CyberService objects, determines which service owns the particular URL scheme, and asks that service to create a Cyberdog item for the URL.

A CyberService subclass may have companion CyberItem and CyberStream subclasses that address and download data using the protocol. Each service may have its own Connect To and Preferences panels, displayed in the Connect To and Preferences dialog boxes, respectively.

In addition, the Cyberdog service interacts with Cyberdog service menu objects (page 341) to display its service-related menu items for Cyberdog display parts. A service's menu commands are specified as offsets from a service menu object's base command ID. As a display part developer, you specify the base menu command ID to be used for a service menu object when you call CyberServiceMenu::ICyberServiceMenu to initialize the object. For more information on registering menu command IDs with OpenDoc, see the chapter on windows and menus in OpenDoc Programmer's Guide.

Methods

This section presents summary descriptions of the CyberService methods grouped according to purpose, followed by detailed descriptions.

Initialization and Cleanup

ICyberService
Initializes this Cyberdog service.
Creating Cyberdog Items

CreateCyberItem
Creates a Cyberdog item for the specified URL.
OwnsURL
Tests whether this Cyberdog service can create a Cyberdog item for the specified URL.
Managing Menus

AdjustCyberMenu
Adjusts the menu items of this Cyberdog service.
AppendCyberMenuCommands
Appends the menu items of this Cyberdog service to a Cyberdog service menu object.
CyberMenuFocusAcquired
Notifies this Cyberdog service that the part associated with a Cyberdog service menu object has acquired the focus.
CyberMenuFocusLost
Notifies this Cyberdog service that the part associated with a Cyberdog service menu object has lost the focus.
DoCyberMenuCommand
Performs a menu command.
Accessing Display Information

GetIconSuite
Retrieves the icon suite for this Cyberdog service.
GetName
Retrieves the name of this Cyberdog service.
Preferences and Connect To Panels

GetConnectPartKind
Retrieves the part kind of the Connect To panel for this Cyberdog service.
GetPrefsPartKind
Retrieves the part kind of the Preferences panel for this Cyberdog service.

Methods
AdjustCyberMenu
AppendCyberMenuCommands
CreateCyberItem
CyberMenuFocusAcquired
CyberMenuFocusLost
DoCyberMenuCommand
GetConnectPartKind
GetIconSuite
GetName
GetPrefsPartKind
ICyberService
OwnsURL

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996