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.

214 lines
8.0 KiB

  1. /*==============================================================================
  2. - TransKey.h ( secureKeyboard)
  3. ==============================================================================*/
  4. #import <Foundation/Foundation.h>
  5. @class TransWebKey;
  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. secureKeyboard() keypad type
  21. ==============================================================================*/
  22. enum {
  23. TransKeyKeypadTypeText = 1,
  24. TransKeyKeypadTypeNumber = 2,
  25. TransKeyKeypadTypeTextWithPassword = -1,
  26. TransKeyKeypadTypeTextWithPasswordOnly = -3,
  27. TransKeyKeypadTypeNumberWithPassword = -2,
  28. TransKeyKeypadTypeNumberWithPasswordOnly = -4,
  29. TransKeyKeypadTypeTextWithPasswordLastShow = -5,
  30. TransKeyKeypadTypeNumberWithPasswordLastShow = -6
  31. };
  32. typedef NSInteger TransKeyKeypadType;
  33. /*=============================================================================================================
  34. secureKeyboard() delegate
  35. =============================================================================================================*/
  36. @protocol TransKeyWebDelegate<NSObject>
  37. @optional
  38. - (void)TransKeyDidBeginEditing:(TransWebKey *)transKey;
  39. - (void)TransKeyDidEndEditing:(TransWebKey *)transKey;
  40. - (void)TranskeyWillBeginEditing:(TransWebKey *)transKey;
  41. - (void)TranskeyWillEndEditing:(TransWebKey *)transKey;
  42. - (void)TransKeyInputKey:(NSInteger)keytype;
  43. - (BOOL)TransKeyShouldInternalReturn:(TransWebKey *)transKey btnType:(NSInteger)type;
  44. //키패드 생성이 완료된 후에 받는 delegate. 16.06.29. jiwan.
  45. - (void)TransKeyEndCreating:(TransWebKey *)transKey;
  46. @required
  47. - (BOOL)TransKeyShouldReturn:(TransWebKey *)transKey;
  48. @end
  49. /*=============================================================================================================
  50. secureKeyboard() interface
  51. =============================================================================================================*/
  52. @interface TransWebKey : UIView
  53. @property (nonatomic, assign) id <TransKeyWebDelegate>delegate;
  54. @property (nonatomic, retain) id parent;
  55. /*=============================================================================================================
  56. MTranskey API
  57. =============================================================================================================*/
  58. // 암호키 설정한다. 128bit
  59. -(void)setSecureKey:(NSData*)securekey;
  60. // 컨트롤 분리모드에서 디바이스지원 범위 설정
  61. // secureKeyboard(컨트롤분리) support device 참조
  62. - (void)mTK_SupportedByDeviceOrientation:(NSInteger)supported_;
  63. // 보안 키패드의 타입 및 최대/최소 길이를 설정한다.
  64. - (void)setKeyboardType:(TransKeyKeypadType)type maxLength:(NSInteger)maxlength minLength:(NSInteger)minlength;
  65. // VoiceOver 사용
  66. - (void)mTK_UseVoiceOver:(BOOL)bUse;
  67. - (void)mTK_SetHiddenCompleteButton:(BOOL)hidden;
  68. - (void)mTK_SetEnableCompleteButton:(BOOL)enable;
  69. - (void)mTK_SetDisableCompleteButtonImageName:(NSString *)name;
  70. - (void)mTK_SetCompleteButtonAccessibilityLabel:(NSString *)label;
  71. - (void)mTK_textAlignCenter:(BOOL)bCenter;
  72. - (void)mTK_UseShiftOptional:(BOOL)bUse;
  73. // 보안키패드의 언어설정(0:한글(default), 1:영어)
  74. // 한글 문구가 들어간 버튼만 이미지 변경(입력완료, 취소 등)
  75. - (void)mTK_SetLanguage:(NSInteger)languageType;
  76. /*=============================================================================================================
  77. MTranskey additional API
  78. =============================================================================================================*/
  79. - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
  80. // textfield에 입력길이만큼 '*' 출력
  81. - (void)setDummyCharacterWithLength:(NSInteger)length;
  82. // 보안 키패드로 입력한 데이터 길이를 얻는다.
  83. - (NSInteger)length;
  84. // 암호화 키를 얻는다.
  85. -(NSData*)getSecureKey;
  86. // 보안 키패드를 사용하여 입력된 암호화 값을 얻는다.
  87. - (NSString *)getCipherData;
  88. - (NSString *)getCipherDataEx;
  89. - (NSString *)getCipherDataExWithPadding;
  90. // 보안키패드 랜덤키 설정
  91. - (void)makeSecureKey;
  92. // 보안 키패드를 사용하여 입력된 원문 값을 얻는다.
  93. - (void)getPlainDataWithKey:(NSData*)key cipherString:(NSString*)cipherString plainString:(char*)plainData length:(NSInteger)length;
  94. - (void)getPlainDataExWithKey:(NSData*)key cipherString:(NSString*)cipherString plainString:(char*)plainData length:(NSInteger)length;
  95. - (void)getPlainDataExWithPaddingWithKey:(NSData*)key cipherString:(NSString*)cipherString plainString:(char*)plainData length:(NSInteger)length;
  96. // TransKey의 키패드를 띄운다.
  97. - (void)TranskeyBecomeFirstResponder;
  98. // TransKey의 키패드를 내린다.
  99. - (void)TranskeyResignFirstResponder;
  100. // TransKey를 통해 입력한 데이터를 초기화한다.
  101. - (void)clear;
  102. // 입력문자의 사이즈 조절(텍스트모드)
  103. - (void)mTK_SetSizeOfInputKeyImage:(CGFloat)width height:(CGFloat)height_;
  104. // 입력문자의 사이즈 조절(암호모드)
  105. - (void)mTK_SetSizeOfInputPwKeyImage:(CGFloat)width height:(CGFloat)height_;
  106. // 현재 보안키패드에 설정된 언어 리턴
  107. - (NSInteger)mTK_GetLanguage;
  108. // 허용입력 초과시 메세지 박스 사용
  109. - (void)mTK_ShowMessageIfMaxLength:(NSString*)message;
  110. // 최소입력 미만시 메세지 박스 사용
  111. - (void)mTK_ShowMessageIfMinLength:(NSString*)message;
  112. // 버전
  113. - (NSString*)mTK_GetVersion;
  114. // 암호화 데이터 값
  115. - (NSString*)mTK_GetSecureData;
  116. - (NSString*)CK_GetSecureData;
  117. //최상위 버튼의 Top 마진
  118. - (void)mTK_SetHighestTopMargin:(int)height;
  119. - (void)mTK_ClearDelegateSubviews;
  120. - (NSInteger)mTK_GetInputLength;
  121. - (void)mTK_EnableSamekeyInputDataEncrypt:(BOOL)bEnable;
  122. - (void)mTK_setReArrangeKeypad:(BOOL)bReArrange;
  123. - (void)mTK_UseKeypadAnimation:(BOOL)bUseAnimation;
  124. - (void)mTK_setVerticalKeypadPosition:(int)position;
  125. - (void)mTK_InputDone;
  126. - (void)mTK_InputCancel;
  127. - (void)mTK_InputBackSpace;
  128. - (void)mTK_SetPBKDF_RandKey:(NSData*)randkey;
  129. - (void)mTK_SetPBKDF_RandKey:(NSData*)randkey withSalt:(NSData *)salt withIterator:(NSInteger)iterator;
  130. - (NSString*)getPBKDF2DataEncryptCipherData;
  131. - (NSString*)getPBKDF2DataEncryptCipherDataEx;
  132. - (NSString*)getPBKDF2DataEncryptCipherDataExWithPadding;
  133. // 말풍선(balloon) 사용유무
  134. - (void)mTK_SetUseBalloonImageButton:(BOOL)bUse;
  135. - (void)mTK_DisableButtonEffect:(BOOL)bDisable;
  136. //취소버튼 삭제
  137. - (void) mTK_DisableCancelBtn : (BOOL) flag;
  138. //오토포커싱 사용
  139. - (void) mTK_SetAutoFocusing : (BOOL) flag;
  140. // qwerty 키패드 높이 설정
  141. - (void) mTK_SetHeight : (float) value;
  142. // 키패드 높이 리턴
  143. - (float) mTK_GetCurrentKeypadHeight;
  144. // 더미 커스텀 이미지 사용
  145. - (void) mTK_UseCustomDummy : (BOOL) flag;
  146. // 커스텀 더미 스트링 (@"!@#$")
  147. - (void) mTK_CustomDummyString : (NSString *) mDummyString;
  148. // 드래그 기능 막는 옵션
  149. - (void) mTK_DisableDragEvent : (BOOL) flag;
  150. // color 세팅이 추가된 SetHint API
  151. - (void)mTK_SetHint:(NSString *)desc font:(UIFont *)font textAlignment:(NSTextAlignment)alignment textColor:(UIColor *)color;
  152. // 키패드 버튼 사이 간격 조절
  153. - (void) mTK_SetBtnMarginRatio : (float) value;
  154. // 키패드 입력완료 버튼 감춤/보이기 (동작중 사용가능)
  155. - (void) mTK_SetCompleteBtnHide : (BOOL) flag;
  156. // 공개키를 통한 암호문 패킷 생성
  157. - (NSString*)mTK_EncryptSecureKey:(NSString*)publicKey cipherString:(NSString*)cipherString;
  158. // 하단 Safe Area 적용 여부
  159. - (void) mTK_SetBottomSafeArea : (BOOL) flag;
  160. // 미디어 볼륨으로 버튼음 재생하도록 설정 (Tock.caf)
  161. - (void) mTK_UseButtonResSound : (BOOL) flag;
  162. // 숫자 키보드를 랜덤으로 배열
  163. - (void) mTK_UseRandomNumpad : (BOOL) useRandomNumpad;
  164. @end