<?php
	
/* $Id: vcard_email.php,v 1.1 2002/10/22 13:45:10 kfish Exp $ */

class VCard_EMAIL {

    var $address;
 
 /* Electronic Mail
 This property specifies the address for electronic mail communication with the vCard object. 
 The address is in the form of a specific addressing type. For example, the Internet mail address 
 for John Public might be "John.Public@abc.com" or the CompuServe Information Service address might 
 be "71234,5678".This property is identified by the property name EMAIL.
 An example of this property follows:
  EMAIL;INTERNET:john.public@abc.com
 Support for this property is OPTIONAL for vCard Writers conforming to this specification.

 Electronic Mail Type
 This property parameter specifies the type of electronic mail address. The following are some example 
 values for this property parameter:

 TYPE=

 AOL       - Indicates America On-Line
 AppleLink - Indicates AppleLink
 ATTMail   - Indicates AT&T Mail
 CIS       - Indicates CompuServe Information Service
 eWorld    - Indicates eWorld
 INTERNET  - Indicates Internet SMTP (default)
 IBMMail   - Indicates IBM Mail
 MCIMail   - Indicates MCI Mail
 POWERSHARE- Indicates PowerShare
 PRODIGY   - Indicates Prodigy information service
 TLX       - Indicates Telex number
 X400      - Indicates X.400 service

 */

    function setIsInternetEmail() {
	$this->type["INTERNET"] = true; 
    }

    function resetInternetEmail() {
	$this->type["INTERNET"] = false; 
    }

    function IsInternetEmail() {
	return $this->type["INTERNET"];	
    }

    function setIsPrefEmail() {
	$this->type["PREF"] = true; 
    }

    function resetPrefEmail() {
	$this->type["PREF"] = false; 
    }

    function IsPrefEmail() {
	return $this->type["PREF"];	
    }
  
    function getKey() {
	$tmpString = "EMAIL";
	while (list ($key, $val) = each ($this->type)) {
	    if ($val=="true"){
		$tmpString = $tmpString.";".$key;	
	    }
	}
	return $tmpString.":";
    } 
 
    function getAddress() {
	return $this->address;	
    }
 
    function setAddress($address) {
	$this->address = $address;	
    } 
 
    function VCard_EMAIL ($address) {
	$this->type["INTERNET"] = true;
	$this->type["AOL"] = false;
	$this->type["CIS"] = false;
	$this->type["X400"] = false;
	$this->setIsPrefEmail();
	$this->address = $address;
    } 	
}
?>