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.manager.Manageable;
24 import org.mxchange.jcore.model.contact.Contact;
25 import org.mxchange.jcore.model.contact.gender.Gender;
28 * An interface for addressbook contact manager
30 * @author Roland Haeder
32 public interface ManageableContactAddressbook extends Manageable {
34 * Allows the user to enter own cellphone number.
36 * @return Cellphone number
38 public String enterOwnCellNumber ();
41 * Allows the user to enter own city name.
45 public String enterOwnCity ();
48 * Allows the user to enter comment for own entry.
52 public String enterOwnComment ();
55 * Allows the user to enter own company name.
57 * @return Company name
59 public String enterOwnCompanyName ();
62 * Allows the user to enter own country code.
64 * @return Country code
66 public String enterOwnCountryCode ();
69 * Allows the user to enter own email address.
71 * @return Email address
73 public String enterOwnEmailAddress ();
76 * Allows the user to enter own family name.
80 public String enterOwnFamilyName ();
83 * Allows the user to enter own fax number.
87 public String enterOwnFaxNumber ();
90 * Allows the user to enter own gender.
94 public Gender enterOwnGender ();
97 * Allows the user to enter own phone number.
99 * @return Phone number
101 public String enterOwnPhoneNumber ();
104 * Allows the user to enter own street and house number.
106 * @return Street and house number
108 public String enterOwnStreet ();
111 * Allows the user to enter own surname.
115 public String enterOwnFirstName ();
118 * Allows the user to enter own ZIP code.
122 public int enterOwnZipCode ();
127 public void doListContacts ();
130 * Adds given contact to address book
132 * @param contact Contact being added
133 * TODO Add check for book size
135 public void registerContact (final Contact contact);
138 * Adds given Contact instance to list
140 * @param contact Contact instance to add
141 * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If the contact is already added
143 public void addContact (final Contact contact) throws ContactAlreadyAddedException;
146 * Let the user add a new other address
148 public void doAddOtherAddress ();
151 * The user can change address data, like street, ZIP code, city and country
152 * of given Contact instance.
154 * @param contact Instance to change data
156 public void doChangeAddressData (final Contact contact);
159 * The user can change name data, like gender, surname, family name and
160 * company name (if business contact).
162 * @param contact Instance to change data
164 public void doChangeNameData (final Contact contact);
167 * Let the user change other address
169 public void doChangeOtherAddress ();
172 * The user can change other data, like phone numbers or comments.
174 * @param contact Instance to change data
176 public void doChangeOtherData (final Contact contact);
179 * Let the user change own data
180 * @throws java.sql.SQLException If an SQL error occurs
181 * @throws java.io.IOException If an IO error occurs
182 * @throws java.lang.NoSuchMethodException If a method cannot be found
183 * @throws java.lang.IllegalAccessException If a method is not accessible
184 * @throws java.lang.reflect.InvocationTargetException Any other problems?
186 public void doChangeOwnData () throws IOException , SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
189 * Let the user delete other address
191 public void doDeleteOtherAddress ();
194 * Asks user for own data
195 * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If own contact is already added
196 * @throws java.io.IOException If an IO error was found
198 public void doEnterOwnData () throws ContactAlreadyAddedException, IOException;
201 * Searches address book for a contact
203 public void doSearchContacts ();
206 * Checks whether own contact is already added by checking all entries for
209 * @return Whether own contact is already added
210 * @throws java.io.IOException If an IO error occurs
212 public boolean isOwnContactAdded () throws IOException;
215 * Getter for translated column name at given index.
217 * @param columnIndex Column index
218 * @return Human-readable column name
219 * TODO: This is needed for TableModel in Swing
221 public String getTranslatedColumnName (final int columnIndex);
224 * Somewhat "getter" for value from given row and column index
226 * @param rowIndex Row index
227 * @param columnIndex Column index
228 * @return Value from given row/column
229 * @throws java.lang.NoSuchMethodException If the method was not found
230 * @throws java.lang.IllegalAccessException If the accessed method was not public
231 * @throws java.lang.reflect.InvocationTargetException Something else happened?
232 * TODO: This is needed for TableModel in Swing
234 public Object getValueFromRowColumn (final int rowIndex, final int columnIndex) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;
237 * Getter for column name at given index.
239 * @param columnIndex Column index
240 * @return Database column name
241 * TODO: This is needed for TableModel in Swing
243 public String getColumnName (final int columnIndex);
246 * Getter for column count
247 * @return Column count
248 * TODO: This is needed for TableModel in Swing
250 public int getColumnCount ();