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