shiku_im-Prefix.pch 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. #import <Availability.h>
  2. #define Meeting_Version 1 //如果注释,则不编译视频聊天部分
  3. //#define IS_TEST_VERSION 1 //内部测试版,注释则启用短信验证码
  4. #define IS_Skip_SMS 1 //如果注释,则关闭发送短信20s后显示跳转下一界面入口功能
  5. //#define USE_GOOGLEMAP 1 //如果注释,不编译googleMap,如需要googleMap,请下载googleMApSDK 拖入工程
  6. //#define Live_Version 1 //直播
  7. //#define IS_SHOW_MENU 1 //如果注释,发现界面显示朋友圈。 没有注释,发现界面显示菜单栏
  8. //#define IS_SetupServer 1 // 显示设置服务器入口
  9. //#define IS_MsgEncrypt 1 // 非对称消息加密
  10. //#define IS_AUTO_JOIN_ROOM 1 // 开启自动加群,关闭手动加群
  11. #define APIKEY @"a891a7a6-03af-475c-8ae1-7fb4b230e958"
  12. #define APIURL @"47.57.16.13"
  13. //#define APIURL @"qdzcie.com"
  14. //#define APIURL @"https://app.ddz98.vip"
  15. //#define APIURL @"47.57.16.13"
  16. #define JPUSHAPPKEY @"23862a54c91a5e635f6dd1f2"
  17. #define JPUSHAPPKEY2 @"247d5f7506b27d1fb4d0d373"
  18. // AppStore版本
  19. #define AppStore 0
  20. // app group id (share extension 数据分享绑定id)
  21. #define APP_GROUP_ID @"group.com.kuxin.im1"
  22. // 网页首页通知
  23. #define KGoHomeWebPageNotification @"KGoHomeWebPageNotification"
  24. // 网页刷新通知
  25. #define KGoRefreshWebPageNotification @"KGoRefreshWebPageNotification"
  26. // 右上角部分响应区域 加大
  27. #define BTN_RANG_UP 14
  28. //群聊左边消息上下间距
  29. #define GROUP_CHAT_INSET 3
  30. // 本地存储定位到的国家代号
  31. #define kISOcountryCode @"kISOcountryCode"
  32. // 本地存储定位到的城市Id
  33. #define kCityId @"kCityId"
  34. // 本地存储选择的语言
  35. #define kLocalLanguage @"kLocalLanguage"
  36. // 本地存储聊天字体大小
  37. #define kChatFont @"kChatFont"
  38. // 本地存储聊天字体名字
  39. #define kChatFontName @"kChatFontName"
  40. // 本地存储聊天气泡地址
  41. #define kChatBubbleName @"kChatBubbleName"
  42. // 是否开启多点登录
  43. #define kISMultipleLogin @"kISMultipleLogin"
  44. // 是否使用google地图
  45. #define kUseGoogleMap @"isShowGooMap"
  46. // 集群地址
  47. #define kLocationArea @"kLocationArea"
  48. // 设备锁密码
  49. #define kDeviceLockPassWord @"kDeviceLockPassWord"
  50. // 默认取上一次成功的服务器IP
  51. #define kLastApiUrl @"kLastApiUrl"
  52. // 进入app保存经纬度
  53. #define kLocationLogin @"kLocationLogin"
  54. #define kMyPayPrivateKey [NSString stringWithFormat:@"kMyPayPrivateKey_%@",g_myself.userId]
  55. // 付款码key
  56. #define kMyQRKey [NSString stringWithFormat:@"kMyQRKey_%@",g_myself.userId]
  57. // 群组翻页人数
  58. #define kRoomMemberListNum 500
  59. // 是否是第一次同步聊天记录列表
  60. #define kISFirstGetLastChatList [NSString stringWithFormat:@"kISFirstGetLastChatList_%@",g_myself.userId]
  61. //青色,主色调
  62. //#define THEMECOLOR HEXCOLOR(0x48d1cc)
  63. #define OVERALL_LIGHT_GREEN HEXCOLOR(0xe0eeee)
  64. //浅灰色
  65. #define OVERALL_LIGHT_GRAY HEXCOLOR(0xeeeeee)
  66. #define SEPSRATOR_WIDTH 50
  67. // 线颜色
  68. #define THE_LINE_COLOR HEXCOLOR(0xd9d9d9)
  69. // 线的宽或者高
  70. #define LINE_WH (BIG_DEVICE ? 1 : 1.1)
  71. // 获取app名称
  72. #define app_name [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]
  73. #define APP_NAME [NSString stringWithFormat:@"%@",app_name]
  74. // 获取app包名
  75. #define app_bundle_id [[NSBundle mainBundle] bundleIdentifier]
  76. #define APP_BUNDLE_ID [NSString stringWithFormat:@"%@",app_bundle_id]
  77. //#define THE_APP_OUR ([APP_BUNDLE_ID isEqualToString:@"com.shiku.im.push"] || [APP_BUNDLE_ID isEqualToString:@"com.shiku.coolim.push1"])
  78. #define THE_APP_OUR ([APP_BUNDLE_ID isEqualToString:@"app.jixincc.vip"] || [APP_BUNDLE_ID isEqualToString:@"com.shiku.coolim.push1"])
  79. #define kMY_USER_MYSELF @"myself"
  80. #define kMY_USER_TOKEN @"myToken"
  81. #define kMY_USER_LOGINTOKEN @"myLoginToken"
  82. #define kMY_USER_LOGINKEY @"myLoginKey"
  83. #define kMY_USER_HTTPKEY @"myHttpKey"
  84. #define kMY_USER_PASSWORD @"myUserPassword"
  85. #define kMY_USER_ID @"myUserId"
  86. #define kMY_USER_COMPANY_ID @"companyId"
  87. #define kMY_USER_NICKNAME @"myUserNickname"
  88. #define kMY_USER_AREACODE @"myUserAreacode"
  89. #define kMY_USER_INVITECODE @"myInviteCode"
  90. #define kMY_USER_ROLE @"myUserRole"
  91. #define kMY_USER_Head @"myUserHead"
  92. #define kMY_USER_LoginName @"myUserLoginName"
  93. #define kMY_USER_PrivateKey_DH @"myUserPrivateKeyDH" // 我的DH私钥
  94. #define kMY_USER_PrivateKey_RSA @"myUserPrivateKeyRSA" // 我的RSA私钥
  95. //share extension 数据分享
  96. #define kMY_ShareExtensionPassword @"myShareExtensionPassword"
  97. #define kMY_ShareExtensionUserId @"myShareExtensionUserId"
  98. #define kMY_ShareExtensionToken @"myShareExtensionToken"
  99. #define kMY_ShareExtensionLoginToken @"myShareExtensionLoginToken"
  100. #define kMY_ShareExtensionLoginKey @"myShareExtensionLoginKey"
  101. #define kMY_ShareExtensionHttpKey @"myShareExtensionHttpKey"
  102. #define kDownloadAvatarUrl @"downloadAvatarUrl" //下载头像前缀URL
  103. #define kUploadUrl @"uploadUrl" // http上传前缀URL
  104. #define kApiUrl @"kApiUrl" // http上传前缀URL
  105. #define share_defaults [[NSUserDefaults alloc] initWithSuiteName:APP_GROUP_ID]
  106. #define kShare_timeDifference @"kShare_timeDifference"
  107. #define PAGE_SHOW_COUNT 20
  108. #define kLastOfflineTime [NSString stringWithFormat:@"lastOfflineTime_%@",g_myself.userId] // 离线时间
  109. #define kTHIRD_LOGIN_AUTO @"thirdLoginAuto" // 当前是否是第三方登录
  110. #define kXMPPLivePraiseRemindNotification @"kXMPPLivePraiseRemindNotification" // 直播爱心
  111. #define kXMPPLiveGiftRemindNotification @"kXMPPLiveGiftRemindNotification" // 直播礼物
  112. #define kXMPPLiveBarrageRemindNotification @"kXMPPLiveBarrageRemindNotification" // 直播弹幕
  113. #define kXMPPMessageWeiboRemind @"kXMPPMessageWeiboRemind" // 朋友圈点赞和评论
  114. //#define kXMPPMessageShowReadMode @"kXMPPMessageShowReadMode" //已读模式变化
  115. #define kXMPPMessageEnteringNotification @"kXMPPMessageEnteringNotification"// 正在输入
  116. #define kXMPPMessageWithdrawNotification @"kXMPPMessageWithdrawNotification"// 消息撤回
  117. #define kXMPPMessageTransferReceiveNotification @"kXMPPMessageTransferReceiveNotification"// 转账已被领取消息
  118. #define kXMPPMessageTransferBackNotification @"kXMPPMessageTransferBackNotification"// 转账已被退回消息
  119. #define kXMPPMessageQrPaymentNotification @"kXMPPMessageQrPaymentNotification"//扫码支付款通知
  120. #define kXMPPMessageUpadtePasswordNotification @"kXMPPMessageUpadtePasswordNotification"//修改密码/首次设置支付密码/隐私设置/标签的增删改查
  121. #define kXMPPMessageUpadteUserInfoNotification @"kXMPPMessageUpadteUserInfoNotification"//编辑自己的基本资料/用户
  122. #define kXMPPMessageUpadteGroupNotification @"kXMPPMessageUpadteGroupNotification"//编辑群组资料
  123. #define kXMPPMessageReadTypeReceiptNotification @"MessageReadTypeReceiptNotification"//接收方收到已读消息的回执,改变标志避免重复发
  124. #define kXMPPMessageReadTypeNotification @"MessageReadTypeNotification"//发送方收到已读类型,改变消息图片为已读
  125. #define kXMPPNewRequestNotifaction @"xmppNewRequestNotifaction"//收到加好友请求,刷新UI
  126. #define kXMPPMyLastSendNotifaction @"xmppMyLastSendNotifaction"//发出消息,刷新最近的那条聊天,但不显示数量
  127. #define kXMPPNewMsgNotifaction @"xmppNewMsgNotifaction"//收到消息,刷新最近的那条聊天,同时显示数量
  128. #define kXMPPShowMsgNotifaction @"xmppShowMsgNotifaction"//显示一条消息
  129. #define kXMPPAllMsgNotifaction @"xmppAllMsgNotifaction"//收到批量消息,一次性刷新
  130. #define kXMPPReceiptNotifaction @"xmppReceiptNotifaction"//收到回执
  131. #define kXMPPNewFriendNotifaction @"xmppNewFriendNotifaction"//收到新朋友,刷新通讯录
  132. #define kXMPPSendTimeOutNotifaction @"xmppSendTimeOutNotifaction"//确定超时,收不到回执,刷新界面
  133. #define kXMPPReceiveFileNotifaction @"xmppReceiveFileNotifaction"//下载文件完毕
  134. #define kXMPPRemindNotifaction @"xmppRemindNotifaction"//提醒
  135. #define kXMPPRoomNotifaction @"xmppRoomNotifaction"//群聊
  136. #define kXmppLoginNotifaction @"xmppLoginNotifaction"//登陆成功
  137. #define kXmppClickLoginNotifaction @"kXmppClickLoginNotifaction"//非自动登陆成功
  138. #define kSendInputNotifaction @"kSendInputNotifaction"
  139. #define kQuitRoomNotifaction @"kQuitRoomNotifaction"//退出房间
  140. #define kroomIsAttritionRecallRefresh @"kroomIsAttritionRecallRefresh"//刷新防撤回
  141. #define kisOpenIntegralRefresh @"kisOpenIntegralRefresh"//群头衔开关
  142. #define kgroupLevelNameRefresh @"kgroupLevelNameRefresh"//刷新群头衔
  143. #define kFriendListRefresh @"kFriendListRefresh" // 刷新通讯录
  144. #define kLiveListRefresh @"kLiveListRefresh" // 直播列表刷新
  145. #define kRoomMembersRefresh @"kRoomMembersRefresh" // 群成员刷新
  146. #define kRoomGroupActivityRefresh @"kRoomGroupActivityRefresh" // 群活动通知
  147. #define kRoomRemind_RoomIsRedMoneyGroupActivityRefresh @"kRoomRemind_RoomIsRedMoneyGroupActivityRefresh" // 群活动通知 发红包
  148. #define kWCMessageTypeOpenPaySuccessRefresh @"kWCMessageTypeOpenPaySuccessRefresh" //第三方支付成功通知
  149. #define kCallAnswerNotification @"kCallAnswerNotification"
  150. #define kCallEndNotification @"kCallEndNotification"
  151. #define kCallSetMutedNotification @"kCallSetMutedNotification"
  152. //#define kSaveBadgeNotifaction @"kSaveBadgeNotifaction"//退出程序时,保存未读消息
  153. #define kSystemLoginNotifaction @"kSystemLoginNotifaction"//系统登陆成功
  154. #define kRegisterNotifaction @"kRegisterNotifaction"//系统登陆成功
  155. #define kSystemLogoutNotifaction @"kSystemLogoutNotifaction"//系统退出登陆成功
  156. #define kXMPPLoginOtherNotification @"kXMPPLoginOtherNotification"//xmpp在其他设备登录
  157. #define kUpdateChatVCGroupHelperData @"kUpdateChatVCGroupHelperData"// 更新聊天界面群助手数据
  158. #define kUpdateUserNotifaction @"kUpdateUserNotifaction" //更新“我”页面
  159. #define kDeleteUserNotifaction @"kDeleteUserNotifaction" //删除好友
  160. #define kDeleteAllChatLog @"kDeleteAllChatLog" //清除全部聊天记录
  161. #define kStartEnteringStatus @"kStartEnteringStatus" // 是否开启正在输入状态
  162. #define kMsgComeVibration @"kMsgComeVibration"//是否振动
  163. #define kMsgComeMute @"kMsgComeMute"//是否静音
  164. #define kLongComePush @"kLongComePush"//是否屠龙推送
  165. #define kgoucaiComePush @"kgoucaiComePush"//是开启购彩
  166. #define kGuanXinComePush @"kGuanXinComePush"//是开启特别关心
  167. #define kLongComePushIsFirstSetUp @"kLongComePushIsFirstSetUp"//是否第一次设置屠龙推送
  168. #define kActionRelayQuitVC @"kActionRelayQuitVC" // 转发后退出界面
  169. #define kChatViewDisappear @"kChatViewDisappear" // 聊天界面消失时
  170. #define kFavoritesRefresh @"kFavoritesRefresh" // 刷新收藏夹
  171. #define kEmojiRefresh @"kEmojiRefresh" // 刷新表情包
  172. #define kSendCourseMsg @"kSendCourseMsg" // 发送課程消息
  173. #define kUpdateCourseList @"kUpdateCourseList" // 更新课程列表
  174. #define kSetBackGroundImageView @"kSetBackGroundImageView" // 设置聊天背景
  175. #define kWxPayFinishNotification @"kWxPayFinishNotification" //微信支付结束
  176. #define kWxSendAuthRespNotification @"kWxSendAuthRespNotification" // 微信授权回调
  177. #define kUpdateIsOnLineMultipointLogin @"kUpdateIsOnLineMultipointLogin" // 多点登录在线离线状态更新
  178. #define kUpdateMsgSynTask @"kUpdateMsgSynTask" // 新增离线消息任务同步
  179. #define kRefreshTalkListNotification @"kRefreshTalkListNotification" // 刷新对讲机列表
  180. #define kChatVCMessageSync @"kChatVCMessageSync" // 聊天界面消息同步
  181. #define kChatVCMessageAudioIsNotPlayback @"kChatVCMessageAudioIsNotPlayback" // 聊天语音是否是听筒播放
  182. #define kShareShortVideo @"kShareShortVideo" //分享短视频
  183. #define kDeviceAuthNotification @"kDeviceAuthNotification" //授权登录
  184. //weiboCell点击网址
  185. #define kCellTouchUrlNotifaction @"kCellTouchUrlNotifaction"
  186. //weiboCell点击电话号码
  187. #define kCellTouchPhoneNotifaction @"kCellTouchPhoneNotifaction"
  188. //FMDB
  189. //#define FMDBQuickCheck(SomeBool) { if (!(SomeBool)) { NSLog(@"Failure on line %d", __LINE__); abort(); } }
  190. #define DATABASE_PATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]stringByAppendingString:@"/weChat.db"]
  191. #define g_window [UIApplication sharedApplication].keyWindow //keyWindow,push页面使用[g_window addSubView:];
  192. #define g_subWindow g_App.subWindow
  193. #define g_App ((AppDelegate*)[[UIApplication sharedApplication] delegate]) //appDelegate单例
  194. #define g_wait [ATMHud sharedInstance] //hub单例
  195. #define g_factory [UIFactory sharedUIFactory] //工厂类单例
  196. #define g_server ((AppDelegate*)[[UIApplication sharedApplication] delegate]).jxServer //接口类单例
  197. #define g_securityUtil ((AppDelegate*)[[UIApplication sharedApplication] delegate]).securityUtil
  198. #define g_payServer ((AppDelegate*)[[UIApplication sharedApplication] delegate]).payServer
  199. #define g_loginServer ((AppDelegate*)[[UIApplication sharedApplication] delegate]).loginServer
  200. #define g_msgUtil ((AppDelegate*)[[UIApplication sharedApplication] delegate]).msgUtil
  201. #define g_commonService ((AppDelegate*)[[UIApplication sharedApplication] delegate]).commonService //全局共用类单例
  202. #define g_constant ((AppDelegate*)[[UIApplication sharedApplication] delegate]).jxConstant //常量单例
  203. #define g_config ((AppDelegate*)[[UIApplication sharedApplication] delegate]).config //配置单例
  204. #define g_xmpp [JXXMPP sharedInstance] //xmpp单例
  205. #define g_default [NSUserDefaults standardUserDefaults] //NSUserDefaults单例
  206. #define g_device [UIDevice currentDevice] //device单例
  207. #define g_myself ((AppDelegate*)[[UIApplication sharedApplication] delegate]).jxServer.myself //登录者的userObject单例
  208. #define g_multipleLogin ((AppDelegate*)[[UIApplication sharedApplication] delegate]).jxServer.multipleLogin // 多点登录单例
  209. //#define g_meetConfig [NgnEngine sharedInstance].configurationService //音视频会议配置单例
  210. #define g_notify [NSNotificationCenter defaultCenter] //通知单例
  211. #define g_macAddress [[[UIDevice currentDevice].identifierForVendor UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""]
  212. #define g_pay [JXAlixPay sharedInstance]
  213. #define g_mainVC g_App.mainVc //主视图
  214. #define g_navigation g_App.navigation //导航
  215. #define g_appName [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"] //app名
  216. #define g_appVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] //app版本号
  217. #define g_faceVC g_App.faceView.faceView //表情面板
  218. #define g_meeting ((AppDelegate*)[[UIApplication sharedApplication] delegate]).jxMeeting //音视频会议单例
  219. #define g_hrJobAdminVC g_App.mainVc.hrJobAdminVC
  220. #define g_hrWriteExamVC g_App.mainVc.hrWriteExamVC
  221. #define g_hrAuditVC g_App.mainVc.hrAuditVC
  222. #define g_hrMyviewVC g_App.mainVc.hrMyviewVC
  223. #define g_psJobListVC g_App.mainVc.psJobListVC
  224. #define g_psAuditVC g_App.mainVc.psAuditVC
  225. #define g_psWriteExamVC g_App.mainVc.psWriteExamVC
  226. #define g_psMyviewVC g_App.mainVc.psMyviewVC
  227. // 判断iPhone X
  228. #define kDevice_Is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
  229. //判断iPHoneXr
  230. #define SCREENSIZE_IS_XR ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) : NO)
  231. //判断iPHoneX、iPHoneXs
  232. #define SCREENSIZE_IS_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
  233. #define SCREENSIZE_IS_XS ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
  234. //判断iPhoneXs Max
  235. #define SCREENSIZE_IS_XS_MAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) : NO)
  236. //判断Plus机型
  237. #define SCREENSIZE_IS_PLUS ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)
  238. //有刘海的手机类型
  239. #define THE_DEVICE_HAVE_HEAD (kDevice_Is_iPhoneX || SCREENSIZE_IS_XR ||SCREENSIZE_IS_X ||SCREENSIZE_IS_XS || SCREENSIZE_IS_XS_MAX)
  240. //使用3倍图的手机类型
  241. #define BIG_DEVICE (kDevice_Is_iPhoneX || SCREENSIZE_IS_XR ||SCREENSIZE_IS_X ||SCREENSIZE_IS_XS || SCREENSIZE_IS_XS_MAX || SCREENSIZE_IS_PLUS)
  242. // 判断为iphone
  243. #define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
  244. // 判断为ipad
  245. #define IS_PAD (UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad)
  246. #define IOS10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)
  247. #define IOS8_10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 && [[UIDevice currentDevice].systemVersion doubleValue] < 10.0)
  248. #define XMGRandomColor kRGBColor(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))
  249. #define kRGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
  250. #define kRGBColor51 kRGBColor(51, 51,51)
  251. #define kRGBColor151 kRGBColor(153, 153,153)
  252. #define kRGBColor250 kRGBColor(250, 250,250)
  253. #define kRGBColor246 kRGBColor(229, 229,229)
  254. #define JX_SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height //全屏宽度
  255. #define JX_SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width //全屏高度
  256. #define WIDTH_PAGE JX_SCREEN_WIDTH
  257. #define JX_SCREEN_TOP (THE_DEVICE_HAVE_HEAD ? 88 : (44+20)) //顶部状态栏加导航栏高度
  258. #define JX_STATUSBAR_H (THE_DEVICE_HAVE_HEAD ? 44 : 20) //顶部状态栏高度
  259. #define JX_SCREEN_BOTTOM (THE_DEVICE_HAVE_HEAD ? 83 : 49) //底部tabbar高度
  260. #define JX_SCREEN_BOTTOM_SAFE_AREA (THE_DEVICE_HAVE_HEAD ? 34 : 0) //底部SAFE_AREA高度
  261. #define self_width self.view.frame.size.width //self.view宽度
  262. #define self_height self.view.frame.size.height //self.view高度
  263. #define Localized(str) [g_constant LocalizedWithStr:str] //国际化,str为国际化key
  264. #define isIOS7 [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0
  265. #define DATA(X) [X dataUsingEncoding:NSUTF8StringEncoding]
  266. #define RSTRING(X) NSStringFromCGRect(X)
  267. #define COOKBOOK_PURPLE_COLOR [UIColor colorWithRed:0.20392f green:0.19607f blue:0.61176f alpha:1.0f]
  268. #define BARBUTTON(TITLE, SELECTOR) [[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR]
  269. #define IMGBARBUTTON(IMAGE, SELECTOR) [[UIBarButtonItem alloc] initWithImage:IMAGE style:UIBarButtonItemStylePlain target:self action:SELECTOR]
  270. #define SYSBARBUTTON(ITEM, SELECTOR) [[UIBarButtonItem alloc] initWithBarButtonSystemItem:ITEM target:self action:SELECTOR]
  271. #define CUSTOMBARBUTTON(VIEW) [[UIBarButtonItem alloc] initWithCustomView:VIEW]
  272. #define MY_USER_ID [[NSUserDefaults standardUserDefaults]objectForKey:kMY_USER_ID] //我的userId
  273. #define MY_USER_NAME [[NSUserDefaults standardUserDefaults]objectForKey:kMY_USER_NICKNAME] //我的name
  274. //我的role , 这是个数组
  275. #define MY_USER_ROLE [[NSUserDefaults standardUserDefaults]objectForKey:kMY_USER_ROLE]
  276. //#define NSLogFrame(frame) NSLog(@"%f,%f,%f,%f",frame.origin.x,frame.origin.y,frame.size.width,frame.size.height)
  277. #define RGB(r, g, b) [UIColor colorWithRed:((r) / 255.0) green:((g) / 255.0) blue:((b) / 255.0) alpha:1.0] //RGB颜色
  278. #define HEXCOLOR(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] //十六进制颜色
  279. #define add_dict_object(d,obj,key) if(obj)[d setObject:obj forKey:key]
  280. #define add_array_object(p,obj) if(obj)[p addObject:obj]
  281. #define isFileExist(s) [[NSFileManager defaultManager] fileExistsAtPath:s] //判断文件是否存在
  282. #define THEMEBACKCOLOR HEXCOLOR(0xF2F2F2) //这题背景色
  283. //#define THEMECOLOR HEXCOLOR(0x48d1cc) //主题色
  284. #define g_theme [SkinManage sharedInstance]
  285. #define ThemeImage(str) [[SkinManage sharedInstance] themeImage:str] //str为原始图片名
  286. #define ThemeImageName(str) [[SkinManage sharedInstance] themeImageName:str] //str为原始图片名
  287. #define THEMECOLOR [SkinManage sharedInstance].themeColor
  288. #define THESIMPLESTYLE (g_theme.themeIndex == 0 || g_theme.themeIndex == 1 || g_theme.themeIndex == 2 || g_theme.themeIndex == 3 || g_theme.themeIndex == 4 || g_theme.themeIndex == 5 || g_theme.themeIndex == 6 || g_theme.themeIndex == 7) // 极简主题风格
  289. #define SYSFONT(size) [UIFont systemFontOfSize:size]
  290. #define docFilePath [NSString stringWithFormat:@"%@/Documents/",NSHomeDirectory()]
  291. #define dataFilePath [NSString stringWithFormat:@"%@/Library/Caches/",NSHomeDirectory()]
  292. #define tempFilePath [NSString stringWithFormat:@"%@/tmp/",NSHomeDirectory()] //temp
  293. #define backImage [NSString stringWithFormat:@"%@/Documents/backImage",NSHomeDirectory()]
  294. // 截屏图片
  295. //#define ScreenShotImage [NSString stringWithFormat:@"%@/Documents/ScreenShotImage.jpg",NSHomeDirectory()]
  296. // 相册最后一张图片Index
  297. #define LastPhotoIndex @"LastPhotoIndex"
  298. #define imageFilePath [NSString stringWithFormat:@"%@/",[[NSBundle mainBundle] bundlePath]]
  299. #define gifImageFilePath [[NSBundle mainBundle] pathForResource:@"gif" ofType:@"bundle"] //gif图片表情bundle路径
  300. #define myTempFilePath [NSString stringWithFormat:@"%@/tmp/%@/",NSHomeDirectory(),MY_USER_ID]
  301. // 聊天背景图片存储地址
  302. #define kChatBackgroundImagePath [docFilePath stringByAppendingPathComponent:@"ChatBackgroundImage.jpg"]
  303. // 设置本地服务器存储list
  304. #define SERVER_LIST_DATA [docFilePath stringByAppendingPathComponent:@"serverList.plist"]
  305. // 适配比例
  306. #define ADAPTATIONRATIO JX_SCREEN_WIDTH / 750.0f
  307. #define Max_Rand_SongImg 10
  308. #define NPAGES 2
  309. #define MAIN_ALERT 101
  310. #define DX(p1, p2) (p2.x - p1.x)
  311. #define DY(p1, p2) (p2.y - p1.y)
  312. #define degreesToRadians(x) (M_PI*(x)/180.0)
  313. #define PIXEL_ADJUST_WIDTH JX_SCREEN_WIDTH/320
  314. #define PIXEL_ADJUST_HEIGHT JX_SCREEN_HEIGHT/568
  315. #define height_im_footer 49
  316. #define INSETS 10 //间距
  317. #define MAX_INSETS 15 //大间距
  318. #define CHAT_WIDTH_ICON 11 //聊天界面气泡与头像距离
  319. #define INSETS2(isGroup) (isGroup ? 20 : 10)
  320. #define WIDTH JX_SCREEN_WIDTH-INSETS*2
  321. #define HEAD_SIZE 40.f //头像大小
  322. #define stretch 20//拉伸
  323. // 上 左 下 右
  324. #define RightEdgeInset UIEdgeInsetsMake(42, 42, 42, 20)
  325. #define LeftEdgeInset UIEdgeInsetsMake(42, 20, 42, 42)
  326. #define BigRightEdgeInset UIEdgeInsetsMake(108,20,20,75)
  327. #define BigLeftEdgeInset UIEdgeInsetsMake(108,75,20,20)
  328. #define newStretchW image.size.width * 0.5
  329. #define newStretchH image.size.height * 0.5
  330. #define imageItemHeight JX_SCREEN_WIDTH/3 -70//所有含图片的控件按比例放大
  331. #define webWidth self.frame.size.width/2
  332. #define kChatCellMaxWidth (JX_SCREEN_WIDTH-MAX_INSETS*2-HEAD_SIZE*2-CHAT_WIDTH_ICON*2)
  333. #define kScreenWidthScale (JX_SCREEN_WIDTH / 375) // 以屏宽为375为基础的缩放比例
  334. // 来自YYKit
  335. #ifndef weakify
  336. #if DEBUG
  337. #if __has_feature(objc_arc)
  338. #define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
  339. #else
  340. #define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
  341. #endif
  342. #else
  343. #if __has_feature(objc_arc)
  344. #define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
  345. #else
  346. #define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
  347. #endif
  348. #endif
  349. #endif
  350. #ifndef strongify
  351. #if DEBUG
  352. #if __has_feature(objc_arc)
  353. #define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
  354. #else
  355. #define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object;
  356. #endif
  357. #else
  358. #if __has_feature(objc_arc)
  359. #define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object;
  360. #else
  361. #define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object;
  362. #endif
  363. #endif
  364. #endif
  365. #define kLaunchAdShowFinishNotifaction @"kLaunchAdShowFinishNotifaction"
  366. //聊天Cell的通知中心
  367. #define kCellVoiceStartNotifaction @"kCellVoiceStartNotifaction"
  368. #define kCellResendMsgNotifaction @"kCellResendMsgNotifaction" //重发消息
  369. #define kCellDeleteMsgNotifaction @"kCellDeleteMsgNotifaction" //删除消息
  370. #define kCellShowReadPersonsNotifaction @"kCellShowReadPersonsNotifaction" //已读人数
  371. #define kCellShowCardNotifaction @"kCellShowCardNotifaction" //聊天cell 名片点击
  372. #define kCellMessageReadDelNotifaction @"kCellMessageReadDelNotifaction" //聊天cell 文字阅后即焚查看点击
  373. #define kCellPlayVideoNotifaction @"kCellPlayVideoNotifaction" //聊天cell video播放
  374. #define kCellLocationNotifaction @"kCellLocationNotifaction" //聊天cell 位置点击
  375. #define kCellReplyNotifaction @"kCellReplyNotifaction" //聊天cell 回复点击
  376. #define kCellRemindNotifaction @"kCellRemindNotifaction" //控制消息点击
  377. #define kCellImageNotifaction @"kCellImageNotifaction" //照片
  378. #define kCellHeadImageNotification @"kCellHeadImageNotification" //聊天cell headImage点击
  379. #define kcellRedPacketDidTouchNotifaction @"kcellRedPacketDidTouchNotifaction" //聊天cell红包点击
  380. #define kcellTransferDidTouchNotifaction @"kcellTransferDidTouchNotifaction" //聊天cell转账点击
  381. #define kCellSystemImage1DidTouchNotifaction @"kCellSystemImage1DidTouchNotifaction" //单条图文消息点击
  382. #define kCellSystemImage2DidTouchNotifaction @"kCellSystemImage2DidTouchNotifaction" //多条图文消息点击
  383. #define kCellSystemAVCallNotifaction @"kCellSystemAVCallNotifaction" //音视频通话
  384. #define kCellSystemFileNotifaction @"kCellSystemFileNotifaction" //文件点击
  385. #define kCellSystemLinkNotifaction @"kCellSystemLinkNotifaction" //链接点击
  386. #define kCellSystemShakeNotifaction @"kCellSystemShakeNotifaction" //戳一戳点击
  387. #define kCellSystemMergeRelayNotifaction @"kCellSystemMergeRelayNotifaction" //合并转发点击
  388. #define kCellLongGesHeadImageNotification @"kCellLongGesHeadImageNotification" //长按聊天cell头像
  389. #define kCellShareNotification @"kCellShareNotification" // 分享cell点击
  390. //改变msg的发送状态
  391. #define kCellReadDelNotification @"kCellReadDelNotification"//阅后即焚
  392. #define kImageDidTouchEndNotification @"kImageDidTouchEndNotification"//查看图片完成
  393. #define kMsgDrawIsReceiveNotifaction @"kMsgDrawIsReceiveNotifaction" //已读回执
  394. #define kUploadFileProgressNotifaction @"kUploadFileProgressNotifaction" //上传进度
  395. #define kCardDeleteOkNotifaction @"kCardDeleteOkNotifaction" //名片
  396. #define kGroupHeadImageModifyNotifaction @"kGroupHeadImageModifyNotifaction" //群组头像更新
  397. #define kSeachAddUserNotification @"kSeachAddUserNotification" //搜索
  398. #define kNearRefreshCallPhone @"kNearRefreshCallPhone" //刷新已拨打电话
  399. #define kHiddenKeyboardNotification @"kHiddenKeyboardNotification" //隐藏键盘
  400. #define kApplicationDidBecomeActive @"kApplicationDidBecomeActive" // 进入活跃
  401. #define kApplicationDidEnterBackground @"kApplicationDidEnterBackground" // 进入后台
  402. #define kApplicationWillEnterForeground @"kApplicationWillEnterForeground" // 进入前台
  403. #define kDidReceiveRemoteDic @"kDidReceiveRemoteDic" // 推送进入数据
  404. #define kFriendRemark @"kFriendRemark" // 修改备注
  405. #define kLabelVCRefreshNotif @"kLabelVCRefreshNotif" // 刷新标签列表
  406. #define kOpenReadDelNotif @"kOpenReadDelNotif" // 开启阅后即焚
  407. #define kRefreshChatLogNotif @"kRefreshChatLogNotif" // 聊天页面重新加载聊天记录
  408. #define kGroupHelperRefreshNotif @"kGroupHelperRefreshNotif" // 群发助手页面刷新
  409. #define kChatVCReloadNotif @"kChatVCReloadNotif" // 聊天页面tableview刷新
  410. #define kFriendPassNotif @"kFriendPassNotif" // 验证通过
  411. #define kRefreshAddressBookNotif @"kRefreshAddressBookNotif" //手机联系人刷新
  412. #define kMsgComeContactRegister @"kMsgComeContactRegister"
  413. #define kMsgRoomFaceNotif @"kMsgRoomFaceNotif" // 面对面建群刷新通知
  414. #define kOfflineOperationUpdateUserSet @"kOfflineOperationUpdateUserSet" // 获取离线接口列表后刷新界面
  415. #define kOfflineOperationUpdateLabelList @"kOfflineOperationUpdateLabelList" // 获取离线接口列表后刷新标签列表
  416. #define kUpdateTransferMsgFileSize @"kUpdateTransferMsgFileSize" // 领取后改变转账消息状态
  417. #define kKeepOnSendGroupSendMessage @"kKeepOnSendGroupSendMessage" //发送下一条群发消息
  418. /* **** 判断字典、数组是否为空 **** */
  419. #define IsDictionaryNull(dict) (nil == dict || ![dict isKindOfClass:[NSDictionary class]] || [dict isKindOfClass:[NSNull class]] || [dict allKeys].count <= 0)
  420. #define IsArrayNull(array) ((nil == array || ![array isKindOfClass:[NSArray class]] || [array isKindOfClass:[NSNull class]] || array.count <= 0))
  421. #define IsStringNull(string) (nil == string || [string isKindOfClass:[NSNull class]]|| string.length <= 0)
  422. #define IsObjectNull(object) (nil == object || [object isKindOfClass:[NSNull class]])
  423. #ifdef __OBJC__
  424. #import <UIKit/UIKit.h>
  425. #import <Foundation/Foundation.h>
  426. #import "Masonry.h"
  427. #ifdef Meeting_Version
  428. #ifdef Live_Version
  429. #import "GKMessageTool.h"
  430. #endif
  431. #endif
  432. #import "QQHeader.h"
  433. #import <QuartzCore/QuartzCore.h>
  434. #import <AVFoundation/AVFoundation.h>
  435. #import "SBJsonParser.h"
  436. #import "JXXMPP.h"
  437. #import "JXMessageObject.h"
  438. #import "JXUserObject.h"
  439. #import "JXMultipleLogin.h"
  440. #import "JXMsgAndUserObject.h"
  441. #import "Photo.h"
  442. #import "UIFactory.h"
  443. #import "JXLabel.h"
  444. #import "UIImage+Tint.h"
  445. #import "JXImageView.h"
  446. #import "JXSecurityUtil.h"
  447. #import "JXPayServer.h"
  448. #ifdef IS_MsgEncrypt
  449. #import "JXMsgUtil.h"
  450. #endif
  451. #import "JXLoginServer.h"
  452. #import "AppDelegate.h"
  453. #import "JXConnection.h"
  454. #import "jxServer.h"
  455. #import "JXCommonService.h"
  456. #import "JXWaitingView.h"
  457. #import "JXCollectionView.h"
  458. #import "SBJsonWriter.h"
  459. #import "JXUserObject.h"
  460. #import "JXFriendObject.h"
  461. #import "weibodata.h"
  462. #import "WeiboReplyData.h"
  463. #import "TimeUtil.h"
  464. #import "ATMHud.h"
  465. #import "admobViewController.h"
  466. #import "JXTableViewController.h"
  467. #import "JXEmoji.h"
  468. #import "FileInfo.h"
  469. #import "LXActionSheet.h"
  470. #import "JXConstant.h"
  471. #import "JXMainViewController.h"
  472. #import "versionManage.h"
  473. #import "JXDatePicker.h"
  474. #import "MJRefreshFooterView.h"
  475. #import "roomData.h"
  476. #import "JXAudioPlayer.h"
  477. #import "JXVideoPlayer.h"
  478. #import "AFNetworking.h"
  479. #import "TimeUtil.h"
  480. #import "DESUtil.h"
  481. #import "AESUtil.h"
  482. #import "UIImageView+WebCache.h"
  483. #import "JXMyTools.h"
  484. #import "SkinManage.h"
  485. #import "MXWechatConfig.h"
  486. #import "UIControl+JXCustom.h"
  487. #import "JXHttpRequet.h"
  488. #import "JXNetwork.h"
  489. #import "UIImage+Color.h"
  490. #import "UIImage+Tint.h"
  491. #import "JXInputRectView.h"
  492. #import "SVProgressHUD.h"
  493. #import "MJExtension.h"
  494. #import "SDImageCache.h"
  495. #import "SDWebImageDownloader.h"
  496. #import "SDWebImagePrefetcher.h"
  497. #import "JLBubbleManager.h"
  498. #if TAR_IM
  499. #ifdef Meeting_Version
  500. #import "JXMeetingObject.h"
  501. #endif
  502. #endif
  503. #import "JXServer+Live.h"
  504. #endif