package be.nikiroo.jvcard.tui;
+import java.io.File;
+
import be.nikiroo.jvcard.Card;
import be.nikiroo.jvcard.Contact;
import be.nikiroo.jvcard.Data;
* @author niki
*
*/
- enum Mode {
- NONE, MOVE, BACK, HELP, CONTACT_LIST, CONTACT_DETAILS, SWICTH_FORMAT,
+ public enum Mode {
+ NONE, MOVE, BACK, HELP, FILE_LIST, CONTACT_LIST, CONTACT_DETAILS_RAW, CONTACT_DETAILS, ASK_USER, ASK_USER_KEY,
}
- enum DataType {
- CONTACT, CARD, DATA, NONE
+ public enum DataType {
+ /**
+ * A list of Card {@link File}s.
+ */
+ CARD_FILES,
+ /**
+ * Contains a list of contacts.
+ */
+ CARD,
+ /**
+ * All the known informations about a specific contact person or
+ * company.
+ */
+ CONTACT,
+ /**
+ * An information about a contact.
+ */
+ DATA,
+ /**
+ * Empty.
+ */
+ NONE
}
private StringId id;
return null;
}
- // override this one if needed
+ // override this one if needed, DO NOT process here as it will be call a lot
public Object getObject() {
return null;
}
/**
* The method which is called when the action is performed. You can subclass
- * it if you want to customize the action (by default, it just accepts the
+ * it if you want to customise the action (by default, it just accepts the
* mode change (see {@link KeyAction#getMode}).
*
* @return false to cancel mode change
public boolean onAction() {
return true;
}
+
+ /**
+ * Used to callback a function from the menu when the user has to introduce
+ * some text.
+ *
+ * @param answer
+ * the user answer
+ *
+ * @return an error message if any
+ */
+ public String callback(String answer) {
+ return null;
+ }
+
+ /**
+ * When asking a question to the user, return the question.
+ *
+ * @return the question
+ */
+ public String getQuestion() {
+ return null;
+ }
+
+ /**
+ * When asking a question to the user (not for one-key mode), return the
+ * default answer.
+ *
+ * @return the default answer
+ */
+ public String getDefaultAnswer() {
+ return null;
+ }
}