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;
26 * An interface for addressbook contact manager
28 * @author Roland Haeder
30 public interface ContactFacade extends Facade {
33 * Adds given Contact instance to list
35 * @param contact Contact instance to add
36 * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException If the contact is already added
38 public void addContact (final Contact contact) throws ContactAlreadyAddedException;
41 * Let the user add a new other address
43 public void doAddOtherAddress ();
46 * The user can change address data, like street, ZIP code, city and country
47 * of given Contact instance.
49 * @param contact Instance to change data
51 public void doChangeAddressData (final Contact contact);
54 * The user can change name data, like gender, surname, family name and
55 * company name (if business contact).
57 * @param contact Instance to change data
59 public void doChangeNameData (final Contact contact);
62 * Let the user change other address
64 public void doChangeOtherAddress ();
67 * The user can change other data, like phone numbers or comments.
69 * @param contact Instance to change data
71 public void doChangeOtherData (final Contact contact);
74 * Let the user change own data
77 public void doChangeOwnData ();
80 * Let the user delete other address
82 public void doDeleteOtherAddress ();
85 * Asks user for own data
87 * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException If own contact is already added
88 * @throws java.io.IOException If an IO error was found
90 public void doEnterOwnData () throws ContactAlreadyAddedException;
95 public void doListContacts ();
98 * Searches address book for a contact
100 public void doSearchContacts ();
103 * Allows the user to enter own cellphone number.
105 * @return Cellphone number
107 public String enterOwnCellNumber ();
110 * Allows the user to enter own city name.
114 public String enterOwnCity ();
117 * Allows the user to enter comment for own entry.
121 public String enterOwnComment ();
124 * Allows the user to enter own company name.
126 * @return Company name
128 public String enterOwnCompanyName ();
131 * Allows the user to enter own country code.
133 * @return Country code
135 public String enterOwnCountryCode ();
138 * Allows the user to enter own email address.
140 * @return Email address
142 public String enterOwnEmailAddress ();
145 * Allows the user to enter own family name.
147 * @return Family name
149 public String enterOwnFamilyName ();
152 * Allows the user to enter own fax number.
156 public String enterOwnFaxNumber ();
159 * Allows the user to enter own surname.
163 public String enterOwnFirstName ();
166 * Allows the user to enter own gender.
170 public Gender enterOwnGender ();
173 * Allows the user to enter own phone number.
175 * @return Phone number
177 public String enterOwnPhoneNumber ();
180 * Allows the user to enter own street and house number.
182 * @return Street and house number
184 public String enterOwnStreet ();
187 * Allows the user to enter own ZIP code.
191 public int enterOwnZipCode ();
194 * Getter for column count
196 * @return Column count TODO: This is needed for TableModel in Swing
198 public int getColumnCount ();
201 * Getter for column name at given index.
203 * @param columnIndex Column index
204 * @return Database column name TODO: This is needed for TableModel in Swing
206 public String getColumnName (final int columnIndex);
209 * Getter for translated column name at given index.
211 * @param columnIndex Column index
212 * @return Human-readable column name TODO: This is needed for TableModel in
215 public String getTranslatedColumnName (final int columnIndex);
218 * Somewhat "getter" for value from given row and column index
220 * @param rowIndex Row index
221 * @param columnIndex Column index
222 * @return Value from given row/column
224 public Object getValueFromRowColumn (final int rowIndex, final int columnIndex);
227 * Checks whether own contact is already added by checking all entries for
230 * @return Whether own contact is already added
231 * @throws java.io.IOException If an IO error occurs
233 public boolean isOwnContactAdded () throws IOException;
236 * Adds given contact to address book
238 * @param contact Contact being added TODO Add check for book size
240 public void registerContact (final Contact contact);