This repository was archived by the owner on Apr 8, 2023. It is now read-only.
forked from pj4533/DEComposeViewController
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDEComposeViewController.h
executable file
·109 lines (89 loc) · 5.55 KB
/
DEComposeViewController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//
// DEComposeViewController.h
// DEer
//
// Copyright (c) 2011-2012 Double Encore, Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the distribution. Neither the name of the Double Encore Inc. nor the names of its
// contributors may be used to endorse or promote products derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
@class DESheetCardView;
@class DETextView;
@interface DEComposeViewController : UIViewController <UITextViewDelegate, UIAlertViewDelegate, UIPopoverControllerDelegate, CLLocationManagerDelegate>
@property (retain, nonatomic) IBOutlet DESheetCardView *cardView;
@property (retain, nonatomic) IBOutlet UILabel *titleLabel;
@property (retain, nonatomic) IBOutlet UILabel *locationLabel;
@property (retain, nonatomic) IBOutlet UIButton *cancelButton;
@property (retain, nonatomic) IBOutlet UIButton *sendButton;
@property (retain, nonatomic) IBOutlet UIButton *locButton;
@property (retain, nonatomic) IBOutlet UIView *cardHeaderLineView;
@property (retain, nonatomic) IBOutlet DETextView *textView;
@property (retain, nonatomic) IBOutlet UIView *textViewContainer;
@property (retain, nonatomic) IBOutlet UIImageView *paperClipView;
@property (retain, nonatomic) IBOutlet UIImageView *attachment1FrameView;
@property (retain, nonatomic) IBOutlet UIImageView *attachment2FrameView;
@property (retain, nonatomic) IBOutlet UIImageView *attachment3FrameView;
@property (retain, nonatomic) IBOutlet UIImageView *attachment1ImageView;
@property (retain, nonatomic) IBOutlet UIImageView *attachment2ImageView;
@property (retain, nonatomic) IBOutlet UIImageView *attachment3ImageView;
@property (retain, nonatomic) IBOutlet UILabel *characterCountLabel;
@property (retain, nonatomic) CLLocationManager *locationManager;
@property (retain, nonatomic) CLLocation *bestEffortAtLocation;
@property (retain, nonatomic) NSString *stateString;
@property (retain, nonatomic) NSString *latString;
@property (retain, nonatomic) NSString *lonString;
@property BOOL showCoordinates;
@property BOOL useLocation;
- (IBAction)send;
- (IBAction)cancel;
- (IBAction)toggleLocButtonImage:(id)sender;
enum DEComposeViewControllerResult {
DEComposeViewControllerResultCancelled,
DEComposeViewControllerResultDone
};
typedef enum DEComposeViewControllerResult DEComposeViewControllerResult;
// Completion handler for DEComposeViewController
typedef void (^DEComposeViewControllerCompletionHandler)(DEComposeViewControllerResult result, NSString* message, UIImage* image, NSString *lat, NSString *lon);
//start updating coordinates
- (void)startUpdatingLocation;
// stop updating coordinates.
- (void)stopUpdatingLocation:(NSString *)state;
// Sets the initial text to be tweeted. Returns NO if the specified text will
// not fit within the character space currently available, or if the sheet
// has already been presented to the user.
- (BOOL)setInitialText:(NSString *)text;
// Adds an image to the tweet. Returns NO if the additional image will not fit
// within the character space currently available, or if the sheet has already
// been presented to the user.
- (BOOL)addImage:(UIImage *)image;
// Adds a URL to the tweet. Returns NO if the additional URL will not fit
// within the character space currently available, or if the sheet has already
// been presented to the user.
- (BOOL)addImageWithURL:(NSURL *)url;
// Removes all images from the tweet. Returns NO and does not perform an operation
// if the sheet has already been presented to the user.
- (BOOL)removeAllImages;
// Adds a URL to the tweet. Returns NO if the additional URL will not fit
// within the character space currently available, or if the sheet has already
// been presented to the user.
- (BOOL)addURL:(NSURL *)url;
// Removes all URLs from the tweet. Returns NO and does not perform an operation
// if the sheet has already been presented to the user.
- (BOOL)removeAllURLs;
// Specify a block to be called when the user is finished. This block is not guaranteed
// to be called on any particular thread.
@property (nonatomic, copy) DEComposeViewControllerCompletionHandler completionHandler;
// On iOS5+, set to YES to prevent from using built in Twitter credentials.
// Set to NO by default.
@property (assign, nonatomic) BOOL alwaysUseDETwitterCredentials;
@end