]> git.mxchange.org Git - addressbook-swing.git/blob - src/org/mxchange/addressbook/facade/contact/ContactFacade.java
using gender for Mr./Mrs. is plain wrong, now "personal title" and "academic
[addressbook-swing.git] / src / org / mxchange / addressbook / facade / contact / ContactFacade.java
1 /*
2  * Copyright (C) 2016, 2017 Roland Häder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.addressbook.facade.contact;
18
19 import java.io.IOException;
20 import org.mxchange.jcontacts.contact.Contact;
21 import org.mxchange.jcontacts.contact.title.PersonalTitle;
22 import org.mxchange.jcontactsbusiness.exceptions.BusinessContactAlreadyAddedException;
23 import org.mxchange.jcore.facade.Facade;
24 import org.mxchange.jcountry.data.Country;
25 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
26 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
27 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
28
29 /**
30  * An interface for addressbook contact manager
31  * <p>
32  * @author Roland Häder<roland@mxchange.org>
33  */
34 public interface ContactFacade extends Facade {
35
36         /**
37          * Adds given Contact instance to list
38          * <p>
39          * @param contact Contact instance to add
40          * <p>
41          * @throws org.mxchange.jcontactsbusiness.exceptions.BusinessContactAlreadyAddedException If
42          * the contact is already added
43          */
44         void addContact (final Contact contact) throws BusinessContactAlreadyAddedException;
45
46         /**
47          * Let the user add a new other address
48          */
49         void doAddOtherAddress ();
50
51         /**
52          * The user can change address data, like street, ZIP code, city and country
53          * of given Contact instance.
54          * <p>
55          * @param contact Instance to change data
56          */
57         void doChangeAddressData (final Contact contact);
58
59         /**
60          * The user can change name data, like title, surname, family name and
61          * company name (if business contact).
62          * <p>
63          * @param contact Instance to change data
64          */
65         void doChangeNameData (final Contact contact);
66
67         /**
68          * Let the user change other address
69          */
70         void doChangeOtherAddress ();
71
72         /**
73          * The user can change other data, like phone numbers or comments.
74          * <p>
75          * @param contact Instance to change data
76          */
77         void doChangeOtherData (final Contact contact);
78
79         /**
80          * Let the user change own data
81          * <p>
82          */
83         void doChangeOwnData ();
84
85         /**
86          * Let the user delete other address
87          */
88         void doDeleteOtherAddress ();
89
90         /**
91          * Asks user for own data
92          * <p>
93          * @throws org.mxchange.jcontactsbusiness.exceptions.BusinessContactAlreadyAddedException If
94          * own contact is already added
95          */
96         void doEnterOwnData () throws BusinessContactAlreadyAddedException;
97
98         /**
99          * List all contacts
100          */
101         void doListContacts ();
102
103         /**
104          * Searches address book for a contact
105          */
106         void doSearchContacts ();
107
108         /**
109          * Allows the user to enter own cellphone number.
110          * <p>
111          * @return Cellphone number
112          */
113         DialableMobileNumber enterOwnCellNumber ();
114
115         /**
116          * Allows the user to enter own city name.
117          * <p>
118          * @return City name
119          */
120         String enterOwnCity ();
121
122         /**
123          * Allows the user to enter comment for own entry.
124          * <p>
125          * @return Comment
126          */
127         String enterOwnComment ();
128
129         /**
130          * Allows the user to enter own company name.
131          * <p>
132          * @return Company name
133          */
134         String enterOwnCompanyName ();
135
136         /**
137          * Allows the user to enter own country code.
138          * <p>
139          * @return Country code
140          */
141         Country enterOwnCountryCode ();
142
143         /**
144          * Allows the user to enter own email address.
145          * <p>
146          * @return Email address
147          */
148         String enterOwnEmailAddress ();
149
150         /**
151          * Allows the user to enter own family name.
152          * <p>
153          * @return Family name
154          */
155         String enterOwnFamilyName ();
156
157         /**
158          * Allows the user to enter own fax number.
159          * <p>
160          * @return Fax number
161          */
162         DialableFaxNumber enterOwnFaxNumber ();
163
164         /**
165          * Allows the user to enter own surname.
166          * <p>
167          * @return Surname
168          */
169         String enterOwnFirstName ();
170
171         /**
172          * Allows the user to enter own title.
173          * <p>
174          * @return PersonalTitle
175          */
176         PersonalTitle enterOwnPersonalTitle ();
177
178         /**
179          * Allows the user to enter own phone number.
180          * <p>
181          * @return Phone number
182          */
183         DialableLandLineNumber enterOwnPhoneNumber ();
184
185         /**
186          * Allows the user to enter own street and house number.
187          * <p>
188          * @return Street and house number
189          */
190         String enterOwnStreet ();
191
192         /**
193          * Allows the user to enter own ZIP code.
194          * <p>
195          * @return ZIP code
196          */
197         int enterOwnZipCode ();
198
199         /**
200          * Getter for column count
201          * <p>
202          * @return Column count TODO: This is needed for TableModel in Swing
203          */
204         int getColumnCount ();
205
206         /**
207          * Getter for column name at given index.
208          * <p>
209          * @param columnIndex Column index
210          * <p>
211          * @return Database column name TODO: This is needed for TableModel in Swing
212          */
213         String getColumnName (final int columnIndex);
214
215         /**
216          * Getter for translated column name at given index.
217          * <p>
218          * @param columnIndex Column index
219          * <p>
220          * @return Human-readable column name TODO: This is needed for TableModel in
221          * Swing
222          */
223         String getTranslatedColumnName (final int columnIndex);
224
225         /**
226          * Somewhat "getter" for value from given row and column index
227          * <p>
228          * @param rowIndex Row index
229          * @param columnIndex Column index
230          * <p>
231          * @return Value from given row/column
232          */
233         Object getValueFromRowColumn (final int rowIndex, final int columnIndex);
234
235         /**
236          * Checks whether own contact is already added by checking all entries for
237          * isOwnContact flag
238          * <p>
239          * @return Whether own contact is already added
240          * <p>
241          * @throws java.io.IOException If an IO error occurs
242          */
243         boolean isOwnContactAdded () throws IOException;
244
245         /**
246          * Adds given contact to address book
247          * <p>
248          * @param contact Contact being added TODO Add check for book size
249          */
250         void registerContact (final Contact contact);
251 }