Ignite Tools
Shared/Airship/Common/UAEvent.h
00001 /*
00002  Copyright 2009-2011 Urban Airship Inc. All rights reserved.
00003  
00004  Redistribution and use in source and binary forms, with or without
00005  modification, are permitted provided that the following conditions are met:
00006  
00007  1. Redistributions of source code must retain the above copyright notice, this
00008  list of conditions and the following disclaimer.
00009  
00010  2. Redistributions in binaryform must reproduce the above copyright notice,
00011  this list of conditions and the following disclaimer in the documentation
00012  and/or other materials provided withthe distribution.
00013  
00014  THIS SOFTWARE IS PROVIDED BY THE URBAN AIRSHIP INC``AS IS'' AND ANY EXPRESS OR
00015  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00016  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
00017  EVENT SHALL URBAN AIRSHIP INC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00018  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00019  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00020  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00021  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
00022  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00023  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00024  */
00025 
00026 #import <Foundation/Foundation.h>
00027 
00028 #define kEventAppInitSize               450//397 w/ push id, no inbox id
00029 #define kEventAppExitSize               200//136 w/ only network type
00030 #define kEventDeviceRegistrationSize    200//153 w/ only user info
00031 #define kEventPushReceivedSize          200//160 w/ uuid push info
00032 
00033 @interface UAEvent : NSObject
00034 {
00035     NSString *time, *event_id;
00036     NSMutableDictionary *data;
00037 }
00038 
00039 @property (nonatomic, readonly) NSString *time, *event_id;
00040 @property (nonatomic, readonly) NSMutableDictionary *data;
00041 
00042 + (id)event;
00043 - (id)initWithContext:(NSDictionary*)context;
00044 + (id)eventWithContext:(NSDictionary*)context;
00045 - (NSString*)getType;
00046 - (void)gatherData:(NSDictionary*)context;
00047 - (int)getEstimatedSize;
00048 
00049 @end
00050 
00051 @interface UAEventCustom : UAEvent
00052 {
00053     NSString *type;
00054 }
00055 - (id)initWithType:(NSString*)aType;
00056 + (id)eventWithType:(NSString*)aType;
00057 - (id)initWithType:(NSString*)aType andContext:(NSDictionary*)context;
00058 + (id)eventWithType:(NSString*)aType andContext:(NSDictionary*)context;
00059 @end
00060 
00061 
00062 @interface UAEventAppInit : UAEvent
00063 {}
00064 @end
00065 
00066 @interface UAEventAppForeground : UAEventAppInit
00067 {}
00068 @end
00069 
00070 @interface UAEventAppExit : UAEvent
00071 {}
00072 @end
00073 
00074 @interface UAEventAppBackground : UAEventAppExit
00075 {}
00076 @end
00077 
00078 @interface UAEventDeviceRegistration : UAEvent
00079 {}
00080 @end
00081 
00082 @interface UAEventPushReceived : UAEvent
00083 {}
00084 @end
 All Classes Functions Variables Properties