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