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