You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/03/23 20:53:08 UTC

[2/2] ios commit: Added older plugin compatibility headers.

Added older plugin compatibility headers.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/e231d3dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/e231d3dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/e231d3dd

Branch: refs/heads/master
Commit: e231d3ddba8e49673b10ac23ec8ddd79f470540f
Parents: 9d5749b
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Mar 23 12:49:49 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Mar 23 12:49:49 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/compatibility/0.9.6/CDV.h       |   31 +++++++++
 CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.h |   49 +++++++++++++++
 CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.m |   30 +++++++++
 CordovaLib/Classes/compatibility/1.5.0/CDV.h       |   33 ++++++++++
 CordovaLib/Classes/compatibility/1.5.0/CDVPlugin.h |   24 +++++++
 CordovaLib/Classes/compatibility/README.txt        |    4 +
 6 files changed, 171 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/e231d3dd/CordovaLib/Classes/compatibility/0.9.6/CDV.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/compatibility/0.9.6/CDV.h b/CordovaLib/Classes/compatibility/0.9.6/CDV.h
new file mode 100644
index 0000000..7e43cdd
--- /dev/null
+++ b/CordovaLib/Classes/compatibility/0.9.6/CDV.h
@@ -0,0 +1,31 @@
+/*
+ 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.
+ */
+
+//  Bridge implementation file for using Cordova plugins in PhoneGap 0.9.6.
+//
+
+/* 
+ Returns YES if it is at least version specified as NSString(X)
+ Usage: 
+ if (IsAtLeastiOSVersion(@"5.1")) {
+ // do something for iOS 5.1 or greater
+ }
+ */
+#define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending)
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/e231d3dd/CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.h b/CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.h
new file mode 100644
index 0000000..a05626b
--- /dev/null
+++ b/CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.h
@@ -0,0 +1,49 @@
+/*
+ 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.
+ */
+
+//  Bridge implementation file for using Cordova plugins in PhoneGap 0.9.6.
+//
+
+#ifdef PHONEGAP_FRAMEWORK
+    #import <PhoneGap/PGPlugin.h>
+#else
+    #import "PGPlugin.h"
+#endif
+
+typedef enum {
+	CDVCommandStatus_NO_RESULT = 0,
+	CDVCommandStatus_OK,
+	CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION,
+	CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION,
+	CDVCommandStatus_INSTANTIATION_EXCEPTION,
+	CDVCommandStatus_MALFORMED_URL_EXCEPTION,
+	CDVCommandStatus_IO_EXCEPTION,
+	CDVCommandStatus_INVALID_ACTION,
+	CDVCommandStatus_JSON_EXCEPTION,
+	CDVCommandStatus_ERROR
+} CDVCommandStatus;
+
+
+
+@interface CDVPlugin : PGPlugin
+@end
+
+@interface CDVPluginResult : PluginResult
+@end
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/e231d3dd/CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.m b/CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.m
new file mode 100644
index 0000000..2eb3143
--- /dev/null
+++ b/CordovaLib/Classes/compatibility/0.9.6/CDVPlugin.m
@@ -0,0 +1,30 @@
+/*
+ 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.
+ */
+
+//  Bridge implementation file for using Cordova plugins in PhoneGap 0.9.6.
+//
+
+#import "CDVPlugin.h"
+
+@implementation CDVPlugin
+@end
+
+@implementation CDVPluginResult
+@end
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/e231d3dd/CordovaLib/Classes/compatibility/1.5.0/CDV.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/compatibility/1.5.0/CDV.h b/CordovaLib/Classes/compatibility/1.5.0/CDV.h
new file mode 100644
index 0000000..b3ddd8c
--- /dev/null
+++ b/CordovaLib/Classes/compatibility/1.5.0/CDV.h
@@ -0,0 +1,33 @@
+/*
+ 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.
+ */
+
+//  Bridge implementation file for using Cordova > 1.5 plugins in 1.5.0.
+//
+
+#import <Cordova/CDV.h>
+
+/* 
+ Returns YES if it is at least version specified as NSString(X)
+ Usage: 
+ if (IsAtLeastiOSVersion(@"5.1")) {
+ // do something for iOS 5.1 or greater
+ }
+ */
+#define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending)
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/e231d3dd/CordovaLib/Classes/compatibility/1.5.0/CDVPlugin.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/compatibility/1.5.0/CDVPlugin.h b/CordovaLib/Classes/compatibility/1.5.0/CDVPlugin.h
new file mode 100644
index 0000000..030b6a5
--- /dev/null
+++ b/CordovaLib/Classes/compatibility/1.5.0/CDVPlugin.h
@@ -0,0 +1,24 @@
+/*
+ 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.
+ */
+
+//  Bridge implementation file for using Cordova > 1.5 plugins in 1.5.0.
+//
+
+#import <Cordova/CDVPlugin.h>
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/e231d3dd/CordovaLib/Classes/compatibility/README.txt
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/compatibility/README.txt b/CordovaLib/Classes/compatibility/README.txt
new file mode 100644
index 0000000..e2b4030
--- /dev/null
+++ b/CordovaLib/Classes/compatibility/README.txt
@@ -0,0 +1,4 @@
+Include these headers if you are using a bleeding edge plugin in an older version of Cordova.
+
+1.5.0 -- only for 1.5.0 projects
+0.9.6 -- for projects between 0.9.6 and 1.4.1
\ No newline at end of file