Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:forcedotcom/callback-ios into sfd…
Browse files Browse the repository at this point in the history
…c_pull_requests
  • Loading branch information
tstellanova-sfdc committed Nov 30, 2011
2 parents 457d34d + ffe04b7 commit d9126ab
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 86 deletions.
84 changes: 80 additions & 4 deletions PhoneGapLib/Classes/PhoneGapDelegate.h
Expand Up @@ -30,29 +30,105 @@
@property (nonatomic, readonly, retain) NSDictionary *settings;
@property (nonatomic, readonly, retain) PGWhitelist* whitelist; // readonly for public


#pragma mark - App settings

+ (NSDictionary*)getBundlePlist:(NSString *)plistName;
+ (NSString*) wwwFolderName;
+ (NSString*) pathForResource:(NSString*)resourcepath;
+ (NSString*) phoneGapVersion;
+ (NSString*) applicationDocumentsDirectory;

/**
@return URL string for the first page that should be loaded in the web view: defaults to www/index.html
*/
+ (NSString*) startPage;

/**
@return NSString The first URL scheme supported by this app, if any registered with CFBundleURLSchemes in the app .plist
*/
- (NSString*) appURLScheme;

/**
@return NSDictionary A set of device and app properties
*/
- (NSDictionary*) deviceProperties;


#pragma mark - Command Queue

- (int)executeQueuedCommands;
- (void)flushCommandQueue;
- (BOOL) execute:(InvokedUrlCommand*)command;

#pragma mark - Plugin Management

/**
*/
- (void)reinitializePlugins;

/**
Get an instance of the named plugin. This method creates a new instance if
one does not already exist. If there is an existing instance, this method returns it.
Thus, plugins are essentially singletons.
@param pluginName Class name for plugin, eg "com.salesforce.com.foo"
@return Singleton instance of the named plugin
*/
- (id) getCommandInstance:(NSString*)pluginName;
- (void) javascriptAlert:(NSString*)text;
- (BOOL) execute:(InvokedUrlCommand*)command;
- (NSString*) appURLScheme;
- (NSDictionary*) deviceProperties;


#pragma mark - Embedded UIWebView management

/**
Tear down the existing web view.
@see reinitializeWebView
*/
- (void)teardownWebView;

/**
(re)Initialize the embedded web view.
@see teardownWebView
*/
- (void)reinitializeWebView;

/**
Load the start page into the embedded web view.
*/
- (void)loadStartPageIntoWebView;


/**
Configure the web view from self.settings.
@param aWebView The web view to configure;
*/
- (void)configureWebViewFromSettings:(UIWebView*)aWebView;


#pragma mark - Application state transitions
- (void)applicationDidEnterBackground:(UIApplication *)application;
- (void)applicationWillEnterForeground:(UIApplication *)application;
- (void)applicationWillResignActive:(UIApplication *)application;
- (void)applicationWillTerminate:(UIApplication *)application;


#pragma mark - Public


/**
Force a javascript alert to be shown in the embedded UIWebView
@param text Message to be shown in the web view in a javascript alert.
*/
- (void) javascriptAlert:(NSString*)text;




@end



@interface NSDictionary (LowercaseKeys)

- (NSDictionary*) dictionaryWithLowercaseKeys;
Expand Down

0 comments on commit d9126ab

Please sign in to comment.