2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.addressbook.manager.contact;
19 import java.io.IOException;
20 import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException;
21 import org.mxchange.jcore.contact.Contact;
22 import org.mxchange.jcore.contact.Gender;
23 import org.mxchange.jcore.exceptions.BadTokenException;
24 import org.mxchange.jcore.manager.database.ManageableDatabase;
28 * @author Roland Haeder
30 public interface ManageableAddressbookContact extends ManageableDatabase {
32 * Allows the user to enter own cellphone number.
34 * @return Cellphone number
36 public String enterOwnCellNumber ();
39 * Allows the user to enter own city name.
43 public String enterOwnCity ();
46 * Allows the user to enter comment for own entry.
50 public String enterOwnComment ();
53 * Allows the user to enter own company name.
55 * @return Company name
57 public String enterOwnCompanyName ();
60 * Allows the user to enter own country code.
62 * @return Country code
64 public String enterOwnCountryCode ();
67 * Allows the user to enter own email address.
69 * @return Email address
71 public String enterOwnEmailAddress ();
74 * Allows the user to enter own family name.
78 public String enterOwnFamilyName ();
81 * Allows the user to enter own fax number.
85 public String enterOwnFaxNumber ();
88 * Allows the user to enter own gender.
92 public Gender enterOwnGender ();
95 * Allows the user to enter own phone number.
97 * @return Phone number
99 public String enterOwnPhoneNumber ();
102 * Allows the user to enter own street and house number.
104 * @return Street and house number
106 public String enterOwnStreet ();
109 * Allows the user to enter own surname.
113 public String enterOwnSurname ();
116 * Allows the user to enter own ZIP code.
120 public int enterOwnZipCode ();
125 public void doListContacts ();
128 * Adds given contact to address book
130 * @param contact Contact being added
131 * @todo Add check for book size
133 public void registerContact (final Contact contact);
136 * Adds given Contact instance to list
138 * @param contact Contact instance to add
139 * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If the contact is already added
141 public void addContact (final Contact contact) throws ContactAlreadyAddedException;
144 * Let the user add a new other address
146 public void doAddOtherAddress ();
149 * The user can change address data, like street, ZIP code, city and country
150 * of given Contact instance.
152 * @param contact Instance to change data
154 public void doChangeAddressData (final Contact contact);
157 * The user can change name data, like gender, surname, family name and
158 * company name (if business contact).
160 * @param contact Instance to change data
162 public void doChangeNameData (final Contact contact);
165 * Let the user change other address
167 public void doChangeOtherAddress ();
170 * The user can change other data, like phone numbers or comments.
172 * @param contact Instance to change data
174 public void doChangeOtherData (final Contact contact);
177 * Let the user change own data
178 * @throws java.io.IOException If an IO error was found
179 * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found
181 public void doChangeOwnData () throws IOException , BadTokenException;
184 * Let the user delete other address
186 public void doDeleteOtherAddress ();
189 * Asks user for own data
190 * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If own contact is already added
191 * @throws java.io.IOException If an IO error was found
192 * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found
194 public void doEnterOwnData () throws ContactAlreadyAddedException, IOException , BadTokenException;
197 * Searches address book for a contact
199 public void doSearchContacts ();
202 * Checks whether own contact is already added by checking all entries for
205 * @return Whether own contact is already added
206 * @throws java.io.IOException If an IO error occurs
207 * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found
209 public boolean isOwnContactAdded () throws IOException, BadTokenException;