mirror of
https://gitee.com/shuto-github/phonegap-mobile-accessibility.git
synced 2026-04-19 00:01:32 +08:00
Initial commit of the plugin.
Stubs for iOS and the .js.
This commit is contained in:
37
plugin.xml
Normal file
37
plugin.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
xmlns:rim="http://www.blackberry.com/ns/widgets"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
id="com.phonegap.plugin.mobile-accessibility"
|
||||
version="0.1.0">
|
||||
<name>Mobile Accessibility</name>
|
||||
<description>PhoneGap Mobile Accessibility Plugin</description>
|
||||
<license>Apache 2.0</license>
|
||||
<keywords>phonegap, mobile accessibility</keywords>
|
||||
|
||||
<engines>
|
||||
<engine name="cordova" version=">=3.0.0" />
|
||||
</engines>
|
||||
|
||||
<js-module src="www/mobile-accessibility.js" name="mobile-accessibility">
|
||||
<clobbers target="window.MobileAccessibility" />
|
||||
</js-module>
|
||||
|
||||
<!-- ios -->
|
||||
<platform name="ios">
|
||||
<config-file target="config.xml" parent="/*">
|
||||
<feature name="MobileAccessibility">
|
||||
<param name="ios-package" value="CDVMobileAccessibility" onload="true" />
|
||||
</feature>
|
||||
</config-file>
|
||||
|
||||
<header-file src="src/ios/CDVMobileAccessibility.h" />
|
||||
<source-file src="src/ios/CDVMobileAccessibility.m" />
|
||||
</platform>
|
||||
|
||||
<!-- android -->
|
||||
<platform name="android">
|
||||
</platform>
|
||||
|
||||
</plugin>
|
||||
27
src/ios/CDVMobileAccessibility.h
Normal file
27
src/ios/CDVMobileAccessibility.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
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 <Cordova/CDVPlugin.h>
|
||||
|
||||
@interface CDVMobileAccessibility : CDVPlugin {
|
||||
}
|
||||
|
||||
- (void) isVoiceOverRunning:(CDVInvokedUrlCommand*)command;
|
||||
|
||||
@end
|
||||
64
src/ios/CDVMobileAccessibility.m
Normal file
64
src/ios/CDVMobileAccessibility.m
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
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 "CDVMobileAccessibility.h"
|
||||
#import <Cordova/CDVAvailability.h>
|
||||
|
||||
@interface CDVMobileAccessibility ()
|
||||
// add any property overrides
|
||||
@end
|
||||
|
||||
@implementation CDVMobileAccessibility
|
||||
|
||||
// //////////////////////////////////////////////////
|
||||
|
||||
- (id)settingForKey:(NSString*)key
|
||||
{
|
||||
return [self.commandDelegate.settings objectForKey:[key lowercaseString]];
|
||||
}
|
||||
|
||||
- (void)pluginInitialize
|
||||
{
|
||||
// SETTINGS ////////////////////////
|
||||
|
||||
NSString* setting = nil;
|
||||
|
||||
setting = @"YourConfigXmlSettingHere";
|
||||
if ([self settingForKey:setting]) {
|
||||
// set your setting, other init here
|
||||
}
|
||||
}
|
||||
|
||||
// //////////////////////////////////////////////////
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
// since this is ARC, remove observers only
|
||||
}
|
||||
|
||||
// //////////////////////////////////////////////////
|
||||
|
||||
#pragma Plugin interface
|
||||
|
||||
- (void) isVoiceOverRunning:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
// TODO:
|
||||
}
|
||||
|
||||
@end
|
||||
33
www/mobile-accessibility.js
Normal file
33
www/mobile-accessibility.js
Normal file
@@ -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.
|
||||
*
|
||||
*/
|
||||
|
||||
var argscheck = require('cordova/argscheck'),
|
||||
utils = require('cordova/utils'),
|
||||
exec = require('cordova/exec');
|
||||
|
||||
var MobileAccessibility = function() {
|
||||
};
|
||||
|
||||
MobileAccessibility.isVoiceOverRunning = function() {
|
||||
exec(null, null, "MobileAccessibility", "isVoiceOverRunning", []);
|
||||
};
|
||||
|
||||
module.exports = MobileAccessibility;
|
||||
Reference in New Issue
Block a user