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.facade.contact;
19 import java.io.IOException;
20 import org.mxchange.jcontacts.contact.Contact;
21 import org.mxchange.jcontacts.contact.gender.Gender;
22 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
23 import org.mxchange.jcore.facade.Facade;
24 import org.mxchange.jcountry.data.Country;
25 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
26 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
27 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
30 * An interface for addressbook contact manager
32 * @author Roland Haeder
34 public interface ContactFacade extends Facade {
37 * Adds given Contact instance to list
39 * @param contact Contact instance to add
41 * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException If
42 * the contact is already added
44 void addContact (final Contact contact) throws ContactAlreadyAddedException;
47 * Let the user add a new other address
49 void doAddOtherAddress ();
52 * The user can change address data, like street, ZIP code, city and country
53 * of given Contact instance.
55 * @param contact Instance to change data
57 void doChangeAddressData (final Contact contact);
60 * The user can change name data, like gender, surname, family name and
61 * company name (if business contact).
63 * @param contact Instance to change data
65 void doChangeNameData (final Contact contact);
68 * Let the user change other address
70 void doChangeOtherAddress ();
73 * The user can change other data, like phone numbers or comments.
75 * @param contact Instance to change data
77 void doChangeOtherData (final Contact contact);
80 * Let the user change own data
83 void doChangeOwnData ();
86 * Let the user delete other address
88 void doDeleteOtherAddress ();
91 * Asks user for own data
93 * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException If
94 * own contact is already added
96 void doEnterOwnData () throws ContactAlreadyAddedException;
101 void doListContacts ();
104 * Searches address book for a contact
106 void doSearchContacts ();
109 * Allows the user to enter own cellphone number.
111 * @return Cellphone number
113 DialableCellphoneNumber enterOwnCellNumber ();
116 * Allows the user to enter own city name.
120 String enterOwnCity ();
123 * Allows the user to enter comment for own entry.
127 String enterOwnComment ();
130 * Allows the user to enter own company name.
132 * @return Company name
134 String enterOwnCompanyName ();
137 * Allows the user to enter own country code.
139 * @return Country code
141 Country enterOwnCountryCode ();
144 * Allows the user to enter own email address.
146 * @return Email address
148 String enterOwnEmailAddress ();
151 * Allows the user to enter own family name.
153 * @return Family name
155 String enterOwnFamilyName ();
158 * Allows the user to enter own fax number.
162 DialableFaxNumber enterOwnFaxNumber ();
165 * Allows the user to enter own surname.
169 String enterOwnFirstName ();
172 * Allows the user to enter own gender.
176 Gender enterOwnGender ();
179 * Allows the user to enter own phone number.
181 * @return Phone number
183 DialableLandLineNumber enterOwnPhoneNumber ();
186 * Allows the user to enter own street and house number.
188 * @return Street and house number
190 String enterOwnStreet ();
193 * Allows the user to enter own ZIP code.
197 int enterOwnZipCode ();
200 * Getter for column count
202 * @return Column count TODO: This is needed for TableModel in Swing
204 int getColumnCount ();
207 * Getter for column name at given index.
209 * @param columnIndex Column index
211 * @return Database column name TODO: This is needed for TableModel in Swing
213 String getColumnName (final int columnIndex);
216 * Getter for translated column name at given index.
218 * @param columnIndex Column index
220 * @return Human-readable column name TODO: This is needed for TableModel in
223 String getTranslatedColumnName (final int columnIndex);
226 * Somewhat "getter" for value from given row and column index
228 * @param rowIndex Row index
229 * @param columnIndex Column index
231 * @return Value from given row/column
233 Object getValueFromRowColumn (final int rowIndex, final int columnIndex);
236 * Checks whether own contact is already added by checking all entries for
239 * @return Whether own contact is already added
241 * @throws java.io.IOException If an IO error occurs
243 boolean isOwnContactAdded () throws IOException;
246 * Adds given contact to address book
248 * @param contact Contact being added TODO Add check for book size
250 void registerContact (final Contact contact);