window


showNativePopup

해당 winId를 가지는 네이티브 팝업 윈도우를 호출한다.

anim 파라미터는 3.1.1 버전 이상 부터 제공된다.

options

필드설명비고
winId 윈도우 아이디 
params파라메터 
anim0 : none
1 : From Left
2 : From Right
3 : From Top
4 : From Bottom
5 : Fade In
3.1.1 버전부터 지원
   

successCallback

필드필드설명
result Positive 를 선택한 경우의 객체
 message전달할 데이터
   

errorCallback

필드필드설명
e Negative 를 선택한 경우의 객체
 message전달할 데이터
   

Example

var winId = 'id';
var params = [];
var anim = 0;

hone.channel.execute('Window', 'showNativePopup', [winId, params, anim],
   function(result) {
       // success callback
       alert(JSON.stringify(result));
    },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

Result

Positive 를 선택한 경우 successCallback 으로 Negative 를 선택한 경우 errorCallback 으로 전달 된다.

{"message":"전달할 데이터"}

showNativeWebPopup

해당 winId를 가지는 네이티브웹 팝업 윈도우를 호출한다

anim 파라미터는 3.1.1 버전 이상 부터 제공된다.

options

파라미터설명비고
winId 윈도우 아이디 
params파라메터 
url타깃 도메인 주소 
anim0 : none
1 : From Left
2 : From Right
3 : From Top
4 : From Bottom
5 : Fade In
3.1.1 버전부터 지원
   

Example

var winId = 'id';
var params = [];
var url = "http://www.hsnc.co.kr";
var anim = 0;

hone.channel.execute('Window', 'showNativeWebPopup', [winId, params, url, anim],
   function(result) {
       // success callback
       alert(JSON.stringify(result));
    },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

goToNativeWindow

해당 winId를 가지는 네이티브 윈도우를 호출한다

anim 파라미터는 3.1.1 버전 이상 부터 제공된다.

options

파라미터설명
winId 윈도우 아이디
params파라메터
anim0 : none
1 : From Left
2 : From Right
3 : From Top
4 : From Bottom
5 : Fade In
  

Example

var winId = 'id';
var params = [];
var anim = 0;

hone.channel.execute('Window', 'goToNativeWindow', [winId, params, anim],
   function() {
       // success callback
   },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

goToBizappWindow

해당 webId를 가지는 웹앱 윈도우로 이동한다.

anim 파라미터는 3.1.1 버전 이상 부터 제공된다.

options

파라미터설명
winName윈도우명
BizAppId비즈앱 아이디
anim0 : none
1 : From Left
2 : From Right
3 : From Top
4 : From Bottom
5 : Fade In
  

Example

var winId = 'id';
var bizAppId = 'bizAppId';
var anim = 0;
hone.channel.execute('Window', 'goToBizappWindow', [winId, bizAppId, anim],
   function() {
       // success callback
   },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

goBack

일반 자바스크립트에서 제공하는 history.goBack(-1); 은 이전에 로딩된 캐쉬된 페이지가 보여집니다.

그러나 현재 hone.device.Window.goBack(); 을 하게 되면 Native영역에서 관리하는 히스토리에 포함된 정보를 바탕으로 이전 페이지 주소의 화면을 Load합니다.

Example

hone.channel.execute('Window', 'goBack', []);

canGoBack

이전 히스토리로 goBack 할 수 있는지 체크합니다.

Native의 히스토리에 이전 히스토리가 있으면 true, 없으면 false 값을 리턴합니다.

Example

hone.channel.execute('Window', 'canGoBack', [],
   function(result) {
       if (result) {
           // true
       } else {
           // false
       }
    },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

clearHistory

히스토리를 삭제합니다.

Example

hone.channel.execute('Window', 'clearHistory', []);

showLoadingScreen

오래걸리는 작업을 시작하기 전에 사용자의 입력을 막기 위해 사용할 수 있는 loading popup을 보여준다

options

파라미터설명
message 로딩팝업에 표시할 안내 문구 메시지
  

Example

var message = 'message';
hone.channel.execute('Window', 'showLoadingScreen', [message]);

hideLoadingScreen

표시중인 loading popup을 hide한다.

Example

hone.channel.execute('Window', 'hideLoadingScreen', []);

alert

honemobile 에서 제공하는 경고창을 띄운다

options

파라미터설명
title경고창 제목
message경고창 내용
  

Example

var title = 'title';
var message = 'message';
hone.channel.execute('Window', 'alert', [title, message]);

confirm

honemobile 에서 제공하는 확인창을 띄운다

options

파라미터설명
title경고창 제목
message경고창 내용
  

successCallback

필드설명
result

true (YES 버튼 선택 시)

false (NO 버튼 선택 시)

  

errorCallback

필드설명
없음없음
  

Example

var title = 'title';
var message = 'message';
hone.channel.execute('Window', 'confirm', [title, message],
   function(result) {
       // success callback
       JSON.stringify(result);
    },
   function(e) {
       // error callback
       alert(JSON.stringify(e));
    }
);

exitApp

런처앱을 종료합니다.

Example

hone.channel.execute('Window', 'exitApp', []);

fullscreen

화면을 전체 화면으로 변경 하거나 복구 한다. 

fullScreen는 3.0.0 버전 이상 부터 제공된다.

options

파라미터설명
options
  • true : 전체화면으로 설정
  • false : 일반화면으로 설정
  

Example

hone.channel.execute('window', 'fullscreen', [true],
   function (result) {
        alert('changed fullscreen');
    }, function (e) {
        alert(JSON.stringify(e));
    }
);

isFullscreen

현재 화면이 Full Screen 인지 확인 한다. 

isFullScreen는 3.0.0 버전 이상 부터 제공된다.

Example

hone.channel.execute('window', 'isFullscreen', [],
   function (result) {
        alert('fullscreen : ' + result);
    }, function (e) {
        alert(JSON.stringify(e));
    }
);

Result

결과 값은 true 또는 false 로 전달 된다. 

[true]

orientation

현재의 Orientation 을 반환 한다. 

Orientation는 3.0.0 버전 이상 부터 제공된다.

Example

hone.channel.execute('window', 'orientation', [],
   function (result) {
        alert('orientation : ' + result);
    }, function (e) {
        alert(JSON.stringify(e));
    }
);

Result

결과 값은 1 (Portrait), 2(Landscape) 으로 전달 된다. 

[1]