package jp.gr.java_conf.shiseissi.commonlib;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.graphics.Paint;
import android.hardware.Camera;
import android.os.AsyncTask;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;

import java.io.File;
import java.util.List;

/**
 *
 * @author shisei
 */
@TargetApi(5)
public class APILevelWrapper5 extends APILevelWrapper {

    protected APILevelWrapper5() {
    }

    @Override
    public File getExternalFilesDir(Context context, String type) {
        return APILevelWrapper4.getExternalFilesDirImpl(context, type);
    }

    @SuppressWarnings("deprecation")
    @Override
    public void setPluginsEnabled(WebSettings webSettings, boolean flag) {
        webSettings.setPluginsEnabled(flag);
    }

    @Override
    public void setDomStorageEnabled(WebSettings webSettings, boolean flag) {
        // 空実装
    }

    @Override
    public Object getActionBar(Activity activity) {
        return null;
    }

    @Override
    public void setDisplayHomeAsUpEnabled_ActionBar(Object actionBar,
            boolean showHomeAsUp) {
        // 空実装
    }

    @Override
    public void setCustomView_ActionBar(Object actionBar, int resId) {
        // 空実装
    }

    @Override
    public <T extends View> T getCustomView_ActionBar(Object actionBar) {
        // 空実装
        return null;
    }

    @Override
    public int getHeight_ActionBar(Object actionBar) {
        // 空実装
        return 0;
    }

    @Override
    public void show_ActionBar(Object actionBar) {
        // 空実装
    }

    @Override
    public void hide_ActionBar(Object actionBar) {
        // 空実装
    }

    @Override
    public boolean isShowing_ActionBar(Object actionBar) {
        // 空実装
        return false;
    }

    @Override
    public void setSystemUiVisibility(View view, int visibility) {
        // 空実装
    }

    @Override
    public <Params> AsyncTask<Params, ?, ?> executeOnSerialExecutor(AsyncTask<Params, ?, ?> task,
            Params... params) {
        return task.execute(params);
    }

    @Override
    public <Params> AsyncTask<Params, ?, ?> executeOnThreadPoolExecutor(
            AsyncTask<Params, ?, ?> task, Params... params) {
        return task.execute(params);
    }

    @Override
    public void setDisplayOrientation(Camera camera, int degrees) {
        // 5ではCameraに対しては無視
    }

    @Override
    public void setPreviewSize(Camera.Parameters params,
            int width, int height) {
        APILevelWrapper4.setPreviewSizeImpl(params, width, height);
    }

    @Override
    public void getCameraInfo(int cameraId, CameraInfo cameraInfo) {
        APILevelWrapper4.getCameraInfoImpl(cameraId, cameraInfo);
    }

    @Override
    public List<Camera.Size> getSupportedPreviewSizes(Camera.Parameters params) {
        return params.getSupportedPreviewSizes();
    }

    @Override
    public List<Integer> getSupportedPreviewFormats(Camera.Parameters params) {
        return params.getSupportedPreviewFormats();
    }

    @Override
    public void emulateShiftHeld(WebView webView) {
        APILevelWrapper4.emulateShiftHeldImpl(webView);
    }

    @Override
    public void invalidateOptionsMenu(Activity activity) {
        // 空実装
    }

    @Override
    public void setLayerType(View view, int layerType, Paint paint) {
        // 空実装
    }
}
