Main Page | Modules | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

AddressBookItem Class Reference

#import <AddressBookItem.h>


Detailed Description

Contextual menu item for adding to Address Book.

This item takes a proper name and an email address, formats itself to read "Add 'name' to Address Book," and, if selected, adds the name and address to the Address Book.

Definition at line 22 of file AddressBookItem.h.

Public Member Functions

(id) - initWithName:mailto:
 Designated initializer, given a name and address.
(NSString *) - properName
 Return the name to be added to the address book.
(NSString *) - emailAddress
 Return the email address as a string.
(IBAction) - makeAddressBookEntry:
 Action method for the menu item.
(void) - dealloc [implementation]

Protected Attributes

NSString * name
 the name of the addressee
NSURL * url
 mailto: url for the addressee


Member Function Documentation

- (void) dealloc   [implementation]
 

Definition at line 30 of file AddressBookItem.m.

References name, and url.

- (NSString *) emailAddress  
 

Return the email address as a string.

This method parses the mailto: URL retained from the initializer into an addressee@dom.ain email address string, and returns the result.

Return values:
NSString the string thus derived.

Definition at line 39 of file AddressBookItem.m.

References length(), and url.

Referenced by makeAddressBookEntry:.

Here is the call graph for this function:

- (id) initWithName: (NSString *)  aName
mailto: (NSURL *)  aURL
 
 

Designated initializer, given a name and address.

This initializer causes the menu item to have the text "Add &ldquo;aName&rdquo; to Address Book," and sets up -makeAddressBookEntry: as the action. The parameters are retained.

Parameters:
aName NSString, the name to be added.
aURL NSURL, the mailto: URL of the email address.
Return values:
self or nil if the inherited initWithTitle:action:keyEquivalent: fails.

Definition at line 14 of file AddressBookItem.m.

References name, and url.

- (IBAction) makeAddressBookEntry: (id)  sender  
 

Action method for the menu item.

The initializer designates this method as the action method for the menu item. It makes a new Address Book entry, with the last word of the name string the last name, the remaining words the first name, and the string returned by -emailAddress the email address.

Parameters:
sender The sender of this method, by the IBAction convention. Probably self.

Definition at line 47 of file AddressBookItem.m.

References emailAddress, and properName.

Here is the call graph for this function:

- (NSString *) properName  
 

Return the name to be added to the address book.

This method returns the NSString retained for the full name to be inserted in the address book.

Return values:
NSString the name instance variable.

Definition at line 37 of file AddressBookItem.m.

References name.

Referenced by makeAddressBookEntry:.


Field Documentation

- (NSString*) name [protected]
 

the name of the addressee

Definition at line 24 of file AddressBookItem.h.

Referenced by dealloc, initWithName:mailto:, and properName.

- (NSURL*) url [protected]
 

mailto: url for the addressee

Definition at line 25 of file AddressBookItem.h.

Referenced by dealloc, emailAddress, and initWithName:mailto:.


The documentation for this class was generated from the following files:
Generated on Fri Sep 30 12:01:12 2005 for Crescat by  doxygen 1.4.4