![]() |
Ignite Tools
|
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 "UAInbox.h" 00027 #import "UAInboxMessageListObserver.h" 00028 #import "UAInboxMessage.h" 00029 #import "UAUser.h" 00030 00031 typedef enum { 00032 UABatchReadMessages, 00033 UABatchDeleteMessages, 00034 } UABatchUpdateCommand; 00035 00036 typedef enum { 00037 UABatchReadMessagesSuccess, 00038 UABatchDeleteMessagesSuccess, 00039 UABatchReadMessagesFailed, 00040 UABatchDeleteMessagesFailed, 00041 } UABatchUpdateResult; 00042 00043 @class UAInboxMessage; 00044 00045 @interface UAInboxMessageList : UAObservable <UAUserObserver> { 00046 NSMutableArray* messages; 00047 // If unreadCount < 0, that means the message list hasn't retrieved. 00048 int unreadCount; 00049 int isRetriving; 00050 BOOL isBatchUpdating; 00051 } 00052 00053 + (UAInboxMessageList*)defaultInbox; 00054 + (void)land; 00055 00056 - (void)retrieveMessageList; 00057 - (BOOL)batchUpdate:(NSIndexSet *)messageIDs option:(UABatchUpdateCommand)option; 00058 - (BOOL)isBusying; 00059 00060 - (int)messageCount; 00061 - (UAInboxMessage *)messageForID:(NSString *)mid; 00062 - (UAInboxMessage*)messageAtIndex:(int)index; 00063 - (int)indexOfMessage:(UAInboxMessage *)message; 00064 00065 - (void)requestWentWrong:(UA_ASIHTTPRequest *)request; 00066 00067 @property(nonatomic, retain) NSMutableArray* messages; 00068 @property(assign) int unreadCount; 00069 @property(assign) int isRetrieving; 00070 @property(assign) BOOL isBatchUpdating; 00071 00072 @end