// Copyright 2001-2004, Danger, Inc. All Rights Reserved.
// This file is subject to the Danger, Inc. Sample Code License,
// which is provided in the file SAMPLE_CODE_LICENSE.
// Copies are also available from http://developer.danger.com/

package com.example.GUIDemo;

import danger.app.Application;
import danger.app.ResourceDatabase;
import danger.app.ResourceIDs;
import danger.ui.ScreenWindow;
import danger.ui.photopicker.PhotoPicker;
import danger.util.DEBUG;

/**
 * This class encapsulates the version specific code necessary for maintaining
 * the 2.0 and 2.3 versions of the application.
 * 
 * These are utility routines, that perform the version specific tasks. The
 * routines are marked static so that they can be called without needing
 * instantiation.
 * 
 * This file is for the 2.0 variant of the code.
 * 
 * Most of these are simply unimplemented, because they are not available in the
 * 2.0 version of the OS.
 */
public class Version implements Resources, Commands {

	/**
	 * The PhotoPicker interface is different on 2.0 and 2.3. This is for the
	 * 2.0 approach.
	 */
	public static PhotoPicker showPhotoPicker() {
		PhotoPicker picker; // = new PhotoPicker();

		picker = (PhotoPicker) ResourceDatabase.getSystemResources().getScreen(
				ResourceIDs.ID_PHOTO_PICKER_SCREEN);
		return (picker);
	}

	/**
	 * Null routine, doesn't exist on 2.0, here just to make it compile.
	 */
	public static void showLogTextBox() {
		DEBUG.p("Version.showLogTextBox, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}

	/**
	 * Null routine, doesn't exist on 2.0.
	 */
	public static void showAnimatedBitmapView(ScreenWindow window) {
		DEBUG.p("Version.showAnimatedBitmapView, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}

	/**
	 * For this version 2.0, there is no PhoneNumberTextField, so show the
	 * unimplemented alert.
	 */
	public static void showPhoneNumberTextField() {
		DEBUG.p("Version.showPhoneNumberTextField, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}

	/**
	 * For this version 2.0, there is no ToolTipWindow, so show the
	 * unimplemented alert.
	 */
	public static void showToolTipWindow() {
		DEBUG.p("Version.showToolTipWindow, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}

	/**
	 * For this version 2.0, there is no LinkTextbox, so show the unimplemented
	 * alert.
	 */
	public static void showLinkTextBox() {
		DEBUG.p("Version.showLinkTextBox, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}

	/**
	 * For this version 2.0, there is no MutableTextBox, so show the
	 * unimplemented alert.
	 */
	public static void showMutableTextBox() {
		DEBUG.p("Version.showMutableTextBox, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}

	/**
	 * For this version 2.0, there is no PasswordEditText, so show the
	 * unimplemented alert.
	 */
	public static void showPasswordEditText() {
		DEBUG.p("Version.showPasswordEditText, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}

	/**
	 * For this version 2.0, there is no ScrollingTextBox, so show the
	 * unimplemented alert.
	 */
	public static void showScrollingTextBox() {
		DEBUG.p("Version.showScrollingTextBox, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}

	/**
	 * For this version 2.0, there is no SelectTextBox, so show the
	 * unimplemented alert.
	 */
	public static void showSelectTextBox() {
		DEBUG.p("Version.showSelectTextBox, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}

	/**
	 * For this version 2.0, there is no MultiFolderView, so show the
	 * unimplemented alert.
	 */
	public static void showMultiFolderView() {
		DEBUG.p("Version.showMultiFolderView, not available under 2.0.");
		Application.getCurrentApp().showAlert(ID_UNAVAILABLE);
	}
}
