]> git.mxchange.org Git - addressbook-swing.git/blob - src/org/mxchange/addressbook/facade/contact/ContactFacade.java
Updated copyright year
[addressbook-swing.git] / src / org / mxchange / addressbook / facade / contact / ContactFacade.java
1 /*
2  * Copyright (C) 2016 - 2024 Free Software Foundation
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.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;
29
30 /**
31  * An interface for addressbook contact manager
32  * <p>
33  * @author Roland Häder<roland@mxchange.org>
34  */
35 public interface ContactFacade extends Facade {
36
37         /**
38          * Adds given Contact instance to list
39          * <p>
40          * @param contact Contact instance to add
41          * <p>
42          * @throws BasicDataAlreadyAddedException If the contact is already added
43          */
44         void addContact (final Contact contact) throws BasicDataAlreadyAddedException;
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 ContactAlreadyAddedException If own contact is already added
94          */
95         void doEnterOwnData () throws ContactAlreadyAddedException;
96
97         /**
98          * List all contacts
99          */
100         void doListContacts ();
101
102         /**
103          * Searches address book for a contact
104          */
105         void doSearchContacts ();
106
107         /**
108          * Allows the user to enter own cellphone number.
109          * <p>
110          * @return Cellphone number
111          */
112         DialableMobileNumber enterOwnCellNumber ();
113
114         /**
115          * Allows the user to enter own city name.
116          * <p>
117          * @return City name
118          */
119         String enterOwnCity ();
120
121         /**
122          * Allows the user to enter comment for own entry.
123          * <p>
124          * @return Comment
125          */
126         String enterOwnComment ();
127
128         /**
129          * Allows the user to enter own company name.
130          * <p>
131          * @return Company name
132          */
133         String enterOwnCompanyName ();
134
135         /**
136          * Allows the user to enter own country code.
137          * <p>
138          * @return Country code
139          */
140         Country enterOwnCountryCode ();
141
142         /**
143          * Allows the user to enter own email address.
144          * <p>
145          * @return Email address
146          */
147         String enterOwnEmailAddress ();
148
149         /**
150          * Allows the user to enter own family name.
151          * <p>
152          * @return Family name
153          */
154         String enterOwnFamilyName ();
155
156         /**
157          * Allows the user to enter own fax number.
158          * <p>
159          * @return Fax number
160          */
161         DialableFaxNumber enterOwnFaxNumber ();
162
163         /**
164          * Allows the user to enter own surname.
165          * <p>
166          * @return Surname
167          */
168         String enterOwnFirstName ();
169
170         /**
171          * Allows the user to enter own title.
172          * <p>
173          * @return PersonalTitle
174          */
175         PersonalTitle enterOwnPersonalTitle ();
176
177         /**
178          * Allows the user to enter own phone number.
179          * <p>
180          * @return Phone number
181          */
182         DialableLandLineNumber enterOwnPhoneNumber ();
183
184         /**
185          * Allows the user to enter own street and house number.
186          * <p>
187          * @return Street and house number
188          */
189         String enterOwnStreet ();
190
191         /**
192          * Allows the user to enter own ZIP code.
193          * <p>
194          * @return ZIP code
195          */
196         int enterOwnZipCode ();
197
198         /**
199          * Getter for column count
200          * <p>
201          * @return Column count TODO: This is needed for TableModel in Swing
202          */
203         int getColumnCount ();
204
205         /**
206          * Getter for column name at given index.
207          * <p>
208          * @param columnIndex Column index
209          * <p>
210          * @return Database column name TODO: This is needed for TableModel in Swing
211          */
212         String getColumnName (final int columnIndex);
213
214         /**
215          * Getter for translated column name at given index.
216          * <p>
217          * @param columnIndex Column index
218          * <p>
219          * @return Human-readable column name TODO: This is needed for TableModel in
220          *         Swing
221          */
222         String getTranslatedColumnName (final int columnIndex);
223
224         /**
225          * Somewhat "getter" for value from given row and column index
226          * <p>
227          * @param rowIndex    Row index
228          * @param columnIndex Column index
229          * <p>
230          * @return Value from given row/column
231          */
232         Object getValueFromRowColumn (final int rowIndex, final int columnIndex);
233
234         /**
235          * Checks whether own contact is already added by checking all entries for
236          * isOwnContact flag
237          * <p>
238          * @return Whether own contact is already added
239          * <p>
240          * @throws java.io.IOException If an IO error occurs
241          */
242         boolean isOwnContactAdded () throws IOException;
243
244         /**
245          * Adds given contact to address book
246          * <p>
247          * @param contact Contact being added TODO Add check for book size
248          */
249         void registerContact (final Contact contact);
250
251 }