2012-08-25 10:38:29 +00:00
|
|
|
//
|
|
|
|
// GooglePlusSampleShareViewController.h
|
|
|
|
//
|
|
|
|
// Copyright 2012 Google Inc.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <MessageUI/MFMailComposeViewController.h>
|
|
|
|
#import <MessageUI/MessageUI.h>
|
|
|
|
#import <UIKit/UIKit.h>
|
2013-01-31 21:22:37 +00:00
|
|
|
#import "GPPShare.h"
|
2012-08-25 10:38:29 +00:00
|
|
|
|
|
|
|
// A view controller for the Google+ share dialog which contains a text field
|
|
|
|
// to prefill the user comment, and a text field for an optional URL to share.
|
|
|
|
// A Google+ share button is provided to launch the share dialog.
|
|
|
|
@interface GooglePlusSampleShareViewController : UIViewController<
|
2013-01-31 21:22:37 +00:00
|
|
|
GPPShareDelegate,
|
2012-08-25 10:38:29 +00:00
|
|
|
UITextFieldDelegate,
|
|
|
|
UIActionSheetDelegate,
|
2013-04-27 21:14:05 +00:00
|
|
|
UIPickerViewDataSource,
|
|
|
|
UIPickerViewDelegate,
|
2012-08-25 10:38:29 +00:00
|
|
|
MFMailComposeViewControllerDelegate> {
|
2013-01-31 21:22:37 +00:00
|
|
|
// Whether the keyboard is visible or not.
|
|
|
|
BOOL keyboardVisible_;
|
|
|
|
// The text field being edited.
|
|
|
|
UITextField *activeField_;
|
2012-08-25 10:38:29 +00:00
|
|
|
}
|
|
|
|
|
2013-04-27 21:14:05 +00:00
|
|
|
@property (retain, nonatomic) NSArray *callToActions;
|
|
|
|
@property (copy, nonatomic) NSString *selectedCallToAction;
|
|
|
|
@property (retain, nonatomic) UIPickerView *callToActionPickerView;
|
2012-08-25 10:38:29 +00:00
|
|
|
// The text to prefill the user comment in the share dialog.
|
|
|
|
@property (retain, nonatomic) IBOutlet UITextField *sharePrefillText;
|
|
|
|
// The URL resource to share in the share dialog.
|
|
|
|
@property (retain, nonatomic) IBOutlet UITextField *shareURL;
|
|
|
|
// A label to display the result of the share action.
|
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *shareStatus;
|
|
|
|
// A toolbar to share via Google+ or email.
|
|
|
|
@property (retain, nonatomic) IBOutlet UIToolbar *shareToolbar;
|
2013-04-27 21:14:05 +00:00
|
|
|
// A switch to toggle Google+ share with content deep linking.
|
|
|
|
@property (retain, nonatomic) IBOutlet UISwitch *addContentDeepLinkSwitch;
|
|
|
|
// The content deep-link ID to be attached with the Google+ share to qualify as
|
2013-01-31 21:22:37 +00:00
|
|
|
// a deep-link share.
|
2013-04-27 21:14:05 +00:00
|
|
|
@property (retain, nonatomic) IBOutlet UITextField *contentDeepLinkID;
|
2013-01-31 21:22:37 +00:00
|
|
|
// The share's title.
|
2013-04-27 21:14:05 +00:00
|
|
|
@property (retain, nonatomic) IBOutlet UITextField *contentDeepLinkTitle;
|
2013-01-31 21:22:37 +00:00
|
|
|
// The share's description.
|
2013-04-27 21:14:05 +00:00
|
|
|
@property (retain, nonatomic) IBOutlet UITextField *contentDeepLinkDescription;
|
2013-01-31 21:22:37 +00:00
|
|
|
// The share's thumbnail URL.
|
2013-04-27 21:14:05 +00:00
|
|
|
@property (retain, nonatomic) IBOutlet UITextField *contentDeepLinkThumbnailURL;
|
2013-01-31 21:22:37 +00:00
|
|
|
// The share view.
|
|
|
|
@property (retain, nonatomic) IBOutlet UIScrollView *shareScrollView;
|
|
|
|
@property (retain, nonatomic) IBOutlet UIView *shareView;
|
|
|
|
// Labels for Google+ share sample.
|
2013-04-27 21:14:05 +00:00
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *addContentDeepLinkLabel;
|
2013-01-31 21:22:37 +00:00
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *urlToShareLabel;
|
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *prefillTextLabel;
|
2013-04-27 21:14:05 +00:00
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *contentDeepLinkIDLabel;
|
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *contentDeepLinkTitleLabel;
|
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *contentDeepLinkDescriptionLabel;
|
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *contentDeepLinkThumbnailURLLabel;
|
2013-01-31 21:22:37 +00:00
|
|
|
@property (retain, nonatomic) IBOutlet UIButton *shareButton;
|
2013-04-27 21:14:05 +00:00
|
|
|
@property (retain, nonatomic) IBOutlet UISwitch *urlForContentDeepLinkMetadataSwitch;
|
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *urlForContentDeepLinkMetadataLabel;
|
|
|
|
// The switch for adding call-to-action button.
|
|
|
|
@property (retain, nonatomic) IBOutlet UISwitch *addCallToActionButtonSwitch;
|
|
|
|
@property (retain, nonatomic) IBOutlet UILabel *addCallToActionButtonLabel;
|
2012-08-25 10:38:29 +00:00
|
|
|
|
2013-04-27 21:14:05 +00:00
|
|
|
// Called when the switch for content deep link is toggled.
|
|
|
|
- (IBAction)contentDeepLinkSwitchToggle:(id)sender;
|
2013-01-31 21:22:37 +00:00
|
|
|
// Called when the switch for metadata from URL preview is toggled.
|
2013-04-27 21:14:05 +00:00
|
|
|
- (IBAction)urlForContentDeepLinkMetadataSwitchToggle:(id)sender;
|
2012-08-25 10:38:29 +00:00
|
|
|
// Called when the share button is pressed.
|
|
|
|
- (IBAction)shareButton:(id)sender;
|
|
|
|
// Called when the toolbar share button is pressed.
|
|
|
|
- (IBAction)shareToolbar:(id)sender;
|
|
|
|
|
|
|
|
@end
|