|
//
// UserDefine.h
// ThePaperDemo
//
// Created by Scar on 14-9-15.
// Copyright (c) 2014年 scar1900. All rights reserved.
//
// 控制台Log输出控制,此确保在release版本下无Log输出
#ifdef DEBUG
#define TPLOG NSLog
#else
#define TPLOG NSLog
#endif
typedef enum
{
linkToFrontPage = 1, //跳转至首页
linkToDetailPage = 2, //跳转至新闻详情页
linkToTopicPage = 3, //跳转至专题页
linkToSeedingPage = 4, //跳转至直播
linkToImagePage = 5, //跳转至图集
linkToOutsidePage = 6, //跳转至外链
}
remotePushLinkType;
#define HeadCardType 1 //头条
#define BigCardType 2//大卡片
#define SmallCardType 3 //小卡片
#define ChildListCardType 4 //热门推荐卡片集
#define AdCardType 5 //硬广告(600*250图片)
#define HotTopicListType 6 //热门话题列表集
#define HotAskCardType 8 //热赞榜
#define commonNewsForwardType 0 //普通新闻详情页
#define imageNewsForwardType 1 //图集详情页
#define liveNewsForwardType 2 //直播详情页
#define specialTopicNewsForwardType 3 //专题详情页
#define linkNewsForwardType 4 //外链
#define commonUserTopicForwardType 5 //普通用户话题浏览页
#define creatUserTopicForwardType 6 //创建用户话题浏览页
#define topicEditForwardType 7 //创建用户话题编辑页
#define hotAskPageForwardType 8 //进入热赞榜
// 自动调整尺寸控制:full形式
#define AutoresizingFull UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin |UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin
#define AutoresizingAuto UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin
#define isIOS7 [[[UIDevice currentDevice] systemVersion] floatValue] >= 7
#define isJustIos7 [[[UIDevice currentDevice] systemVersion] floatValue] >= 7 && [[[UIDevice currentDevice] systemVersion] floatValue]<8
#define isIOS9 [[[UIDevice currentDevice] systemVersion] floatValue] >= 9
#define isIOS8 [[[UIDevice currentDevice] systemVersion] floatValue] >= 8
#define isJustIos8 [[[UIDevice currentDevice] systemVersion] floatValue] >= 8 && [[[UIDevice currentDevice] systemVersion] floatValue]<9
#define isNotIOS8 [[[UIDevice currentDevice] systemVersion] floatValue] < 8
#define isNotIOS7 [[[UIDevice currentDevice] systemVersion] floatValue] < 7
#define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))
#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)
#define RandomColor [UIColor colorWithRed:arc4random()%255/255.0 green:arc4random()%255/255.0 blue:arc4random()%255/255.0 alpha:1]
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)
#define IS_IPHONE4 (([[UIScreen mainScreen] bounds].size.height-480)?NO:YES)
#define ISNotRETINA [UIScreen mainScreen].scale == 1
#define rect_screen [[UIScreen mainScreen]bounds]
#define KEY_WINDOW [[UIApplication sharedApplication]keyWindow]
#define TOP_VIEW [[UIApplication sharedApplication]keyWindow].rootViewController.view
#define TOP_CONTROLLER [[UIApplication sharedApplication]keyWindow].rootViewController
/**
* ISFormalink
* 正式环境放出,测试环境注销
*/
#define ISFormalink
#ifdef ISFormalink
#define RemoteURL @"http://app.thepaper.cn/"
#else
#define RemoteURL @"http://101.231.211.82/"
#endif
#define quo_pic_width (173/2)*rect_screen.size.width/320
#define BEGIN_FLAG @"["
#define END_FLAG @"]"
#define FaceArray [[NSMutableArray alloc] initWithObjects: @"[蜡烛]",@"[赞]",@"[good]",@"[耶]",@"[ok]",@"[微笑]",@"[可爱]",@"[嘻嘻]",@"[偷笑]",@"[哈哈]",@"[笑cry]",@"[太开心]",@"[挖鼻]",@"[扣鼻屎]",@"[怒]",@"[怒骂]",@"[围观]",@"[悲伤]",@"[伤心]",@"[泪]",@"[委屈]",@"[可怜]",@"[心]",@"[疑问]",@"[衰]",nil]
#define ImageNumArray [[NSMutableArray alloc]initWithObjects:@"蜡烛.png", @"赞.png", @"赞.png", @"赞.png", @"赞.png", @"微笑.png",@"微笑.png",@"微笑.png",@"微笑.png", @"哈哈.png", @"哈哈.png", @"哈哈.png", @"挖鼻.png", @"挖鼻.png", @"怒.png", @"怒.png", @"围观.png", @"悲伤.png",@"悲伤.png",@"悲伤.png",@"悲伤.png",@"悲伤.png", @"心.png", @"疑问.png", @"衰.png", nil]
#define FaceDict [[NSDictionary alloc] initWithObjects:ImageNumArray forKeys:FaceArray]
#import "NSMutableAttributedString+Extention.h"
#define EnableNBS 1
//#define EnableNBS 0
#define EnableTokenDisplay 0
//#define EnableTokenDisplay 1
#define BackgourndRefreshTime 3600
#define PUSHTODETAILCONTENT @"pushToDetailContent" //进入文章详情
#define PUSHTOTOPICDETAILCONTENT @"pushToTopicInfoContent"//进入话题详情
#define SELECTCHANNEL @"selectChannel" //选择频道消息
#define PUSHTOLOGIN @"pushToLogin" //跳转到登陆
#define PUSHTOUSERINFO @"pushToUserInfo" //跳转到用户信息
#define PUSHTOSETTINGS @"pushToSettings" //跳转到设置
#define PUSHTOHAIBEI @"pushToHaiBei" //跳转到海贝商城
#define PUSHTOFOLLOW @"pushToFollow" //跳转到跟踪
#define PUSHTOCOLLECT @"pushToCollect" //跳转到收藏
#define PUSHTOASK @"pushToAskManager" //跳转到我的追问
#define PRESENTHOTASK @"presentHotAsk" //跳转到我的追问
#define PUSHTOMESSAGE @"pushToMessage" //跳转消息
#define PUSHMYTOPICCENTER @"pushToMyTopic" //跳转我的话题
#define POPANSWERDETAIL @"popAnswerDetail" //进入回答详情
#define HAVELOGIN @"haveLogin" //登陆成功
#define HAVELOGINOUT @"haveLoginOut" //退出登陆
#define NEEDREFRESHENTERFORGROUND @"needRefreshEnterForground" //进入前台需要刷新首页
#define CONTENTDETAILPOPBACK @"contentDetailPopBack" //从文章详情页面返回
#define QUEDIDFINISH @"queDidFinish" //从文章详情页面返回
#define LINKWITHPUSH @"linkWithPush" //接受推送或者网络跳转
#define PUSHCLICK @"pushClick" //推送点击查看
#define POPUPORDERCENTER @"popUpOrderCenter" //接受推送或者网络跳转
#define REFRESHAFTERCREATTOPIC @"refreshAfterCreatTopic" //创建话题后刷新相关页面
#define REFRESHAFTERNIGHTMODE @"refreshAfterNightMode" //更改夜间模式开关后刷新页面
#define REFRESHTOPICASK @"refrshTopicAsk"//提问成功以后刷新提问的数量
#define CLEARALLORDER @"clearAllOrder" //取消所有订阅
#define NEEDREFRESHORDER @"needRefreshOrder" //取消所有订阅
#define NEEDREFRESHCHANGEREADMODE @"needRefreshChangeReadMode" //更改阅读模式
#define CHANGEUSERNAMESUCCESS @"changeUserNameSuccess" //更改姓名成功
#define CHANGEUSERPICSUCCESS @"changeUserPicSuccess" //更改头像成功
#define APP_REFRESH_NOTIFICATION @"app_refresh_notification" //回到前台
#define APP_RESIGNACTIVE_NOTIFICATION @"ResignActive"
#define TOPIC_FOUR_LINE_HEIGHT (isIOS9 && [[TPUserDefault instance].isUseSystemFont integerValue] == 0 ? ((13+7)*4+7+6):((13+7)*4+7))
|