/android/import-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/import-contacts

« back to all changes in this revision

Viewing changes to src/am/ed/importcontacts/Backend.java

  • Committer: edam
  • Date: 2012-12-18 11:58:46 UTC
  • Revision ID: tim@ed.am-20121218115846-xdwnw3zzcedbb3rp
bump version to 1.3 (we're skipping v1.2, for f-droid)

Show diffs side-by-side

added added

removed removed

21
21
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
22
 */
23
23
 
 
24
 
24
25
package am.ed.importcontacts;
25
26
 
26
27
import am.ed.importcontacts.Importer.ContactData;
27
28
 
 
29
 
28
30
public interface Backend
29
31
{
30
32
        /**
34
36
        public void populateCache( ContactsCache cache );
35
37
 
36
38
        /**
37
 
         * Delete a contact from the device.
 
39
         * Delete a contact
38
40
         * @param id of the contact to delete
39
41
         */
40
42
        public void deleteContact( Long id );
41
43
 
42
 
        @SuppressWarnings("serial")
43
 
        public class ContactCreationException extends Exception { };
44
 
 
45
44
        /**
46
 
         * Add a contact to the device.
47
 
         * @param name name of the new contact, or null if there isn't one
48
 
         * @return the new contact's id
49
 
         * @throws ContactCreationException
 
45
         * Add a contact
 
46
         * @param name name of the new contact
 
47
         * @return the new contact's id, or 0 on failure
50
48
         */
51
 
        public Long addContact( String name ) throws ContactCreationException;
 
49
        public Long addContact( String name );
52
50
 
53
51
        /**
54
 
         * Add a phone number to an existing contact on the device.
 
52
         * Add a phone number to an existing contact
55
53
         * @param id the existing contact's id
56
54
         * @param number the phone number
57
55
         * @param data data about the number
58
 
         * @throws ContactCreationException
59
56
         */
60
57
        public void addContactPhone( Long id, String number,
61
 
                ContactData.PreferredDetail data ) throws ContactCreationException;
 
58
                ContactData.PreferredDetail data );
62
59
 
63
60
        /**
64
 
         * Add an email address to an existing contact on the device.
 
61
         * Add an email address to an existing contact
65
62
         * @param id the existing contact's id
66
63
         * @param email the email address
67
64
         * @param data data about the email address
68
 
         * @throws ContactCreationException
69
65
         */
70
66
        public void addContactEmail( Long id, String email,
71
 
                ContactData.PreferredDetail data ) throws ContactCreationException;
 
67
                ContactData.PreferredDetail data );
72
68
 
73
69
        /**
74
 
         * Add an address to an existing contact on the device.
 
70
         * Add an address to an existing contact
75
71
         * @param id the existing contact's id
76
72
         * @param address the address
77
73
         * @param data data about the address
78
 
         * @throws ContactCreationException
79
74
         */
80
75
        public void addContactAddresses( Long id, String address,
81
 
                ContactData.TypeDetail data ) throws ContactCreationException;
 
76
                ContactData.TypeDetail data );
82
77
 
83
78
        /**
84
 
         * Add a title and organisation to an existing contact on the device.
 
79
         * Add a title and organisation to an existing contact
85
80
         * @param id the existing contact's id
86
81
         * @param organisation the organisation
87
82
         * @param data data about the organisation
88
 
         * @throws ContactCreationException
89
83
         */
90
84
        public void addContactOrganisation( Long id, String organisation,
91
 
                ContactData.ExtraDetail data ) throws ContactCreationException;
92
 
 
93
 
        /**
94
 
         * Add a note to an existing contact on the device.
95
 
         * @param id the existing contact's id
96
 
         * @param note the note
97
 
         * @throws ContactCreationException
98
 
         */
99
 
        public void addContactNote( Long id, String note )
100
 
                throws ContactCreationException;
101
 
 
 
85
                ContactData.ExtraDetail data );
102
86
}