/*

CLASS {AL4_file_dialog|s_Java}, NATIVE, UNTESTED :

IMPORT: {Android_file_dialog}, {Dialog}, {Control},
		{String_functions}, {Dialog_file}, {Screen} .

*/

import android.content.*;
import android.widget.*;
import android.app.AlertDialog;
import android.view.*;
import java.io.*;
import java.util.*;
import android.graphics.Paint;
import android.os.Environment;
import android.util.*;
import android.graphics.drawable.Drawable;
import android.graphics.*;

public class AL4_file_dialog
// java code based on https://habr.com/ru/post/203884/ published 2013/11/28
{

    //public AL4_file_dialog(Context context) {
    //}

	/*
	// Create file dialogue, either for save or open file
	//---------------------------------------------------------------------
	
	FUN Create_file_dialog({Control} D|ialog_control,
		BOOL Save|_dialog) ==> INT
        :
        RESULT = do_create_file_dialog(D.Form_.Handle, D, Save) .

	FUN do_create_file_dialog(INT H|andle_horm,
		{Control} D|ialog_control, BOOL Save|_dialog) ==> INT, 
		NATIVE, UNCOOKED :
		"     RESULT = AL4_file_dialog.Do_Create_dialog_file(X_H, X_D, X_Save);" .
	*/
	public static int Do_Create_dialog_file(int H, Ref_obj X_D, boolean X_Save)
		throws Exception {
		AL4_file_dialog FD = new AL4_file_dialog();
		int Result = AL4_form.Alloc_descriptor(FD, X_D);
		return Result;
	}

	/*
	// Show file dialog, return TRUE if  file was selected.
	//-----------------------------------------------------
	
	FUN Show_file_dialog(
	{Control} C|ontrol_dialog_file) ==> BOOL
		:
		{Dialog_file} d|ialog_control = C.{Dialog_file}
		------------------------------ 'create dialog and setup'
		{Android_file_dialog} dlg|_temp = {Android_file_dialog}(
			Screen_ = d.Form_.Screen_,
			Is_save_dialog = d.Save_dialog,
			Ext = d.Default_ext)
			
		d.Filter.Split_to(dlg.Filters[], "|")
		dlg.Setup_title(d.Title)
		------------------------------------------ 'show dialog'
		RESULT = dlg.Show_modal(d.Form_) == "OK"
		CASE !RESULT ? ==> ;
		d.Filename = dlg.Get_file .
		
----------------------------- 'visual dialog'


	*/
	
}

 
/*
END
*/
