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 java.lang.reflect.InvocationTargetException;
21 import java.sql.SQLException;
22 import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException;
23 import org.mxchange.jcore.contact.Contact;
24 import org.mxchange.jcore.contact.gender.Gender;
25 import org.mxchange.jcore.exceptions.BadTokenException;
26 import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException;
27 import org.mxchange.jcore.manager.database.ManageableDatabase;
31 * @author Roland Haeder
33 public interface ManageableAddressbookContact extends ManageableDatabase {
35 * Allows the user to enter own cellphone number.
37 * @return Cellphone number
39 public String enterOwnCellNumber ();
42 * Allows the user to enter own city name.
46 public String enterOwnCity ();
49 * Allows the user to enter comment for own entry.
53 public String enterOwnComment ();
56 * Allows the user to enter own company name.
58 * @return Company name
60 public String enterOwnCompanyName ();
63 * Allows the user to enter own country code.
65 * @return Country code
67 public String enterOwnCountryCode ();
70 * Allows the user to enter own email address.
72 * @return Email address
74 public String enterOwnEmailAddress ();
77 * Allows the user to enter own family name.
81 public String enterOwnFamilyName ();
84 * Allows the user to enter own fax number.
88 public String enterOwnFaxNumber ();
91 * Allows the user to enter own gender.
95 public Gender enterOwnGender ();
98 * Allows the user to enter own phone number.
100 * @return Phone number
102 public String enterOwnPhoneNumber ();
105 * Allows the user to enter own street and house number.
107 * @return Street and house number
109 public String enterOwnStreet ();
112 * Allows the user to enter own surname.
116 public String enterOwnFirstName ();
119 * Allows the user to enter own ZIP code.
123 public int enterOwnZipCode ();
128 public void doListContacts ();
131 * Adds given contact to address book
133 * @param contact Contact being added
134 * TODO Add check for book size
136 public void registerContact (final Contact contact);
139 * Adds given Contact instance to list
141 * @param contact Contact instance to add
142 * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If the contact is already added
144 public void addContact (final Contact contact) throws ContactAlreadyAddedException;
147 * Let the user add a new other address
149 public void doAddOtherAddress ();
152 * The user can change address data, like street, ZIP code, city and country
153 * of given Contact instance.
155 * @param contact Instance to change data
157 public void doChangeAddressData (final Contact contact);
160 * The user can change name data, like gender, surname, family name and
161 * company name (if business contact).
163 * @param contact Instance to change data
165 public void doChangeNameData (final Contact contact);
168 * Let the user change other address
170 public void doChangeOtherAddress ();
173 * The user can change other data, like phone numbers or comments.
175 * @param contact Instance to change data
177 public void doChangeOtherData (final Contact contact);
180 * Let the user change own data
181 * @throws java.sql.SQLException If an SQL error occurs
182 * @throws java.io.IOException If an IO error occurs
183 * @throws org.mxchange.jcore.exceptions.BadTokenException Continued throw
184 * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged
185 * @throws java.lang.NoSuchMethodException If a method cannot be found
186 * @throws java.lang.IllegalAccessException If a method is not accessible
187 * @throws java.lang.reflect.InvocationTargetException Any other problems?
189 public void doChangeOwnData () throws IOException , BadTokenException, CorruptedDatabaseFileException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
192 * Let the user delete other address
194 public void doDeleteOtherAddress ();
197 * Asks user for own data
198 * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If own contact is already added
199 * @throws java.io.IOException If an IO error was found
200 * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found
202 public void doEnterOwnData () throws ContactAlreadyAddedException, IOException , BadTokenException;
205 * Searches address book for a contact
207 public void doSearchContacts ();
210 * Checks whether own contact is already added by checking all entries for
213 * @return Whether own contact is already added
214 * @throws java.io.IOException If an IO error occurs
215 * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found
217 public boolean isOwnContactAdded () throws IOException, BadTokenException;