|
| 1 | +// |
| 2 | +// Tweet.h |
| 3 | +// Coding_iOS |
| 4 | +// |
| 5 | +// Created by Ease on 15/3/9. |
| 6 | +// Copyright (c) 2015年 Coding. All rights reserved. |
| 7 | +// |
| 8 | + |
| 9 | +#import <Foundation/Foundation.h> |
| 10 | +#import "Comment.h" |
| 11 | +#import "User.h" |
| 12 | +#import "HtmlMedia.h" |
| 13 | + |
| 14 | +@interface Tweet : NSObject |
| 15 | +@property (readwrite, nonatomic, strong) NSString *content, *device; |
| 16 | +@property (readwrite, nonatomic, strong) NSNumber *liked, *activity_id, *id, *comments, *likes; |
| 17 | +@property (readwrite, nonatomic, strong) NSDate *created_at; |
| 18 | +@property (readwrite, nonatomic, strong) User *owner; |
| 19 | +@property (readwrite, nonatomic, strong) NSMutableArray *comment_list, *like_users; |
| 20 | +@property (readwrite, nonatomic, strong) NSDictionary *propertyArrayMap; |
| 21 | +@property (assign, nonatomic) BOOL canLoadMore, willLoadMore, isLoading; |
| 22 | +@property (readwrite, nonatomic, strong) HtmlMedia *htmlMedia; |
| 23 | + |
| 24 | +@property (readwrite, nonatomic, strong) NSMutableArray *tweetImages; |
| 25 | +@property (readwrite, nonatomic, strong) NSString *tweetContent; |
| 26 | +@property (readwrite, nonatomic, strong) NSString *nextCommentStr; |
| 27 | +@property (assign, nonatomic) CGFloat contentHeight; |
| 28 | + |
| 29 | +@property (strong, nonatomic) NSString *user_global_key, *pp_id; |
| 30 | + |
| 31 | +- (NSInteger)numOfComments; |
| 32 | +- (BOOL)hasMoreComments; |
| 33 | + |
| 34 | +- (NSInteger)numOfLikers; |
| 35 | +- (BOOL)hasMoreLikers; |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +- (NSString *)toDoLikePath; |
| 40 | +- (void)changeToLiked:(NSNumber *)liked; |
| 41 | + |
| 42 | +- (NSString *)toDoCommentPath; |
| 43 | +- (NSDictionary *)toDoCommentParams; |
| 44 | + |
| 45 | +- (NSString *)toLikersPath; |
| 46 | +- (NSDictionary *)toLikersParams; |
| 47 | + |
| 48 | +- (NSString *)toCommentsPath; |
| 49 | +- (NSDictionary *)toCommentsParams; |
| 50 | + |
| 51 | +- (NSString *)toDeletePath; |
| 52 | +- (NSString *)toDetailPath; |
| 53 | + |
| 54 | ++(Tweet *)tweetForSend; |
| 55 | + |
| 56 | +- (void)saveSendData; |
| 57 | +- (void)loadSendData; |
| 58 | ++ (void)removeSendData; |
| 59 | + |
| 60 | ++(Tweet *)tweetWithGlobalKey:(NSString *)user_global_key andPPID:(NSString *)pp_id; |
| 61 | +- (NSDictionary *)toDoTweetParams; |
| 62 | +- (BOOL)isAllImagesHaveDone; |
| 63 | +- (void)addNewComment:(Comment *)comment; |
| 64 | +- (void)deleteComment:(Comment *)comment; |
| 65 | +@end |
| 66 | + |
| 67 | + |
| 68 | +typedef NS_ENUM(NSInteger, TweetImageUploadState) |
| 69 | +{ |
| 70 | + TweetImageUploadStateInit = 0, |
| 71 | + TweetImageUploadStateIng, |
| 72 | + TweetImageUploadStateSuccess, |
| 73 | + TweetImageUploadStateFail |
| 74 | +}; |
| 75 | + |
| 76 | +@interface TweetImage : NSObject |
| 77 | +@property (readwrite, nonatomic, strong) UIImage *image; |
| 78 | +@property (assign, nonatomic) TweetImageUploadState uploadState; |
| 79 | +@property (readwrite, nonatomic, strong) NSString *imageStr; |
| 80 | ++ (instancetype)tweetImageWithImage:(UIImage *)image; |
| 81 | +@end |
0 commit comments