Ignite Tools
Shared/Airship/Library/SubscriptionLib/UASubscription.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 @class UASubscriptionProduct;
00029 @class UASubscriptionContent;
00030 
00031 @interface UASubscription : NSObject {
00032   @private
00033     NSString *key;
00034     NSString *name;
00035     BOOL subscribed;
00036     NSMutableArray *products;
00037     // copies of products that have been purchased
00038     NSMutableArray *purchasedProducts;
00039     NSMutableArray *availableProducts;
00040     NSMutableArray *availableContents;
00041     NSMutableArray *downloadedContents;
00042     NSMutableArray *undownloadedContents;
00043 }
00044 
00048 
00050 @property (nonatomic, retain, readonly) NSString *key;
00051 
00053 @property (nonatomic, retain, readonly) NSString *name;
00054 
00055 //TODO: is this currently subscribed?
00057 @property (nonatomic, assign, readonly) BOOL subscribed;
00058 
00059 
00063 
00068 @property (nonatomic, retain, readonly) NSMutableArray *products;
00069 
00079 @property (nonatomic, retain, readonly) NSMutableArray *purchasedProducts;
00080 
00086 @property (nonatomic, retain, readonly) NSMutableArray *availableProducts;
00087 
00091 @property (nonatomic, retain, readonly) NSMutableArray *availableContents;
00092 
00094 @property (nonatomic, retain, readonly) NSMutableArray *downloadedContents;
00095 
00097 @property (nonatomic, retain, readonly) NSMutableArray *undownloadedContents;
00098 
00099 // Private methods
00100 - (id)initWithKey:(NSString *)aKey name:(NSString *)aName;
00101 - (void)setProductsWithArray:(NSArray *)productArray;
00102 - (void)setPurchasedProductsWithArray:(NSArray *)infos;
00103 - (void)setContentWithArray:(NSArray *)content;
00104 - (void)filterDownloadedContents;
00105 
00106 @end
 All Classes Functions Variables Properties