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