1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38 #include "nsISupports.idl"
39
40 interface nsIStringBundle;
41
42 [scriptable, uuid(97448252-F189-11d4-A422-001083003D0C)]
43 interface nsIAbPreferMailFormat {
44 const unsigned long unknown = 0;
45 const unsigned long plaintext = 1;
46 const unsigned long html = 2;
47 };
48
49 [scriptable, uuid(193d5026-7d1e-41b4-9fc3-c57d4a4937f3)]
50 interface nsIAbCard : nsISupports {
51 // Card properties
52 attribute AString firstName;
53 attribute AString lastName;
54 attribute AString phoneticFirstName;
55 attribute AString phoneticLastName;
56 attribute AString displayName;
57 attribute AString nickName;
58 attribute AString primaryEmail;
59 attribute AString secondEmail;
60 attribute AString workPhone;
61 attribute AString homePhone;
62 attribute AString faxNumber;
63 attribute AString pagerNumber;
64 attribute AString cellularNumber;
65 attribute AString workPhoneType;
66 attribute AString homePhoneType;
67 attribute AString faxNumberType;
68 attribute AString pagerNumberType;
69 attribute AString cellularNumberType;
70 attribute AString homeAddress;
71 attribute AString homeAddress2;
72 attribute AString homeCity;
73 attribute AString homeState;
74 attribute AString homeZipCode;
75 attribute AString homeCountry;
76 attribute AString workAddress;
77 attribute AString workAddress2;
78 attribute AString workCity;
79 attribute AString workState;
80 attribute AString workZipCode;
81 attribute AString workCountry;
82 attribute AString jobTitle;
83 attribute AString department;
84 attribute AString company;
85 attribute AString aimScreenName;
86 attribute AString anniversaryYear;
87 attribute AString anniversaryMonth;
88 attribute AString anniversaryDay;
89 attribute AString spouseName;
90 attribute AString familyName;
91 attribute AString defaultAddress;
92 attribute AString category;
93 /**
94 * webPage1 is work web page
95 */
96 attribute AString webPage1;
97 /**
98 * webPage2 is home web page
99 */
100 attribute AString webPage2;
101 attribute AString birthYear;
102 attribute AString birthMonth;
103 attribute AString birthDay;
104 attribute AString custom1;
105 attribute AString custom2;
106 attribute AString custom3;
107 attribute AString custom4;
108 attribute AString notes;
109 attribute unsigned long lastModifiedDate;
110 /**
111 * Popularity Index is bumped every time e-mail is sent to this recipient
112 */
113 attribute unsigned long popularityIndex;
114 attribute unsigned long preferMailFormat;
115 attribute boolean isMailList;
116 /**
117 * If isMailList is true then mailListURI
118 * will contain the URI of the associated
119 * mail list
120 */
121 attribute string mailListURI;
122 /**
123 * allowRemoteContent to be displayed in HTML mail received from this contact
124 */
125 attribute boolean allowRemoteContent;
126
127 AString getCardValue(in string name);
128
129 void setCardValue(in string attrname, in AString value);
130
131 /**
132 * This function will copy all values from one card to another.
133 *
134 * @param srcCard The source card to copy values from.
135 */
136 void copy(in nsIAbCard srcCard);
137
138 boolean equals(in nsIAbCard card);
139
140 string convertToBase64EncodedXML();
141 AString convertToXMLPrintData();
142 string convertToEscapedVCard();
143
144 /**
145 * Generate a name from the card for display purposes. Using the firstName,
146 * lastName and the displayName. We allow the caller to cache the pref value,
147 * so we don't have to go to prefs every time.
148 *
149 * The format follows the "mail.addr_book.lastnamefirst" pref values:
150 *
151 * 0 = generated name is displayName
152 * 1 = lastFirst, formatted following lastFirstFormat
153 * 2 = firstLast, formatted following firstLastFormat
154 *
155 * lastFirstFormat and firstLastFormat are defined in addressBook.properties.
156 *
157 * @param aGenerateFormat The format to generate as per the above definition.
158 * @param aBundle An optional parameter that is a pointer to a string
159 * bundle that holds:
160 * chrome://messenger/locale/addressbook/addressBook.properties
161 * If this bundle is not supplied, then the function
162 * will obtain the bundle itself. If cached by the
163 * caller and supplied to this function, then
164 * performance will be improved over many calls.
165 * @return A string containing the generated name.
166 */
167 AString generateName(in long aGenerateFormat,
168 [optional] in nsIStringBundle aBundle);
169
170 /**
171 * Generate a phonetic name from the card, using the firstName and lastName
172 * values.
173 *
174 * @param aLastNameFirst Set to True to put the last name before the first.
175 * @return A string containing the generated phonetic name.
176 */
177 AString generatePhoneticName(in boolean aLastNameFirst);
178 };