HasGoTo <- Contact |
|
|
Category Empty GivenName IdentifyingName Image SalutationName Surname |
Define Class Contact; mixes in with Object; inherits from HasGoTo; attribute Category: Unsigned, noGetter, noSetter; // the type of contact, e.g. categoryPerson, categoryGroup, categoryCompany // the full set of categories is defined in Contacts.h operation IsSameCorrespondent(other: Contact): Boolean; // call to find out if these two contacts match // to get a match, the FullContact of self and <other> must be identical // override rarely attribute Empty: Boolean, readOnly, noGetter; // true if there's no address information attached attribute Image: Image, readOnly; // returns images based on category operation PutDefaultImageOnContact(); // Sets the contact's image based on its category. // full contacts with corresponding simple contacts operation FullContact(): FullContact, noFail, noMethod; // call to get the full contact for this contact // returns nilObject if there is no full contact for self // must override operation FullContactIfAny(): FullContact, noFail; // call to get the full contact for this contact // returns self if there is no full contact for self // calls FullContact // override rarely operation MakeSimpleContactNear(nearThis: Object): SimpleContact, noMethod, noFail; // called to make a simple contact from this contact // auomatically selects the most appropriate address if its a FullContact operation MakeSimpleContactWithNoAddressNear(nearThis: Object): SimpleContact, noMethod, noFail; // called to make a simple contact from this contact // does not include an address in the simple contact // name accessors attribute IdentifyingName: Text, readOnly, noGetter; // name form used when identifying a person, as in "Andy's phone", "Seto-san no denwa" attribute GivenName: Text, readOnly, noGetter; // a.k.a. first name in the U.S. and Western Europe (but may be last name in other parts of the world) attribute SalutationName: Text, readOnly, noGetter; // name form used when addressing a message, as in "Dear Andy" attribute Surname: Text, readOnly, noGetter; // a.k.a. last name in the U.S. and parts of Europe (but may be first name in other parts of the world) // address information operation CopyAddresses(): ObjectList, noMethod; // to get a transient list of all the addresses for the contact // e-mail operation PreferredDeliveryChoice(deliveryChoices: Object): Object, noMethod; // called by the system to show a default delivery choice when the // user addresses a telecard // choice is based on what has been remembered from last time and some heuristics operation RememberDeliveryChoice(deliveryChoice: Object), noMethod; // called by the system when the user picks a delivery choice for this contact // when addressing a telecard // the choice is remembered and used as a default for the next time // phones operation PhoneCount(): Unsigned, noMethod; // only full contacts have phones, but this operation is abstracted here // so that simple contacts will behave rationally in cases where they // are present instead of full contacts end class;