/**
 * File:		keyboard_proposal.ycp
 *
 * $Id: keyboard_proposal.ycp 22087 2005-03-02 08:00:56Z jsuchome $
 *
 * Author:              Klaus Kaempf <kkaempf@suse.de>
 *
 * Purpose:		Proposal function dispatcher - keyboard.
 *
 *			See also file proposal-API.txt for details.
 */
{
    textdomain "country";

    import "Keyboard";

    string func  = (string)WFM::Args(0);
    map    param = (map)WFM::Args(1);
    map    ret   = $[];

    if ( func == "MakeProposal" )
    {
	boolean force_reset      = param["force_reset"     ]:false;
	boolean language_changed = param["language_changed"]:false;

	// call some function that makes a proposal here:
	//
	// DummyMod::MakeProposal( force_reset );

	// Fill return map

	ret =
	    $[
	      "raw_proposal"    : [ Keyboard::MakeProposal( force_reset, language_changed ) ],
	      "language_changed": false
	    ];
    }
    else if ( func == "AskUser" )
    {
	boolean has_next = param["has_next"]:false;

	// call some function that displays a user dialog
	// or a sequence of dialogs here:
	//
	// sequence = DummyMod::AskUser( has_next );

	if( !Keyboard::CalledRestore() )
	    {
	    Keyboard::Restore();
	    }

	symbol result = (symbol)WFM::CallFunction ("inst_keyboard", [true, has_next]);

	// Fill return map

	ret = $[
		"workflow_sequence" : result,
		"language_changed"  : false
	       ];
    }
    else if ( func == "Description" )
    {
	// Fill return map.
	//
	// Static values do just nicely here, no need to call a function.

	ret =
	    $[
	      // summary item
	      "rich_text_title"	:	_("Keyboard Layout"),
	      // menue label text
	      "menu_title"	:	_("&Keyboard Layout"),
	      "id"		:	"keyboard_stuff"
	    ];
    }

    return ret;
}
