package cgeo.geocaching.connector.capability;

import cgeo.geocaching.connector.IConnector;

import android.content.Context;
import android.os.Handler;

public interface ILogin extends IConnector {


    /**
     * Contacts the server the connector belongs to
     * and verifies/establishes authentication and
     * retrieves information about the current user
     * (Name, found caches) if applicable.
     * 
     * @param handler
     *            Handler to receive status feedback
     * @param fromActivity
     *            Calling activity context
     * @return true in case of success, false in case of failure
     */
    boolean login(Handler handler, Context fromActivity);

    /**
     * Log out of the connector if possible.
     */
    void logout();

    /**
     * Returns the status of the last {@link}login() request
     *
     * @return
     */
    boolean isLoggedIn();

    /**
     * User-centered string describing the current login/connection status
     *
     * @return
     */
    String getLoginStatusString();

    /**
     * Name the user has in this connector or empty string if not applicable
     * It might be necessary to execute login before this information is valid.
     *
     * @return
     */
    String getUserName();

    /**
     * Number of caches the user has found in this connector
     * Normally retrieved/updated with (@see login).
     * Might be out dated as changes on the connectors site
     * are generally not notified.
     *
     * @return
     */
    int getCachesFound();

}

@@ -192,17 +192,16 @@
 ctor %7B%0A%0A
-%0A
     /**%0A
@@ -251,23 +251,16 @@
 longs to
-%0A     *
  and ver
@@ -295,23 +295,16 @@
 tion and
-%0A     *
  retriev
@@ -317,16 +317,23 @@
 ormation
+%0A     *
  about t
@@ -347,23 +347,16 @@
 ent user
-%0A     *
  (Name, 
@@ -390,17 +390,16 @@
 .%0A     *
- 
 %0A     * 
@@ -805,24 +805,42 @@
 link
-%7D
+ #
 login(
-)
+Handler, Context)%7D
  request
 %0A   
@@ -835,16 +835,17 @@
  request
+.
 %0A     *%0A
@@ -1127,16 +1127,17 @@
 plicable
+.
 %0A     * 
@@ -1169,21 +1169,48 @@
 execute 
-login
+%7B@link #login(Handler, Context)%7D
  before 
@@ -1361,16 +1361,17 @@
 onnector
+.
 %0A     * 
@@ -1406,20 +1406,40 @@
 ith 
-(@see login)
+%7B@link #login(Handler, Context)%7D
 .%0A  
@@ -1456,17 +1456,13 @@
  be 
-out dated
+stale
  as 
@@ -1491,23 +1491,16 @@
 ors site
-%0A     *
  are gen

rework Javadoc