2 * Copyright (C) 2016 - 2020 Free Software Foundation
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.title.PersonalTitle;
22 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
23 import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataAlreadyAddedException;
24 import org.mxchange.jcore.facade.Facade;
25 import org.mxchange.jcountry.data.Country;
26 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
27 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
28 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
31 * An interface for addressbook contact manager
33 * @author Roland Häder<roland@mxchange.org>
35 public interface ContactFacade extends Facade {
38 * Adds given Contact instance to list
40 * @param contact Contact instance to add
43 * org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataAlreadyAddedException
44 * If the contact is already added
46 void addContact (final Contact contact) throws BusinessDataAlreadyAddedException;
49 * Let the user add a new other address
51 void doAddOtherAddress ();
54 * The user can change address data, like street, ZIP code, city and country
55 * of given Contact instance.
57 * @param contact Instance to change data
59 void doChangeAddressData (final Contact contact);
62 * The user can change name data, like title, surname, family name and
63 * company name (if business contact).
65 * @param contact Instance to change data
67 void doChangeNameData (final Contact contact);
70 * Let the user change other address
72 void doChangeOtherAddress ();
75 * The user can change other data, like phone numbers or comments.
77 * @param contact Instance to change data
79 void doChangeOtherData (final Contact contact);
82 * Let the user change own data
85 void doChangeOwnData ();
88 * Let the user delete other address
90 void doDeleteOtherAddress ();
93 * Asks user for own data
95 * @throws ContactAlreadyAddedException If own contact is already added
97 void doEnterOwnData () throws ContactAlreadyAddedException;
102 void doListContacts ();
105 * Searches address book for a contact
107 void doSearchContacts ();
110 * Allows the user to enter own cellphone number.
112 * @return Cellphone number
114 DialableMobileNumber enterOwnCellNumber ();
117 * Allows the user to enter own city name.
121 String enterOwnCity ();
124 * Allows the user to enter comment for own entry.
128 String enterOwnComment ();
131 * Allows the user to enter own company name.
133 * @return Company name
135 String enterOwnCompanyName ();
138 * Allows the user to enter own country code.
140 * @return Country code
142 Country enterOwnCountryCode ();
145 * Allows the user to enter own email address.
147 * @return Email address
149 String enterOwnEmailAddress ();
152 * Allows the user to enter own family name.
154 * @return Family name
156 String enterOwnFamilyName ();
159 * Allows the user to enter own fax number.
163 DialableFaxNumber enterOwnFaxNumber ();
166 * Allows the user to enter own surname.
170 String enterOwnFirstName ();
173 * Allows the user to enter own title.
175 * @return PersonalTitle
177 PersonalTitle enterOwnPersonalTitle ();
180 * Allows the user to enter own phone number.
182 * @return Phone number
184 DialableLandLineNumber enterOwnPhoneNumber ();
187 * Allows the user to enter own street and house number.
189 * @return Street and house number
191 String enterOwnStreet ();
194 * Allows the user to enter own ZIP code.
198 int enterOwnZipCode ();
201 * Getter for column count
203 * @return Column count TODO: This is needed for TableModel in Swing
205 int getColumnCount ();
208 * Getter for column name at given index.
210 * @param columnIndex Column index
212 * @return Database column name TODO: This is needed for TableModel in Swing
214 String getColumnName (final int columnIndex);
217 * Getter for translated column name at given index.
219 * @param columnIndex Column index
221 * @return Human-readable column name TODO: This is needed for TableModel in
224 String getTranslatedColumnName (final int columnIndex);
227 * Somewhat "getter" for value from given row and column index
229 * @param rowIndex Row index
230 * @param columnIndex Column index
232 * @return Value from given row/column
234 Object getValueFromRowColumn (final int rowIndex, final int columnIndex);
237 * Checks whether own contact is already added by checking all entries for
240 * @return Whether own contact is already added
242 * @throws java.io.IOException If an IO error occurs
244 boolean isOwnContactAdded () throws IOException;
247 * Adds given contact to address book
249 * @param contact Contact being added TODO Add check for book size
251 void registerContact (final Contact contact);