2 * Copyright (C) 2016 - 2022 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.exceptions.ContactAlreadyAddedException;
21 import org.mxchange.jcontacts.model.contact.Contact;
22 import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
23 import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException;
24 import org.mxchange.jcore.facade.Facade;
25 import org.mxchange.jcountry.model.data.Country;
26 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
27 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
28 import org.mxchange.jphone.model.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
42 * @throws BasicDataAlreadyAddedException If the contact is already added
44 void addContact (final Contact contact) throws BasicDataAlreadyAddedException;
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 title, 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 ContactAlreadyAddedException If own contact is already added
95 void doEnterOwnData () throws ContactAlreadyAddedException;
100 void doListContacts ();
103 * Searches address book for a contact
105 void doSearchContacts ();
108 * Allows the user to enter own cellphone number.
110 * @return Cellphone number
112 DialableMobileNumber enterOwnCellNumber ();
115 * Allows the user to enter own city name.
119 String enterOwnCity ();
122 * Allows the user to enter comment for own entry.
126 String enterOwnComment ();
129 * Allows the user to enter own company name.
131 * @return Company name
133 String enterOwnCompanyName ();
136 * Allows the user to enter own country code.
138 * @return Country code
140 Country enterOwnCountryCode ();
143 * Allows the user to enter own email address.
145 * @return Email address
147 String enterOwnEmailAddress ();
150 * Allows the user to enter own family name.
152 * @return Family name
154 String enterOwnFamilyName ();
157 * Allows the user to enter own fax number.
161 DialableFaxNumber enterOwnFaxNumber ();
164 * Allows the user to enter own surname.
168 String enterOwnFirstName ();
171 * Allows the user to enter own title.
173 * @return PersonalTitle
175 PersonalTitle enterOwnPersonalTitle ();
178 * Allows the user to enter own phone number.
180 * @return Phone number
182 DialableLandLineNumber enterOwnPhoneNumber ();
185 * Allows the user to enter own street and house number.
187 * @return Street and house number
189 String enterOwnStreet ();
192 * Allows the user to enter own ZIP code.
196 int enterOwnZipCode ();
199 * Getter for column count
201 * @return Column count TODO: This is needed for TableModel in Swing
203 int getColumnCount ();
206 * Getter for column name at given index.
208 * @param columnIndex Column index
210 * @return Database column name TODO: This is needed for TableModel in Swing
212 String getColumnName (final int columnIndex);
215 * Getter for translated column name at given index.
217 * @param columnIndex Column index
219 * @return Human-readable column name TODO: This is needed for TableModel in
222 String getTranslatedColumnName (final int columnIndex);
225 * Somewhat "getter" for value from given row and column index
227 * @param rowIndex Row index
228 * @param columnIndex Column index
230 * @return Value from given row/column
232 Object getValueFromRowColumn (final int rowIndex, final int columnIndex);
235 * Checks whether own contact is already added by checking all entries for
238 * @return Whether own contact is already added
240 * @throws java.io.IOException If an IO error occurs
242 boolean isOwnContactAdded () throws IOException;
245 * Adds given contact to address book
247 * @param contact Contact being added TODO Add check for book size
249 void registerContact (final Contact contact);