package de.geeksfactory.opacclient.apis;

import java.io.IOException;

import org.json.JSONException;

import android.net.Uri;
import de.geeksfactory.opacclient.objects.Account;
import de.geeksfactory.opacclient.objects.AccountData;
import de.geeksfactory.opacclient.objects.DetailledItem;

/**
 * If an {@link OpacApi} implementation also implements this interface, the
 * library can be used to download ebooks directly inside the app. This is
 * currently NOT implemented or used in the open source version and is more
 * like a bridge between the "Community Edition" and the "Plus Edition" of the App.
 * 
 * @author Raphael Michel
 */
public interface EbookServiceApi {

	public AccountData account(Account account) throws IOException,
			JSONException;

	public enum Availability {
		AVAILABLE, UNAVAILABLE, ERROR
	}

	/**
	 * Check whether an item, identified by item_id in the ebook system is
	 * currently available for download.
	 */
	public Availability getAvailability(String item_id);

	/**
	 * The result of a {@link #booking(String, Account, int, String)} call
	 */
	public class BookingResult extends OpacApi.ReservationResult {

		public BookingResult(Status status) {
			super(status);
		}
	}

	/**
	 * Book an electronical item identified by booking_info to the users account
	 */
	public BookingResult booking(String booking_info, Account account,
			int useraction, String selection) throws IOException;

	/**
	 * Is this a supported downloadable ebook? May not do network requests.
	 */
	public boolean isEbook(DetailledItem item);

	/**
	 * Download the item identified by item_id. Returns an URL where the item
	 * can be downloaded from.
	 */
	public Uri downloadItem(Account account, String item_id);
}

@@ -757,72 +757,8 @@
 n;%0A%0A
-%09public enum Availability %7B%0A%09%09AVAILABLE, UNAVAILABLE, ERROR%0A%09%7D%0A%0A
 %09/**
@@ -766,214 +766,160 @@
 %09 * 
-Check whether an item, identified by item_id in the ebook system is%0A%09 * currently available for download.%0A%09 */%0A%09public Availability getAvailability(String item_id);%0A%0A%09/**%0A%09 * The result of a %7B@link #booking
+The result of a %7B@link #booking(String, Account, int, String)%7D call. The%0A%09 * structure of the call and response is similar to %7B@link OpacApi#reservation
 (Str
@@ -945,21 +945,17 @@
 String)%7D
- call
+.
 %0A%09 */%0A%09p
@@ -1165,16 +1165,112 @@
  account
+.%0A%09 * booking_info is what you returned in your DetailledItem object in your%0A%09 * getResult hook.
 %0A%09 */%0A%09p

Remove unneccessary function