<commit_before>/*
 * PhoneGap is available under *either* the terms of the modified BSD license *or* the
 * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
 * 
 * Copyright (c) 2005-2010, Nitobi Software Inc.
 * Copyright (c) 2011, IBM Corporation
 * Copyright (c) 2011, Ambrose Software, Inc
 * 
 */

#import <Foundation/Foundation.h>
#import "PGPlugin.h"

enum DestinationType {
	DestinationTypeDataUrl = 0,
	DestinationTypeFileUri
};
typedef NSUInteger DestinationType;

enum EncodingType {
    EncodingTypeJPEG = 0,
    EncodingTypePNG
};
typedef NSUInteger EncodingType;


@interface CameraPicker : UIImagePickerController
{
	NSString* callbackid;
	NSInteger quality;
  CGSize targetSize;
  bool correctOrientation;
	NSString* postUrl;
	enum DestinationType returnType;
    enum EncodingType encodingType;
	UIPopoverController* popoverController; 
}


@property (assign) NSInteger quality;
@property (copy)   NSString* callbackId;
@property (copy)   NSString* postUrl;
@property (nonatomic) enum DestinationType returnType;
@property (nonatomic) enum EncodingType encodingType;
@property (assign) UIPopoverController* popoverController; 
@property (assign) CGSize targetSize;
@property (assign) bool correctOrientation;

- (void) dealloc;

@end

// ======================================================================= //

@interface PGCamera : PGPlugin<UIImagePickerControllerDelegate, 
									UINavigationControllerDelegate,
									UIPopoverControllerDelegate>
{
	CameraPicker* pickerController;
}

@property (retain) CameraPicker* pickerController;

/*
 * getPicture
 *
 * arguments:
 *	1: this is the javascript function that will be called with the results, the first parameter passed to the
 *		javascript function is the picture as a Base64 encoded string
 *  2: this is the javascript function to be called if there was an error
 * options:
 *	quality: integer between 1 and 100
 */
- (void) getPicture:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) postImage:(UIImage*)anImage withFilename:(NSString*)filename toUrl:(NSURL*)url;<commit_msg>Fixed #228 getPicture crashes when getting picture from photobook on iPad<commit_after>/*
 * PhoneGap is available under *either* the terms of the modified BSD license *or* the
 * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
 * 
 * Copyright (c) 2005-2010, Nitobi Software Inc.
 * Copyright (c) 2011, IBM Corporation
 * Copyright (c) 2011, Ambrose Software, Inc
 * 
 */

#import <Foundation/Foundation.h>
#import "PGPlugin.h"

enum DestinationType {
	DestinationTypeDataUrl = 0,
	DestinationTypeFileUri
};
typedef NSUInteger DestinationType;

enum EncodingType {
    EncodingTypeJPEG = 0,
    EncodingTypePNG
};
typedef NSUInteger EncodingType;


@interface CameraPicker : UIImagePickerController
{
}


@property (assign) NSInteger quality;
@property (copy)   NSString* callbackId;
@property (copy)   NSString* postUrl;
@property (nonatomic) enum DestinationType returnType;
@property (nonatomic) enum EncodingType encodingType;
@property (retain) UIPopoverController* popoverController; 
@property (assign) CGSize targetSize;
@property (assign) bool correctOrientation;

- (void) dealloc;

@end

// ======================================================================= //

@interface PGCamera : PGPlugin<UIImagePickerControllerDelegate, 
									UINavigationControllerDelegate,
									UIPopoverControllerDelegate>
{
	CameraPicker* pickerController;
}

@property (retain) CameraPicker* pickerController;

/*
 * getPicture
 *
 * arguments:
 *	1: this is the javascript function that will be called with the results, the first parameter passed to the
 *		javascript function is the picture as a Base64 encoded string
 *  2: this is the javascript function to be called if there was an error
 * options:
 *	quality: integer between 1 and 100
 */
- (void) getPicture:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) postImage:(UIImage*)anImage withFilename:(NSString*)filename toUrl:(NSURL*)url;
{'fraction_non_alphanumeric': 0.12093023255813953, 'fraction_numerical': 0.015422276621787025, 'mean_word_length': 5.414442700156986, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6246371', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1120, 'n_words': 367}