]> git.mxchange.org Git - jaddressbook-lib.git/blob - Addressbook/src/org/mxchange/addressbook/client/Client.java
Added show() method and in client a simple, textural display
[jaddressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / client / Client.java
1 /*\r
2  * Copyright (C) 2015 Roland Haeder\r
3  *\r
4  * This program is free software: you can redistribute it and/or modify\r
5  * it under the terms of the GNU General Public License as published by\r
6  * the Free Software Foundation, either version 3 of the License, or\r
7  * (at your option) any later version.\r
8  *\r
9  * This program is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  *\r
14  * You should have received a copy of the GNU General Public License\r
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
16  */\r
17 package org.mxchange.addressbook.client;\r
18 \r
19 import org.mxchange.addressbook.FrameworkInterface;\r
20 import org.mxchange.addressbook.contact.Contact;\r
21 import org.mxchange.addressbook.menu.item.SelectableMenuItem;\r
22 \r
23 /**\r
24  *\r
25  * @author Roland Haeder\r
26  */\r
27 public interface Client extends FrameworkInterface {\r
28 \r
29     /**\r
30      * Displays a "box" for the address\r
31      *\r
32      * @param contact Contact to show address from\r
33      */\r
34     public void displayAddressBox (final Contact contact);\r
35 \r
36     /**\r
37      * Displays a message to the user\r
38      *\r
39      * @param message Message to show to the user\r
40      */\r
41     public void displayMessage (final String message);\r
42 \r
43     /**\r
44      * Displays a "box" for the name\r
45      *\r
46      * @param contact Contact to show name from\r
47      */\r
48     public void displayNameBox (final Contact contact);\r
49 \r
50     /**\r
51      * Displays a "box" for other data\r
52      *\r
53      * @param contact Contact to show other data from\r
54      */\r
55     public void displayOtherDataBox (final Contact contact);\r
56 \r
57     /**\r
58      * Asks the user for a choice and proceeds accordingly\r
59      * @throws java.lang.Exception\r
60      */\r
61     public void doUserChoice () throws Exception ;\r
62 \r
63     /**\r
64      * Enables isRunning attribute which singals that the client is running\r
65      */\r
66     public void enableIsRunning ();\r
67 \r
68     /**\r
69      * Asks the the user to enter a single character which must match validChars\r
70      * @param   validChars  Valid chars that are accepted\r
71      * @param   message     Message to user\r
72      * @return  Allowed character\r
73      */\r
74     public char enterChar (final char[] validChars, final String message);\r
75 \r
76     /**\r
77      * Reads a string of minimum and maximum length from the user\r
78      * @param minLength Minimum length of the string to read\r
79      * @param maxLength Maximum length of the string to read\r
80      * @param message   Message to user\r
81      * @return \r
82      */\r
83     public String enterString (final int minLength, final int maxLength, final String message);\r
84 \r
85     /**\r
86      * Setter for current menu choice\r
87      * @param currentMenu Current menu choice\r
88      */\r
89     public void setCurrentMenu (final String currentMenu);\r
90 \r
91     /**\r
92      * Some "Getter" for menu item\r
93      * @param accessKey Key to press to access this menu\r
94      * @param text Text to show to user\r
95      * @return \r
96      */\r
97     public SelectableMenuItem getMenuItem (final char accessKey, final String text);\r
98 \r
99     /**\r
100      * Determines whether the application is still active by checking some\r
101      * conditions\r
102      * \r
103      * @return Whether the application is still active\r
104      */\r
105     public boolean isApplicationRunning ();\r
106 \r
107     /**\r
108      * Shows given menu entry in client\r
109      * @param item Menu item to show\r
110      */\r
111     public void showEntry (final SelectableMenuItem item);\r
112 \r
113     /**\r
114      * Shows introduction to user\r
115      */\r
116     public void showWelcome ();\r
117 \r
118     /**\r
119      * Shows current menu selection to the user\r
120      */\r
121     public void showCurrentMenu ();\r
122 }\r