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.manager.Manageable;
29 * @author Roland Haeder
31 public interface ManageableAddressbookContact extends Manageable {
33 * Allows the user to enter own cellphone number.
35 * @return Cellphone number
37 public String enterOwnCellNumber ();
40 * Allows the user to enter own city name.
44 public String enterOwnCity ();
47 * Allows the user to enter comment for own entry.
51 public String enterOwnComment ();
54 * Allows the user to enter own company name.
56 * @return Company name
58 public String enterOwnCompanyName ();
61 * Allows the user to enter own country code.
63 * @return Country code
65 public String enterOwnCountryCode ();
68 * Allows the user to enter own email address.
70 * @return Email address
72 public String enterOwnEmailAddress ();
75 * Allows the user to enter own family name.
79 public String enterOwnFamilyName ();
82 * Allows the user to enter own fax number.
86 public String enterOwnFaxNumber ();
89 * Allows the user to enter own gender.
93 public Gender enterOwnGender ();
96 * Allows the user to enter own phone number.
98 * @return Phone number
100 public String enterOwnPhoneNumber ();
103 * Allows the user to enter own street and house number.
105 * @return Street and house number
107 public String enterOwnStreet ();
110 * Allows the user to enter own surname.
114 public String enterOwnFirstName ();
117 * Allows the user to enter own ZIP code.
121 public int enterOwnZipCode ();
126 public void doListContacts ();
129 * Adds given contact to address book
131 * @param contact Contact being added
132 * TODO Add check for book size
134 public void registerContact (final Contact contact);
137 * Adds given Contact instance to list
139 * @param contact Contact instance to add
140 * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If the contact is already added
142 public void addContact (final Contact contact) throws ContactAlreadyAddedException;
145 * Let the user add a new other address
147 public void doAddOtherAddress ();
150 * The user can change address data, like street, ZIP code, city and country
151 * of given Contact instance.
153 * @param contact Instance to change data
155 public void doChangeAddressData (final Contact contact);
158 * The user can change name data, like gender, surname, family name and
159 * company name (if business contact).
161 * @param contact Instance to change data
163 public void doChangeNameData (final Contact contact);
166 * Let the user change other address
168 public void doChangeOtherAddress ();
171 * The user can change other data, like phone numbers or comments.
173 * @param contact Instance to change data
175 public void doChangeOtherData (final Contact contact);
178 * Let the user change own data
179 * @throws java.sql.SQLException If an SQL error occurs
180 * @throws java.io.IOException If an IO error occurs
181 * @throws java.lang.NoSuchMethodException If a method cannot be found
182 * @throws java.lang.IllegalAccessException If a method is not accessible
183 * @throws java.lang.reflect.InvocationTargetException Any other problems?
185 public void doChangeOwnData () throws IOException , SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
188 * Let the user delete other address
190 public void doDeleteOtherAddress ();
193 * Asks user for own data
194 * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If own contact is already added
195 * @throws java.io.IOException If an IO error was found
197 public void doEnterOwnData () throws ContactAlreadyAddedException, IOException;
200 * Searches address book for a contact
202 public void doSearchContacts ();
205 * Checks whether own contact is already added by checking all entries for
208 * @return Whether own contact is already added
209 * @throws java.io.IOException If an IO error occurs
211 public boolean isOwnContactAdded () throws IOException;
214 * Getter for translated column name at given index.
216 * @param columnIndex Column index
217 * @return Human-readable column name
218 * TODO: This is needed for TableModel in Swing
220 public String getTranslatedColumnName (final int columnIndex);
223 * Somewhat "getter" for value from given row and column index
225 * @param rowIndex Row index
226 * @param columnIndex Column index
227 * @return Value from given row/column
228 * @throws java.lang.NoSuchMethodException If the method was not found
229 * @throws java.lang.IllegalAccessException If the accessed method was not public
230 * @throws java.lang.reflect.InvocationTargetException Something else happened?
231 * TODO: This is needed for TableModel in Swing
233 public Object getValueFromRowColumn (final int rowIndex, final int columnIndex) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;
236 * Getter for column name at given index.
238 * @param columnIndex Column index
239 * @return Database column name
240 * TODO: This is needed for TableModel in Swing
242 public String getColumnName (final int columnIndex);
245 * Getter for column count
246 * @return Column count
247 * TODO: This is needed for TableModel in Swing
249 public int getColumnCount ();