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