include/OFAnnouncement.h

Go to the documentation of this file.
00001 //  Copyright 2009-2010 Aurora Feint, Inc.
00002 // 
00003 //  Licensed under the Apache License, Version 2.0 (the "License");
00004 //  you may not use this file except in compliance with the License.
00005 //  You may obtain a copy of the License at
00006 //  
00007 //      http://www.apache.org/licenses/LICENSE-2.0
00008 //      
00009 //  Unless required by applicable law or agreed to in writing, software
00010 //  distributed under the License is distributed on an "AS IS" BASIS,
00011 //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012 //  See the License for the specific language governing permissions and
00013 //  limitations under the License.
00014 
00015 #pragma once
00016 
00017 #import "OFForumThread.h"
00018 
00019 @protocol OFAnnouncementDelegate;
00020 @class OFRequestHandle;
00021 
00029 enum EAnnouncementSortType
00030 {
00031     EAnnouncementSortType_CREATION_DATE = 0,
00032     EAnnouncementSortType_UPDATE_DATE,
00033     EAnnouncementSortType_COUNT,
00034 };
00035 
00040 @interface OFAnnouncement : OFForumThread <OFCallbackable>
00041 {
00042     NSString* body;
00043     NSDate* originalPostDate;
00044     BOOL isImportant;
00045     BOOL isUnread;
00046     NSString* linkedClientApplicationId;
00047 }
00048 
00055 + (void)setDelegate:(id<OFAnnouncementDelegate>)delegate;
00056 
00066 + (OFRequestHandle*)downloadAnnouncementsAndSortBy:(EAnnouncementSortType)sortType;
00067 
00076 - (OFRequestHandle*)getPosts;
00077 
00086 - (void)markAsRead;
00087 
00091 @property (nonatomic, readonly) NSString* body;
00092 
00096 @property (nonatomic, readonly) NSDate* originalPostDate;
00097 
00106 @property (nonatomic, readonly) BOOL isUnread;
00107 
00118 
00122 - (NSComparisonResult)compareByCreationDate:(OFAnnouncement*)announcement;
00123 - (NSComparisonResult)compareByUpdateDate:(OFAnnouncement*)announcement;
00124 @property (nonatomic, readonly) BOOL isImportant;
00125 @property (nonatomic, readonly) NSString* linkedClientApplicationId;
00126 
00127 @end
00128 
00129 
00134 @protocol OFAnnouncementDelegate
00135 @optional
00136 
00144 - (void)didDownloadAnnouncementsAppAnnouncements:(NSArray*)appAnnouncements devAnnouncements:(NSArray*)devAnnouncements;
00145 
00149 - (void)didFailDownloadAnnouncements;
00150 
00158 - (void)didGetPosts:(NSArray*)posts OFAnnouncement:(OFAnnouncement*)announcement;
00159 
00165 - (void)didFailGetPostsOFAnnouncement:(OFAnnouncement*)announcement;
00166 
00167 @end
00168 
00169 
00170 
00171 
00172 
 All Classes Files Functions Variables Enumerations Enumerator Properties