(function(f,c,d){var b="Rho.Application";var a=d.apiReqFor(b);function e(){var g=null;this.getId=function(){return g};if(1==arguments.length&&arguments[0][d.rhoIdParam()]){if(b!=arguments[0][d.rhoClassParam()]){throw"Wrong class instantiation!"}g=arguments[0][d.rhoIdParam()]}else{g=d.nextId()}}d.createPropsProxy(e.prototype,[],a,function(){return this.getId()});d.createMethodsProxy(e.prototype,[],a,function(){return this.getId()});d.createRawPropsProxy(e.prototype,[]);e.APP_EVENT_ACTIVATED="Activated";e.APP_EVENT_CONFIGCONFLICT="ConfigConflict";e.APP_EVENT_DBMIGRATESOURCE="DBMigrateSource";e.APP_EVENT_DEACTIVATED="Deactivated";e.APP_EVENT_SCREEN_OFF="ScreenOff";e.APP_EVENT_SCREEN_ON="ScreenOn";e.APP_EVENT_SYNCUSERCHANGED="SyncUserChanged";e.APP_EVENT_UICREATED="UICreated";e.APP_EVENT_UIDESTROYED="UIDestroyed";d.createPropsProxy(e,[{propName:"appBundleFolder",propAccess:"r"},{propName:"appsBundleFolder",propAccess:"r"},{propName:"bundleFolder",propAccess:"r"},{propName:"userFolder",propAccess:"r"},{propName:"configPath",propAccess:"r"},{propName:"modelsManifestPath",propAccess:"r"},{propName:"databaseBlobFolder",propAccess:"r"},{propName:"publicFolder",propAccess:"r"},{propName:"startURI",propAccess:"rw"},{propName:"settingsPageURI",propAccess:"rw"},{propName:"splash",propAccess:"r"},{propName:"version",propAccess:"r"},{propName:"title",propAccess:"rw"},{propName:"appName",propAccess:"r"},{propName:"locale",propAccess:"r"},{propName:"country",propAccess:"r"},{propName:"nativeMenu",propAccess:"rw"},{propName:"defaultNativeMenu",propAccess:"r"},{propName:"securityTokenNotPassed",propAccess:"r"},{propName:"invalidSecurityTokenStartPath",propAccess:"r"},{propName:"rhoPlatformVersion",propAccess:"r"},{propName:"badLinkURI",propAccess:"r"}],a);d.createMethodsProxy(e,[{methodName:"modelFolderPath",nativeName:"modelFolderPath",valueCallbackIndex:1},{methodName:"databaseFilePath",nativeName:"databaseFilePath",valueCallbackIndex:1},{methodName:"expandDatabaseBlobFilePath",nativeName:"expandDatabaseBlobFilePath",valueCallbackIndex:1},{methodName:"relativeDatabaseBlobFilePath",nativeName:"relativeDatabaseBlobFilePath",valueCallbackIndex:1},{methodName:"quit",nativeName:"quit",valueCallbackIndex:0},{methodName:"minimize",nativeName:"minimize",valueCallbackIndex:0},{methodName:"restore",nativeName:"restore",valueCallbackIndex:0},{methodName:"setApplicationNotify",nativeName:"setApplicationNotify",persistentCallbackIndex:0,valueCallbackIndex:2}],a);d.namespace(b,e)})(Rho.jQuery,Rho,Rho.util);(function(f,c,d){var b="Rho.Application";var a=d.apiReqFor(b);var e={};d.createPropsProxy(Rho.Application,[{propName:"defaultNativeMenu",propAccess:"r",customGet:function(){return[{label:"Home",action:"home"},{label:"Refresh",action:"refresh"},{label:"Sync",action:"sync"},{label:"Settings",action:"options"},{label:"Log",action:"log"},{label:"separator",action:""},{label:"Exit",action:"close"}]}}],a);function g(h){applicationEvent=h.applicationEvent;eventData=h.eventData;if(applicationEvent==Rho.Application.APP_EVENT_UICREATED){console.log("AppEvent: "+applicationEvent);start_url=Rho.Application.startURI;if(!start_url){start_url=""}if(Rho.System.platform!=Rho.System.PLATFORM_WP8){invalid_security_token_start_path=Rho.Application.invalidSecurityTokenStartPath;if(Rho.Application.securityTokenNotPassed){if(invalid_security_token_start_path&&invalid_security_token_start_path.length()>0){start_url=invalid_security_token_start_path}else{Rho.Log.fatalError("processApplicationEvent: security_token is not passed - application will closed","EROOR");Rho.System.exit()}}}console.log("on_ui_created.navigate to start url: "+start_url);Rho.WebView.navigate(start_url)}else{if(applicationEvent==Rho.Application.APP_EVENT_UIDESTROYED){console.log("AppEvent: "+applicationEvent)}else{if(applicationEvent==Rho.Application.APP_EVENT_CONFIGCONFLICT){console.log("AppEvent: "+applicationEvent)}else{if(applicationEvent==Rho.Application.APP_EVENT_DBMIGRATESOURCE){console.log("AppEvent: "+applicationEvent);console.log("default on_migrate_source - do nothing; old_version :"+eventData.old_version+"; new_src : "+eventData.new_src);return true}else{if(applicationEvent==Rho.Application.APP_EVENT_SYNCUSERCHANGED){Rho.ORM.databaseFullReset(false,false)}}}}}}var e={processApplicationEvent:function(h){g(h)}};d.namespace(b,e,true)})(Rho.jQuery,Rho,Rho.util);