aboutsummaryrefslogtreecommitdiffstats
path: root/iPhone/CordovaLib/Classes/CDVCommandDelegate.h
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-03-25 12:48:43 +0000
committerStruan Donald <struan@exo.org.uk>2013-03-25 13:15:45 +0000
commit5ecc3c7d6049e0006f6dc25204f2ba5793864586 (patch)
tree7f5c026524b54a9ab59255d25473a870ede630e8 /iPhone/CordovaLib/Classes/CDVCommandDelegate.h
parent6a80df824846ddf74fda82835b997de886d67567 (diff)
Upgrade to iOS phonegap 2.3
Diffstat (limited to 'iPhone/CordovaLib/Classes/CDVCommandDelegate.h')
-rwxr-xr-xiPhone/CordovaLib/Classes/CDVCommandDelegate.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/iPhone/CordovaLib/Classes/CDVCommandDelegate.h b/iPhone/CordovaLib/Classes/CDVCommandDelegate.h
new file mode 100755
index 0000000..4a53f98
--- /dev/null
+++ b/iPhone/CordovaLib/Classes/CDVCommandDelegate.h
@@ -0,0 +1,48 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 "CDVAvailability.h"
+#import "CDVInvokedUrlCommand.h"
+
+@class CDVPlugin;
+@class CDVPluginResult;
+
+@protocol CDVCommandDelegate <NSObject>
+
+- (NSString*)pathForResource:(NSString*)resourcepath;
+- (id)getCommandInstance:(NSString*)pluginName;
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className CDV_DEPRECATED(2.2, "Use CDVViewController to register plugins, or use config.xml.");
+
+// Plugins should not be using this interface to call other plugins since it
+// will result in bogus callbacks being made.
+- (BOOL)execute:(CDVInvokedUrlCommand*)command CDV_DEPRECATED(2.2, "Use direct method calls instead.");
+
+// Sends a plugin result to the JS. This is thread-safe.
+- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId;
+// Evaluates the given JS. This is thread-safe.
+- (void)evalJs:(NSString*)js;
+// Can be used to evaluate JS right away instead of scheduling it on the run-loop.
+// This is required for dispatch resign and pause events, but should not be used
+// without reason. Without the run-loop delay, alerts used in JS callbacks may result
+// in dead-lock. This method must be called from the UI thread.
+- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
+// Runs the given block on a background thread using a shared thread-pool.
+- (void)runInBackground:(void (^)())block;
+
+@end