/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-19 17:41:29 UTC
  • Revision ID: tim@ed.am-20121219174129-41i7vrz0jviideqi
fix intro strings

Show diffs side-by-side

added added

removed removed

1
1
/*
2
2
 * Backend.java
3
3
 *
4
 
 * Copyright (C) 2012 to 2013 Tim Marston <tim@ed.am>
 
4
 * Copyright (C) 2012 Tim Marston <tim@ed.am>
5
5
 *
6
6
 * This file is part of the Import Contacts program (hereafter referred
7
 
 * to as "this program").  For more information, see
 
7
 * to as "this program"). For more information, see
8
8
 * http://ed.am/dev/android/import-contacts
9
9
 *
10
10
 * This program is free software: you can redistribute it and/or modify
29
29
{
30
30
        /**
31
31
         * Build-up our contacts cache, using contacts on the device.
32
 
         *
33
32
         * @param cache the contacts cache to populate
34
33
         */
35
34
        public void populateCache( ContactsCache cache );
36
35
 
37
36
        /**
38
37
         * Delete a contact from the device.
39
 
         *
40
38
         * @param id of the contact to delete
41
39
         */
42
40
        public void deleteContact( Long id );
43
41
 
44
 
        @SuppressWarnings("serial")
45
 
        public class ContactCreationException extends Exception { };
46
 
 
47
42
        /**
48
43
         * Add a contact to the device.
49
 
         *
50
 
         * @param name name of the new contact, or null if there isn't one
51
 
         * @return the new contact's id
52
 
         * @throws ContactCreationException
 
44
         * @param name name of the new contact
 
45
         * @return the new contact's id, or null on failure
53
46
         */
54
 
        public Long addContact( String name ) throws ContactCreationException;
 
47
        public Long addContact( String name );
55
48
 
56
49
        /**
57
50
         * Add a phone number to an existing contact on the device.
58
 
         *
59
51
         * @param id the existing contact's id
60
52
         * @param number the phone number
61
53
         * @param data data about the number
62
 
         * @throws ContactCreationException
63
54
         */
64
55
        public void addContactPhone( Long id, String number,
65
 
                ContactData.PreferredDetail data ) throws ContactCreationException;
 
56
                ContactData.PreferredDetail data );
66
57
 
67
58
        /**
68
59
         * Add an email address to an existing contact on the device.
69
 
         *
70
60
         * @param id the existing contact's id
71
61
         * @param email the email address
72
62
         * @param data data about the email address
73
 
         * @throws ContactCreationException
74
63
         */
75
64
        public void addContactEmail( Long id, String email,
76
 
                ContactData.PreferredDetail data ) throws ContactCreationException;
 
65
                ContactData.PreferredDetail data );
77
66
 
78
67
        /**
79
68
         * Add an address to an existing contact on the device.
80
 
         *
81
69
         * @param id the existing contact's id
82
70
         * @param address the address
83
71
         * @param data data about the address
84
 
         * @throws ContactCreationException
85
72
         */
86
73
        public void addContactAddresses( Long id, String address,
87
 
                ContactData.TypeDetail data ) throws ContactCreationException;
 
74
                ContactData.TypeDetail data );
88
75
 
89
76
        /**
90
77
         * Add a title and organisation to an existing contact on the device.
91
 
         *
92
78
         * @param id the existing contact's id
93
79
         * @param organisation the organisation
94
80
         * @param data data about the organisation
95
 
         * @throws ContactCreationException
96
81
         */
97
82
        public void addContactOrganisation( Long id, String organisation,
98
 
                ContactData.ExtraDetail data ) throws ContactCreationException;
99
 
 
100
 
        /**
101
 
         * Add a note to an existing contact on the device.
102
 
         *
103
 
         * @param id the existing contact's id
104
 
         * @param note the note
105
 
         * @throws ContactCreationException
106
 
         */
107
 
        public void addContactNote( Long id, String note )
108
 
                throws ContactCreationException;
109
 
 
110
 
        /**
111
 
         * Add a birthday to an existing contact on the device.
112
 
         *
113
 
         * @param id the existing contact's id
114
 
         * @param birthday the birthday
115
 
         * @throws ContactCreationException
116
 
         */
117
 
        public void addContactBirthday( Long id, String birthday )
118
 
                throws ContactCreationException;
 
83
                ContactData.ExtraDetail data );
119
84
}