You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

333 lines
12 KiB

  1. /*==============================================================================
  2. - TransKey.h ( secureKeyboard)
  3. ==============================================================================*/
  4. #import <Foundation/Foundation.h>
  5. @class TransKey;
  6. enum {
  7. NormalKey,
  8. DeleteKey,
  9. ClearallKey
  10. };
  11. enum{
  12. CancelCmdType,
  13. CompleteCmdType,
  14. NaviCancelCmdType,
  15. NaviCompleteCmdType,
  16. NaviBeforeCmdType,
  17. NaviNextCmdType,
  18. };
  19. /*==============================================================================
  20. ==============================================================================*/
  21. enum {
  22. TransKeyResourceTypeNormal,
  23. TransKeyResourceTypeNew,
  24. TransKeyResourceTypeRandom
  25. };
  26. typedef NSInteger TransKeyResourceType;
  27. /*==============================================================================
  28. secureKeyboard() keypad type
  29. ==============================================================================*/
  30. enum {
  31. TransKeyKeypadTypeText = 1,
  32. TransKeyKeypadTypeNumber = 2,
  33. TransKeyKeypadTypeTextWithPassword = -1,
  34. TransKeyKeypadTypeTextWithPasswordOnly = -3,
  35. TransKeyKeypadTypeNumberWithPassword = -2,
  36. TransKeyKeypadTypeNumberWithPasswordOnly = -4,
  37. TransKeyKeypadTypeTextWithPasswordLastShow = -5,
  38. TransKeyKeypadTypeNumberWithPasswordLastShow = -6
  39. };
  40. /*==============================================================================
  41. mTK_Language_Korean :
  42. mTK_Language_English :
  43. mTK_Language_Chinese :
  44. mTK_Language_Japanese :
  45. mTK_Language_Vietnames :
  46. mTK_Language_Mongolian :
  47. mTK_Language_Thai :
  48. mTK_Language_Indonesian :
  49. ==============================================================================*/
  50. typedef enum {
  51. mTK_Language_Korean=0,
  52. mTK_Language_English,
  53. mTK_Language_Chinese,
  54. mTK_Language_Japanese,
  55. mTK_Language_Vietnames,
  56. mTK_Language_Mongolian,
  57. mTK_Language_Thai,
  58. mTK_Language_Indonesian
  59. }MTransKey_Language_Option;
  60. typedef NSInteger TransKeyKeypadType;
  61. /*=============================================================================================================
  62. secureKeyboard() delegate
  63. =============================================================================================================*/
  64. @protocol TransKeyDelegate<NSObject>
  65. @optional
  66. - (void)TransKeyDidBeginEditing:(TransKey *)transKey;
  67. - (void)TransKeyDidEndEditing:(TransKey *)transKey;
  68. - (void)TranskeyWillBeginEditing:(TransKey *)transKey;
  69. - (void)TranskeyWillEndEditing:(TransKey *)transKey;
  70. - (void)TransKeyInputKey:(NSInteger)keytype;
  71. - (BOOL)TransKeyShouldInternalReturn:(TransKey *)transKey btnType:(NSInteger)type;
  72. //키패드 생성이 완료된 후에 받는 delegate.
  73. - (void)TransKeyEndCreating:(TransKey *)transKey;
  74. //키패드가 터치되면 콜백을 줌(mTK_RemoveFieldTouchEvent 옵션 사용시)
  75. - (void)TranskeyFieldTouched:(TransKey *)transKey;
  76. @required
  77. - (BOOL)TransKeyShouldReturn:(TransKey *)transKey;
  78. @end
  79. /*=============================================================================================================
  80. secureKeyboard() interface
  81. =============================================================================================================*/
  82. @interface TransKey : UIView
  83. @property (nonatomic, assign) id <TransKeyDelegate>delegate;
  84. @property (nonatomic, retain) id parent;
  85. /*=============================================================================================================
  86. MTranskey API
  87. =============================================================================================================*/
  88. // 암호키 설정한다. 128bit
  89. -(void)setSecureKey:(NSData*)securekey;
  90. // 컨트롤 분리모드에서 디바이스지원 범위 설정
  91. // secureKeyboard(컨트롤분리) support device 참조
  92. - (void)mTK_SupportedByDeviceOrientation:(NSInteger)supported_;
  93. // 보안 키패드의 타입 및 최대/최소 길이를 설정한다.
  94. - (void)setKeyboardType:(TransKeyKeypadType)type maxLength:(NSInteger)maxlength minLength:(NSInteger)minlength;
  95. // 커서 사용유무
  96. - (void)mTK_UseCursor:(BOOL)bUse;
  97. // 전체삭제 버튼 사용유무
  98. - (void)mTK_UseAllDeleteButton:(BOOL)bUse;
  99. // 입력에디트필드의 백그라운드 이미지 적용(transkey_inputbox.png)
  100. - (void)mTK_SetInputEditboxImage:(BOOL)bUse;
  101. // 입력에디트필드의 초기 문구를 설정
  102. - (void)mTK_SetHint:(NSString*)desc font:(UIFont*)font;
  103. - (void)mTK_SetHint:(NSString*)desc font:(UIFont*)font textAlignment:(NSTextAlignment)alignment;
  104. // VoiceOver 사용
  105. - (void)mTK_UseVoiceOver:(BOOL)bUse;
  106. // Navi Bar 설정
  107. - (void)mTK_ShowNaviBar:(BOOL)show;
  108. // Navi Bar 이전/다음/완료 버튼 숨김,보이스오버 설정
  109. - (void)mTK_SetHiddenBeforeButton:(BOOL)hidden;
  110. - (void)mTK_SetEnableBeforeButton:(BOOL)enable;
  111. - (void)mTK_SetDisableBeforeButtonImageName:(NSString *)name;
  112. - (void)mTK_SetBeforeButtonAccessibilityLabel:(NSString *)label;
  113. - (void)mTK_SetHiddenNextButton:(BOOL)hidden;
  114. - (void)mTK_SetEnableNextButton:(BOOL)enable;
  115. - (void)mTK_SetDisableNextButtonImageName:(NSString *)name;
  116. - (void)mTK_SetNextButtonAccessibilityLabel:(NSString *)label;
  117. - (void)mTK_SetHiddenCompleteButton:(BOOL)hidden;
  118. - (void)mTK_SetEnableCompleteButton:(BOOL)enable;
  119. - (void)mTK_SetDisableCompleteButtonImageName:(NSString *)name;
  120. - (void)mTK_SetCompleteButtonAccessibilityLabel:(NSString *)label;
  121. - (void)mTK_textAlignCenter:(BOOL)bCenter;
  122. - (void)mTK_UseShiftOptional:(BOOL)bUse;
  123. // 보안키패드의 언어설정(0:한글(default), 1:영어)
  124. // 한글 문구가 들어간 버튼만 이미지 변경(입력완료, 취소 등)
  125. - (void)mTK_SetLanguage:(NSInteger)languageType;
  126. - (void) mTK_SetKeypadBackColor:(UIColor*)backColor;
  127. /*=============================================================================================================
  128. MTranskey additional API
  129. =============================================================================================================*/
  130. - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
  131. // textfield에 입력길이만큼 '*' 출력
  132. - (void)setDummyCharacterWithLength:(NSInteger)length;
  133. // 보안 키패드로 입력한 데이터 길이를 얻는다.
  134. - (NSInteger)length;
  135. // 암호화 키를 얻는다.
  136. -(NSData*)getSecureKey;
  137. // 보안 키패드를 사용하여 입력된 암호화 값을 얻는다.
  138. - (NSString *)getCipherData;
  139. - (NSString *)getCipherDataEx;
  140. - (NSString *)getCipherDataExWithPadding;
  141. // 보안키패드 랜덤키 설정
  142. - (void)makeSecureKey;
  143. // 보안 키패드를 사용하여 입력된 원문 값을 얻는다.
  144. - (void)getPlainDataWithKey:(NSData*)key cipherString:(NSString*)cipherString plainString:(char*)plainData length:(NSInteger)length;
  145. - (void)getPlainDataExWithKey:(NSData*)key cipherString:(NSString*)cipherString plainString:(char*)plainData length:(NSInteger)length;
  146. - (void)getPlainDataExWithPaddingWithKey:(NSData*)key cipherString:(NSString*)cipherString plainString:(char*)plainData length:(NSInteger)length;
  147. // TransKey의 키패드를 띄운다.
  148. - (void)TranskeyBecomeFirstResponder;
  149. // TransKey의 키패드를 내린다.
  150. - (void)TranskeyResignFirstResponder;
  151. // TransKey를 통해 입력한 데이터를 초기화한다.
  152. - (void)clear;
  153. // 특수문자키 사용유무
  154. - (void)mTK_UseSpecialKey:(BOOL)bUse message:(NSString*)text;
  155. // 입력문자의 사이즈 조절(텍스트모드)
  156. - (void)mTK_SetSizeOfInputKeyImage:(CGFloat)width height:(CGFloat)height_;
  157. // 입력문자의 사이즈 조절(암호모드)
  158. - (void)mTK_SetSizeOfInputPwKeyImage:(CGFloat)width height:(CGFloat)height_;
  159. // 팝오버 사용(아이패드 전용)
  160. - (void)mTK_UsePopOver:(BOOL)bUse;
  161. // 현재 키패드가 팝오버 인지 확인.
  162. - (void)mTK_IsPopOver;
  163. //키패드를 대문자모드로 불러옴
  164. - (void)setKeyboardUpper:(BOOL)bUpper;
  165. // 현재 보안키패드에 설정된 언어 리턴
  166. - (NSInteger)mTK_GetLanguage;
  167. // 허용입력 초과시 메세지 박스 사용
  168. - (void)mTK_ShowMessageIfMaxLength:(NSString*)message;
  169. // 최소입력 미만시 메세지 박스 사용
  170. - (void)mTK_ShowMessageIfMinLength:(NSString*)message;
  171. // 버전
  172. - (NSString*)mTK_GetVersion;
  173. // navigation bar 사용할 경우 셋팅
  174. - (void)mTK_UseNavigationBar:(BOOL)bUse;
  175. // 숫자입력 4가지로 표현
  176. - (void)mTK_SetFixed;
  177. // 팝오버 옵션
  178. - (void)mTK_SetPopOverOpt:(UIColor*)labelBackColor textColor:(UIColor*)labelColor alignment:(NSTextAlignment)textAlignment;
  179. // 암호화 데이터 값
  180. - (NSString*)mTK_GetSecureData;
  181. - (NSString*)CK_GetSecureData;
  182. // Navi Bar 백그라운드 색상 설정
  183. - (void)mTK_SetNaviBarBackgroundColor:(UIColor *)color;
  184. // Navi Bar 백그라운드 이미지 설정
  185. - (void)mTK_SetNaviBarBackgroundImage:(NSString *)name;
  186. // Navi Bar 마지막 입력값 보여주기 설정
  187. - (void)mTK_ShowLastInput:(BOOL)show;
  188. //최상위 버튼의 Top 마진
  189. - (void)mTK_SetHighestTopMargin:(int)height;
  190. // NaviBar 마지막 글자 커스터마이징 설정
  191. - (void)mTK_SetNaviLastInputImageNamePrefix:(NSString*)prefixStr;
  192. - (NSString*)GetLastInputKeyImg;
  193. - (void)mTK_ClearDelegateSubviews;
  194. - (NSInteger)mTK_GetInputLength;
  195. - (void)mTK_EnableSamekeyInputDataEncrypt:(BOOL)bEnable;
  196. - (void)mTK_setHideInputPasswordDelay:(NSInteger)delaySecond;
  197. - (void)mTK_setReArrangeKeypad:(BOOL)bReArrange;
  198. - (void)mTK_UseKeypadAnimation:(BOOL)bUseAnimation;
  199. - (void)mTK_setVerticalKeypadPosition:(int)position;
  200. - (void)mTK_InputDone;
  201. - (void)mTK_InputCancel;
  202. - (void)mTK_InputBackSpace;
  203. - (void)mTK_UseAtmMode:(BOOL)bUseAtm;
  204. - (void)mTK_setCustomPostfixInputBoxImage:(NSString*)postfixImgName;
  205. - (void)mTK_SetInputBoxTransparent:(BOOL)bTransparent;
  206. - (void)mTK_SetPBKDF_RandKey:(NSData*)randkey;
  207. - (void)mTK_SetPBKDF_RandKey:(NSData*)randkey withSalt:(NSData *)salt withIterator:(NSInteger)iterator;
  208. - (NSString*)getPBKDF2DataEncryptCipherData;
  209. - (NSString*)getPBKDF2DataEncryptCipherDataEx;
  210. - (NSString*)getPBKDF2DataEncryptCipherDataExWithPadding;
  211. - (void)mTK_UseFocusColor:(BOOL)isUse;
  212. - (void)mTK_SetAlertTitle:(NSString*)title;
  213. // 입력필드 중앙정렬 유지하기 위해 - (void)viewDidDisappear:(BOOL)animated 하단에 선언
  214. - (void)mTK_RemainTextAlignCenter;
  215. // 말풍선(balloon) 사용유무
  216. - (void)mTK_SetUseBalloonImageButton:(BOOL)bUse;
  217. - (void)mTK_DisableButtonEffect:(BOOL)bDisable;
  218. //취소버튼 삭제
  219. - (void) mTK_DisableCancelBtn : (BOOL) flag;
  220. //오토포커싱 사용
  221. - (void) mTK_SetAutoFocusing : (BOOL) flag;
  222. // qwerty 키패드 높이 설정
  223. - (void) mTK_SetHeight : (float) value;
  224. // 키패드 높이 리턴
  225. - (float) mTK_GetCurrentKeypadHeight;
  226. // 더미 커스텀 이미지 사용
  227. - (void) mTK_UseCustomDummy : (BOOL) flag;
  228. // 커스텀 더미 스트링 (@"!@#$")
  229. - (void) mTK_CustomDummyString : (NSString *) mDummyString;
  230. // 드래그 기능 막는 옵션
  231. - (void) mTK_DisableDragEvent : (BOOL) flag;
  232. // color 세팅이 추가된 SetHint API
  233. - (void)mTK_SetHint:(NSString *)desc font:(UIFont *)font textAlignment:(NSTextAlignment)alignment textColor:(UIColor *)color;
  234. // 키패드 버튼 사이 간격 조절
  235. - (void) mTK_SetBtnMarginRatio : (float) value;
  236. // 키패드 입력완료 버튼 감춤/보이기 (동작중 사용가능)
  237. - (void) mTK_SetCompleteBtnHide : (BOOL) flag;
  238. // 공개키를 통한 암호문 패킷 생성
  239. - (NSString*)mTK_EncryptSecureKey:(NSString*)publicKey cipherString:(NSString*)cipherString;
  240. // ChangeView 형태를 사용할때 옵션
  241. - (void) mTK_SetChangeView : (BOOL) flag;
  242. // 하단 Safe Area 적용 여부
  243. - (void) mTK_SetBottomSafeArea : (BOOL) flag;
  244. // 보안입력필드 터치시 발생하는 이벤트를 없애고 TranskeyFieldTouched() 콜백 던져줌
  245. - (void) mTK_RemoveFieldTouchEvent : (BOOL) flag;
  246. // 미디어 볼륨으로 버튼음 재생하도록 설정 (Tock.caf)
  247. - (void) mTK_UseButtonResSound : (BOOL) flag;
  248. // 숫자 키보드를 랜덤으로 배열
  249. - (void) mTK_UseRandomNumpad : (BOOL) useRandomNumpad;
  250. // * 라이선스 체크. 반드시 진행해서 검증받아야 mTransKey 사용 가능
  251. - (int) mTK_LicenseCheck : (NSString *) fileName;
  252. // 완료버튼 선택시에 키패드를 내리지 않고 결과값 리턴
  253. - (void) mTK_SetDisableCompleteClose : (BOOL) useDisableClose;
  254. // 키보드 리소스 타입 설정 (default : TransKeyResourceTypeNormal)
  255. - (void) mTK_SetKeypadResourceType : (TransKeyResourceType) resourceType;
  256. @end