//
//  UserlDefind.h

//
//  Created by xia bob on 15-4-10.

//

#ifndef Joyway_Alarm_UserlDefind_h
#define Joyway_Alarm_UserlDefind_h

#define  SCREEN_WIDTH   [UIScreen mainScreen].bounds.size.width
#define  SCREEN_HEIGHT    [UIScreen mainScreen].bounds.size.height

#define iPhone4s ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO) //是否iPhone6

#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO) //是否iPhone5

#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO) //是否iPhone6


/*-------------------系统版本--------------------*/
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]

//计算文字长度宽度
#define SIZE_OF_STRING(string,fontsize,maxWidth) string != nil ?[(string) sizeWithFont:[UIFont systemFontOfSize:(fontsize)] constrainedToSize:CGSizeMake((maxWidth), 20000.0f)] : CGSizeMake(0, 0)

//设置矩形大小
#define YW_rect(x,y,w,h) CGRectMake(x,y,w,h)

//导航条背景图片名称
#define TITLE_BG_NAME   @"bg_title_topbar.png"

//导航条高度
#define TITLE_HIGHT     (IOS_VERSION>=(7.0)?(64.0):(44.0))
#define TITLE_GAP_HIGHT     (IOS_VERSION>=(7.0)?(20.0):(0.0))
#define TITLE_UGAP_HIGHT    (IOS_VERSION>=(7.0)?(0.0):(20.0))

//页面背景色值
#define VIEW_BG_COLOR   @"#CDE1EF"

//tag dictionary 字段名
#define TAGADDRESS      @"tagAdress"
#define NAME            @"name"
#define LATITUDE        @"latitude"
#define LONGIDE         @"longitude"
#define ADRESS          @"adress"
#define LOSTTIME        @"lostTime"

//通知的名称
#define NOTIFY_CONNECTION           @"NOTIFY_CONNECTION"
#define NOTIFY_DISCONNECTION        @"NOTIFY_DISCONNECTION"
#define NOTIFY_CHANGE_RSSI          @"NOTIFY_CHANGE_RSSI"
#define NOTIFY_SCAN_NEW_ADDRESS     @"NOTIFY_SCAN_NEW_ADDRESS"
#define NOTIFY_ADD_DEVICE           @"NOTIFY_ADD_DEVICE"
#define NOTIFY_CHANGE_ICON          @"NOTIFY_CHANGE_ICON"
#define NOTIFY_CHANGE_NICKNAME      @"NOTIFY_CHANGE_NICKNAME"
#define NOTIFY_PHONE_ALERT_FIND_PHONE           @"NOTIFY_PHONE_ALERT_FIND_PHONE"
#define NOTIFY_PHONE_ALERT_OUT_OF_SAFE_RANGE    @"NOTIFY_PHONE_ALERT_OUT_OF_SAFE_RANGE"
#define NOTIFY_PHONE_ALERT_DISCONNECT           @"NOTIFY_PHONE_ALERT_DISCONNECT"
#define NOTIFY_TAG_DATA             @"NOTIFY_TAG_DATA"


// setting 里面的宏

#define   SETTING_INIT                          @"SETTING_INIT"//setting是否初始化

#define   SETTING_PHONE_RING_WHEN_CONNECTED     @"SETTING_PHONE_RING_WHEN_CONNECTED"
#define   SETTING_TAG_RING_WHEN_CONNECTED       @"SETTING_TAG_RING_WHEN_CONNECTED"
#define   SETTING_PHONE_RING_WHEN_DISCONNECTED  @"SETTING_PHONE_RING_WHEN_DISCONNECTED"
#define   SETTING_TAG_RING_WHEN_DISCONNECTED    @"SETTING_TAG_RING_WHEN_DISCONNECTED"

#define   SETTING_SHAKE                         @"SETTING_SHAKE"//报警时振动
#define   SETTING_FLASHLIGHT                    @"SETTING_FLASHLIGHT"//报警时闪光灯
#define   SETTING_ALARM_TIME_LENGTH             @"SETTING_ALARM_TIME_LENGTH"//报警时长
#define   SETTING_RECONNECT_TIME_LENGTH         @"SETTING_RECONNECT_TIME_LENGTH"//重连播放铃声
#define   SETTING_SAFE_DISTANCE                 @"SETTING_SAFE_DISTANCE"//报警距离
#define   SETTING_ALARM_SOUND                   @"SETTING_ALARM_SOUND" //报警铃声
#define   SETTING_LOST_LOCATE_MODE              @"SETTING_LOST_LOCATE_MODE" //定位精度


//

#define   TAG_BUTTON_FUNCTION  @"TAG_BUTTON_FUNCTION" //铃声模式，拍照模式。。。

//每一个页面顶部，标题文字的字体和坐标
#define HEADER_TITLE_FONT       ([UIFont systemFontOfSize:17.0f])
#define HEADER_TITLE_RECT       (CGRectMake(0, 20,SCREEN_WIDTH , 30))

//每一个页面顶部，按钮的字体和坐标
#define HEADER_LEFT_BUTTON_RECT     (CGRectMake(10, 20, 70, 40))
#define HEADER_RIGHT_BUTTON_RECT    (CGRectMake(SCREEN_WIDTH - 80, 20, 80, 40))
#define HEADER_BUTTON_FONT          ([UIFont systemFontOfSize:17.0f])


#define BACK_COLOR  ([[UIColor alloc] initWithRed:((double)0x00)/256 green:((double)0xc2)/256 blue:((double)0xb0)/256 alpha:1])





#endif



