const.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // const.h
  3. // iShop
  4. //
  5. // Created by Rui Zhang on 12/14/23.
  6. //
  7. #ifndef const_h
  8. #define const_h
  9. #pragma mark WINDOW REFRESH
  10. #define REFRESH_NONE 0
  11. #define REFRESH_VIEW 1
  12. #define REFRESH_DATA 2
  13. #pragma mark INTERFACE RESULT
  14. #define RESULT_FALSE 0
  15. #define RESULT_NO_RESPONSE 1
  16. #define RESULT_TRUE 2
  17. #define RESULT_NO_EMAIL_ADDRESS 3
  18. #define RESULT_NET_SERVER_ERR -1
  19. #define RESULT_NET_ERROR -3
  20. #define RESULT_NET_NOTAVAILABLE -4
  21. #define RESULT_ERROR -5
  22. #define RESULT_LOCALFILE_ERROR -7
  23. #define RESULT_USERAUTH_ERROR -9
  24. #define RESULT_UPDATE_USERAUTH_ERROR -11
  25. #define RESULT_SESSION_EXPIRED -13
  26. #define RESULT_VER_LOW -15
  27. #define RESULT_BACKEND_CRASH -20
  28. #define RESULT_RESPONSE_ERROR -30
  29. #define RESULT_TIMEOUT 99
  30. #define RESULT_LOGIN_DEVICE -18
  31. #define RESULT_NO_MODEL 8
  32. #pragma mark CATALOG CELL
  33. #define CATEGORY_VIEWTYPE_SMALL 0
  34. #define CATEGORY_VIEWTYPE_LARGE 1
  35. #define CATEGORY_VIEWTYPE_CUSTOM 2
  36. #define CATEGORY_VIEWTYPE_LIST 3
  37. #pragma mark MESSAGE
  38. #define MSG_NET_NOTAVAILABLE @"No available network, please check your network setting."
  39. #define MSG_NET_ERROR @"Net Error. Cannot connect to server for now. Please retry later."
  40. #define MSG_USERAUTH_ERROR @"Username or password is incorrect.Please check."
  41. #define MSG_VER_LOW @"Current App version is out of date, please update to the latest version."
  42. #define MSG_ERROR @"Connection failed with Server, please email your IT Admin."//@"Some error occured on server."
  43. #define MSG_SUCCESS @"Success."
  44. #define MSG_LOGIN_DEVICE @"You are currently signed in on another device. Please check."
  45. #define MSG_TIMEOUT @"Request timeout."
  46. #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
  47. #define UIColorFromRGBAlpha(rgbValue,alp) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(alp)]
  48. #endif /* const_h */