Author: jreidinger Date: Tue Jun 9 15:21:27 2009 New Revision: 57513 URL: http://svn.opensuse.org/viewcvs/yast?rev=57513&view=rev Log: add YaPI interface, not fully implemented Added: trunk/country/language/src/YaPI/ trunk/country/language/src/YaPI/LANGUAGE.pm Modified: trunk/country/language/src/Makefile.am Modified: trunk/country/language/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/language/src/Makefile.am?rev=57513&r1=57512&r2=57513&view=diff ============================================================================== --- trunk/country/language/src/Makefile.am (original) +++ trunk/country/language/src/Makefile.am Tue Jun 9 15:21:27 2009 @@ -15,6 +15,12 @@ rnc_DATA = language.rnc -EXTRA_DIST = $(client_DATA) $(desktop_DATA) $(rnc_DATA) +YaPI_perldir = @moduledir@/YaPI + +YaPI_perl_DATA = \ + YaPI/LANGUAGE.pm + + +EXTRA_DIST = $(client_DATA) $(desktop_DATA) $(YaPI_perl_DATA) $(rnc_DATA) include $(top_srcdir)/Makefile.am.common Added: trunk/country/language/src/YaPI/LANGUAGE.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/language/src/YaPI/LANGUAGE.pm?rev=57513&view=auto ============================================================================== --- trunk/country/language/src/YaPI/LANGUAGE.pm (added) +++ trunk/country/language/src/YaPI/LANGUAGE.pm Tue Jun 9 15:21:27 2009 @@ -0,0 +1,75 @@ +package YaPI::LANGUAGE; + +use strict; +use YaST::YCP qw(:LOGGING); +use YaPI; + +textdomain("language"); + +# ------------------- imported modules +YaST::YCP::Import ("Language"); +# ------------------------------------- + +our $VERSION = '1.0.0'; +our @CAPABILITIES = ('SLES9'); +our %TYPEINFO; + +BEGIN{$TYPEINFO{GetLanguages} = ["function", + ["list","string"]]; +# "string"]; +} +sub GetLanguages { + my $ret = []; + my $languages = Language->GetLanguagesMap(0); + while ( my ($key, $value) = each (%$languages)){ + push @$ret, "$key---".$value->[0]; + } + return $ret; +} + +BEGIN{$TYPEINFO{GetCurrentLanguage} = ["function", + "string"]; +} +sub GetCurrentLanguage { + return Language->language; +} + +BEGIN{$TYPEINFO{SetCurrentLanguage} = ["function", + "boolean","string"]; +} +sub SetCurrentLanguage { +#TODO + return 1; +} + +BEGIN{$TYPEINFO{IsUTF8} = ["function", + "boolean"]; +} +sub IsUTF8 { + return Language->use_utf8; +} + +BEGIN{$TYPEINFO{SetUTF8} = ["function", + "boolean","boolean"]; +} +sub SetUTF8 { +#TODO + return 1; +} + +BEGIN{$TYPEINFO{GetRootLang} = ["function", + "string"]; +} +sub GetRootLang { + return Language->rootlang; +} + +BEGIN{$TYPEINFO{SetRootLang} = ["function", + "boolean","string"]; +} +sub SetRootLang { +#TODO + return 1; +} + +1; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org