rhodes 3.2.3 → 3.3.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +10 -0
- data/Rakefile +153 -46
- data/doc/build.txt +261 -102
- data/doc/configuration.txt +5 -2
- data/doc/device-caps.txt +134 -23
- data/doc/extensions.txt +922 -69
- data/doc/generator.txt +96 -39
- data/doc/install.txt +35 -19
- data/doc/jqt-jqm-transition.txt +17 -1
- data/doc/rhom.txt +23 -2
- data/doc/rhostudio-eclipse.txt +49 -0
- data/doc/rhostudio-test-plan.txt +440 -0
- data/doc/simulator.txt +1 -1
- data/doc/synchronization.txt +40 -1
- data/lib/build/jake.rb +108 -7
- data/lib/extensions/barcode/ext/barcode/platform/android/Rakefile +0 -35
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +8 -2
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeCallbackHelper.mm +195 -195
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeViewController.m +6 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +5 -0
- data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode_wrap.c +64 -20
- data/lib/extensions/debugger/CHANGELOG +3 -0
- data/lib/extensions/debugger/debugger.rb +26 -21
- data/lib/extensions/digest-md5/ext/Rakefile +5 -5
- data/lib/extensions/digest-md5/ext/build +10 -1
- data/lib/extensions/digest-md5/ext/defs.h +19 -0
- data/lib/extensions/digest-md5/ext/digest-md5.vcproj +317 -9
- data/lib/extensions/digest-md5/ext/iphone/Dmd5.xcodeproj/project.pbxproj +290 -0
- data/lib/extensions/digest-md5/ext/iphone/Dmd5_Prefix.pch +7 -0
- data/lib/extensions/digest-md5/ext/iphone/Rakefile +79 -0
- data/lib/extensions/digest-sha1/ext/Rakefile +5 -5
- data/lib/extensions/digest-sha1/ext/build +10 -1
- data/lib/extensions/digest-sha1/ext/defs.h +19 -0
- data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +317 -9
- data/lib/extensions/digest-sha1/ext/iphone/Dsha1.xcodeproj/project.pbxproj +278 -0
- data/lib/extensions/digest-sha1/ext/iphone/Dsha1_Prefix.pch +7 -0
- data/lib/extensions/digest-sha1/ext/iphone/Rakefile +79 -0
- data/lib/extensions/digest/ext/Rakefile +5 -5
- data/lib/extensions/digest/ext/build +10 -1
- data/lib/extensions/digest/ext/digest.vcproj +317 -9
- data/lib/extensions/digest/ext/iphone/Digest.xcodeproj/project.pbxproj +270 -0
- data/lib/extensions/digest/ext/iphone/Digest_Prefix.pch +7 -0
- data/lib/extensions/digest/ext/iphone/Rakefile +79 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +10 -2
- data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +6 -0
- data/lib/extensions/fcntl/ext/Rakefile +5 -5
- data/lib/extensions/fcntl/ext/build +9 -1
- data/lib/extensions/fcntl/ext/iphone/Fcntl.xcodeproj/project.pbxproj +262 -0
- data/lib/extensions/fcntl/ext/iphone/Fcntl_Prefix.pch +7 -0
- data/lib/extensions/fcntl/ext/iphone/Rakefile +79 -0
- data/lib/extensions/net-http/net/http.rb +9 -7
- data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +64 -20
- data/lib/extensions/rhoxml/rexml/document.rb +3 -2
- data/lib/extensions/rhoxml/rexml/instruction.rb +70 -0
- data/lib/framework/builtinME.rb +9 -0
- data/lib/framework/date/format.rb +1 -1
- data/lib/framework/dateME.rb +19 -2
- data/lib/framework/rho/rho.rb +15 -4
- data/lib/framework/rho/rhoapplication.rb +1 -0
- data/lib/framework/rho/rhocontact.rb +10 -27
- data/lib/framework/rho/rhoevent_c.rb +8 -2
- data/lib/framework/rho/rhosupport.rb +25 -0
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhoframework.rb +15 -0
- data/lib/framework/rholang/localization_simplified.rb +8 -10
- data/lib/framework/rhom/rhom_object_factory.rb +8 -2
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/jni/Application.mk +2 -1
- data/platform/android/Rhodes/jni/include/rhodes.h +9 -0
- data/platform/android/Rhodes/jni/src/callbacks.cpp +31 -1
- data/platform/android/Rhodes/jni/src/event.cpp +75 -31
- data/platform/android/Rhodes/jni/src/nativeview.cpp +1 -1
- data/platform/android/Rhodes/jni/src/phonebook.cpp +73 -9
- data/platform/android/Rhodes/jni/src/rhodes.cpp +21 -0
- data/platform/android/Rhodes/jni/src/rhodesapp.cpp +16 -24
- data/platform/android/Rhodes/jni/src/signature.cpp +27 -1
- data/platform/android/Rhodes/{default.properties → project.properties} +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +14 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +14 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +38 -115
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +69 -52
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +9 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraNewService.java +21 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraOldService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraSemiService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +38 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/Event.java +212 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +82 -125
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +2 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +39 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +106 -136
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +26 -25
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java +40 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java +47 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality02.java +33 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality03.java +33 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality04.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality05.java +75 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality06.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality07.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality08.java +44 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality09.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality10.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionalityManager.java +73 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +57 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessor.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +322 -76
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +11 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +5 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +2 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +125 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +2 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebView.java +16 -0
- data/platform/android/build/RhodesSRC_build.files +14 -0
- data/platform/android/build/android.rake +149 -147
- data/platform/android/build/android_tools.rb +58 -0
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/android/build/libruby_build.files +3 -0
- data/platform/bb/RubyVM/src/com/rho/RhoConf.java +11 -1
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +11 -5
- data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +3 -2
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +2 -0
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +20 -8
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +9 -6
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +45 -18
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +1 -2
- data/platform/bb/build/bb.rake +84 -70
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +106 -14
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +1 -1
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +108 -16
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +10 -5
- data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +21 -4
- data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +17 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +8 -5
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +3 -1
- data/platform/iphone/Classes/AppManager/AppManager.m +15 -3
- data/platform/iphone/Classes/Event/Event.m +45 -2
- data/platform/iphone/Classes/MapView/MapViewController.m +8 -4
- data/platform/iphone/Classes/Phonebook/phonebook.m +30 -7
- data/platform/iphone/Classes/Rhodes.h +11 -1
- data/platform/iphone/Classes/Rhodes.m +141 -9
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +27 -1
- data/platform/iphone/Classes/SimpleMainView.h +1 -0
- data/platform/iphone/Classes/SimpleMainView.m +4 -0
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +31 -1
- data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +10 -0
- data/platform/iphone/rbuild/iphone.rake +33 -6
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +10 -2
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +22 -2
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +14 -0
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +10 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
- data/platform/osx/build/osx.rake +58 -7
- data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +427 -69
- data/platform/shared/RhoConnectClient/RhoConnectClient.h +21 -2
- data/platform/shared/common/Android.mk +2 -1
- data/platform/shared/common/AutoPointer.h +23 -0
- data/platform/shared/common/BundleManager.cpp +333 -0
- data/platform/shared/common/RhoFile.cpp +206 -23
- data/platform/shared/common/RhoFile.h +14 -4
- data/platform/shared/common/RhoFilePath.h +18 -0
- data/platform/shared/common/RhoStd.h +11 -1
- data/platform/shared/common/RhoThread.h +4 -1
- data/platform/shared/common/RhodesApp.cpp +31 -8
- data/platform/shared/common/RhodesApp.h +14 -0
- data/platform/shared/common/RhodesAppBase.cpp +6 -6
- data/platform/shared/common/RhodesAppBase.h +1 -1
- data/platform/shared/common/emml.h +34 -0
- data/platform/shared/common/iphone/RhoFileImpl.m +30 -2
- data/platform/shared/common/map/BaseMapEngine.cpp +3 -3
- data/platform/shared/common/map/GeocodingMapEngine.cpp +205 -14
- data/platform/shared/common/map/GeocodingMapEngine.h +25 -2
- data/platform/shared/common/map/MapEngine.cpp +24 -2
- data/platform/shared/common/map/MapEngine.h +23 -12
- data/platform/shared/common/phonebook/PhonebookParams.cpp +99 -0
- data/platform/shared/common/phonebook/PhonebookParams.h +52 -0
- data/platform/shared/common/rhoparams.cpp +14 -0
- data/platform/shared/common/rhoparams.h +1 -0
- data/platform/shared/db/DBAdapter.cpp +43 -24
- data/platform/shared/db/DBAdapter.h +6 -1
- data/platform/shared/db/DBAttrManager.cpp +50 -1
- data/platform/shared/logging/RhoLog.h +3 -0
- data/platform/shared/logging/RhoLogSink.cpp +5 -1
- data/platform/shared/net/CURLNetRequest.cpp +2 -0
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +14 -1
- data/platform/shared/qt/rhodes/impl/PhonebookImpl.cpp +2 -2
- data/platform/shared/qt/rhodes/impl/RhoFileImpl.cpp +1 -1
- data/platform/shared/qt/rhodes/impl/SignatureImpl.cpp +14 -2
- data/platform/shared/qt/rhodes/impl/SystemImpl.cpp +16 -2
- data/platform/shared/qt/rhodes/main.cpp +28 -0
- data/platform/shared/qt/rhodes/rhodes.pro +3 -0
- data/platform/shared/qt/rholib/rholib.pro +2 -1
- data/platform/shared/qt/rubylib/rubylib.pro +2 -1
- data/platform/shared/ruby/Android.mk +3 -0
- data/platform/shared/ruby/class.c +7 -0
- data/platform/shared/ruby/compile.c +18 -10
- data/platform/shared/ruby/encdb.h +18 -8
- data/platform/shared/ruby/eval.c +108 -2
- data/platform/shared/ruby/ext/alert/alert_wrap.c +64 -20
- data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +64 -20
- data/platform/shared/ruby/ext/bluetooth/bluetooth_wrap.c +67 -23
- data/platform/shared/ruby/ext/calendar/calendar_wrap.c +64 -20
- data/platform/shared/ruby/ext/calendar/event_wrap.c +64 -20
- data/platform/shared/ruby/ext/camera/camera_wrap.c +64 -20
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +64 -20
- data/platform/shared/ruby/ext/geolocation/geolocation.i +16 -0
- data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +127 -26
- data/platform/shared/ruby/ext/mapview/mapview_wrap.c +64 -20
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +65 -21
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +64 -20
- data/platform/shared/ruby/ext/navbar/navbar_wrap.c +64 -20
- data/platform/shared/ruby/ext/phonebook/phonebook.i +7 -7
- data/platform/shared/ruby/ext/phonebook/phonebook_wrap.c +95 -120
- data/platform/shared/ruby/ext/rho/rhoruby.c +4 -4
- data/platform/shared/ruby/ext/rho/rhoruby.h +2 -0
- data/platform/shared/ruby/ext/rho/rhosupport.c +39 -6
- data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +65 -21
- data/platform/shared/ruby/ext/ringtones/ringtones_wrap.c +64 -20
- data/platform/shared/ruby/ext/signature/signature.i +37 -5
- data/platform/shared/ruby/ext/signature/signature_wrap.c +274 -45
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +65 -21
- data/platform/shared/ruby/ext/system/system.i +14 -2
- data/platform/shared/ruby/ext/system/system_wrap.c +146 -25
- data/platform/shared/ruby/ext/webview/webview_wrap.c +65 -21
- data/platform/shared/ruby/include/ruby/ruby.h +15 -4
- data/platform/shared/ruby/inits.c +1 -0
- data/platform/shared/ruby/io.c +13 -3
- data/platform/shared/ruby/win32/win32.c +3 -3
- data/platform/shared/ruby/wince/io_wce.c +2 -2
- data/platform/shared/rubyext/System.cpp +9 -5
- data/platform/shared/sync/ClientRegister.cpp +18 -8
- data/platform/shared/sync/SyncEngine.cpp +25 -11
- data/platform/shared/sync/SyncEngine.h +2 -0
- data/platform/shared/sync/SyncSource.cpp +40 -15
- data/platform/shared/sync/SyncSource.h +3 -2
- data/platform/shared/sync/SyncThread.cpp +9 -4
- data/platform/shared/sync/SyncThread.h +3 -1
- data/platform/symbian/build/symbian.rake +14 -9
- data/platform/symbian/rhodes/rhodes.pro +11 -8
- data/platform/symbian/rhodes/src/phonebook/ruby_phonebook.cpp +2 -2
- data/platform/symbian/rubylib/rubylib.pro +3 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/wm/RhoLib/RhoLib.vcproj +315 -2
- data/platform/wm/build/build_inf.js +235 -187
- data/platform/wm/build/wm.rake +388 -233
- data/platform/wm/rhodes.sln +56 -0
- data/platform/wm/rhodes/MainWindow.cpp +139 -77
- data/platform/wm/rhodes/MainWindow.h +27 -22
- data/platform/wm/rhodes/MapView/{Graphics.cpp → Bitmap.cpp} +15 -253
- data/platform/wm/rhodes/MapView/Bitmap.h +86 -0
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +7 -2
- data/platform/wm/rhodes/MapView/MapViewManager.h +1 -1
- data/platform/wm/rhodes/MapView/Win32Graphics.cpp +263 -0
- data/platform/wm/rhodes/MapView/Win32Graphics.h +133 -0
- data/platform/wm/rhodes/MapView/WmGraphics.cpp +291 -0
- data/platform/wm/rhodes/MapView/{Graphics.h → WmGraphics.h} +14 -56
- data/platform/wm/rhodes/Rhodes.cpp +128 -32
- data/platform/wm/rhodes/Rhodes.rc +6 -2
- data/platform/wm/rhodes/camera/Camera.cpp +1 -0
- data/platform/wm/rhodes/phonebook/phonebook.cpp +2 -2
- data/platform/wm/rhodes/phonebook/phonebook.h +2 -2
- data/platform/wm/rhodes/resource.h +3 -2
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +6 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +4 -0
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.cpp +675 -0
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.h +123 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +12 -2
- data/platform/wm/rhodes/rhodes.vcproj +2732 -1113
- data/platform/wm/rhodes/simulator/MainWindowQt.h +1 -1
- data/platform/wm/rhodes/stdafx.h +1 -0
- data/platform/wm/rhoelements.sln +118 -62
- data/platform/wm/rubylib/rubylib.vcproj +345 -16
- data/platform/wm/sqlite3/sqlite3.vcproj +305 -0
- data/platform/wm/syncengine/syncengine.vcproj +309 -0
- data/platform/wm/tools/detool/LogServer.cpp +19 -2
- data/platform/wm/tools/detool/detool.cpp +131 -6
- data/platform/wm/tools/detool/detool.vcproj +3 -1
- data/platform/wm/tools/detool/stdafx.h +1 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Libraries/Builtins/RangeOps.cs +589 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Builtins/RubyEncoding.cs +678 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyExceptionData.cs +271 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyUtils.cs +31 -1
- data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.Libraries.dll +0 -0
- data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.dll +0 -0
- data/platform/wp7/RhoRubyLib/common/RhoStd.cs +6 -0
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +16 -2
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +2 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +1 -2
- data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +13 -10
- data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +30 -8
- data/platform/wp7/build/wp.rake +5 -0
- data/rakefile.rb +153 -46
- data/res/build-tools/detool.exe +0 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubyerrors.swg +155 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubyhead.swg +158 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubyiterators.swg +932 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubyrun.swg +448 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubystdfunctors.swg +162 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubytracking.swg +159 -0
- data/res/build-tools/swig_patch/Lib/ruby/std_basic_string.i +97 -0
- data/res/build-tools/swig_patch/Lib/ruby/std_map.i +418 -0
- data/res/build-tools/swig_patch/Lib/ruby/std_multimap.i +227 -0
- data/res/build-tools/swig_patch/Lib/swiginit.swg +269 -0
- data/res/build-tools/swig_patch/README +7 -0
- data/res/generators/templates/application/app/Settings/controller.rb +42 -1
- data/res/generators/templates/application/app/Settings/wait.erb +1 -1
- data/res/generators/templates/application/app/application.rb +1 -1
- data/res/generators/templates/application/app/layout.erb +8 -8
- data/res/generators/templates/application/build.yml +0 -1
- data/res/generators/templates/application/public/css/android.css +6 -0
- data/res/generators/templates/application/public/css/blackberry.css +6 -0
- data/res/generators/templates/application/public/css/iphone.css +6 -0
- data/res/generators/templates/application/public/css/jqmobile-patch.css +14 -0
- data/res/generators/templates/application/public/jqmobile/images/ajax-loader.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
- data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0rc1.css → jquery.mobile-1.0.css} +452 -354
- data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0rc1.js → jquery.mobile-1.0.js} +629 -442
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.css +2 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.js +172 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.css +714 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.min.css +2 -0
- data/res/generators/templates/application/public/js/jqmobile-patch.js +136 -7
- data/res/generators/templates/extension/app/MontanaTest/controller.rb +20 -20
- data/res/generators/templates/extension/app/MontanaTest/index.erb +17 -17
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/iphone/Montana.xcodeproj/project.pbxproj +8 -2
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/iphone/Rakefile +5 -0
- data/res/generators/templates/extension/extensions/montana/ext/montana/shared/ruby/montana_wrap.c +64 -20
- data/rhomobile-debug.gemspec +1 -1
- data/spec/framework_spec/app/layout.erb +1 -1
- data/spec/framework_spec/app/spec/core/rational/Rational_spec.rb +1 -1
- data/spec/framework_spec/app/spec/library/stringio/shared/each_char.rb +6 -2
- data/spec/framework_spec/app/spec/shared/rational/{Rational.rb → rational_main.rb} +0 -0
- data/spec/framework_spec/build.yml +0 -3
- data/spec/perfomance_spec/app/Benchmark/controller.rb +1 -1
- data/spec/perfomance_spec/app/layout.erb +1 -1
- data/spec/phone_spec/app/BlobTest_s/blob_test_s.rb +13 -0
- data/spec/phone_spec/app/BlobTest_s/test.png +0 -0
- data/spec/phone_spec/app/BlobTest_s/test2.png +0 -0
- data/spec/phone_spec/app/spec/blobsync_spec.rb +27 -15
- data/spec/phone_spec/app/spec/date_spec.rb +27 -1
- data/spec/phone_spec/app/spec/rho_spec.rb +6 -0
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +64 -26
- data/spec/phone_spec/app/spec/syncengine_spec.rb +28 -7
- data/spec/phone_spec/app/spec/uri_spec.rb +4 -4
- data/spec/phone_spec/app/spec_runner.rb +4 -2
- data/spec/phone_spec/build.yml +7 -9
- data/spec/phone_spec/rhoconfig.txt +1 -0
- data/version +1 -1
- metadata +75 -22
- data/Manifest.txt +0 -7853
- data/platform/wm/rhodes/rhoelements/RhoWKBrowserEngine.cpp +0 -384
- data/platform/wm/rhodes/rhoelements/RhoWKBrowserEngine.h +0 -41
- data/platform/wm/rhodes/signature/Signature.cpp +0 -396
- data/platform/wm/rhodes/signature/Signature.h +0 -84
- data/platform/wm/rubylib/rubylib.vcproj.VLAD.Vladimir.user +0 -429
- data/platform/wm/sqlite3/sqlite3.vcproj.VLAD.Vladimir.user +0 -429
- data/platform/wm/syncengine/syncengine.vcproj.VLAD.Vladimir.user +0 -429
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.css +0 -12
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.js +0 -170
- data/rhomobile-debug-1.0.5.gem +0 -0
data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality07.java
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2011 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
package com.rhomobile.rhodes.osfunctionality;
|
28
|
+
|
29
|
+
|
30
|
+
//Android 2.1
|
31
|
+
class AndroidFunctionality07 extends AndroidFunctionality06 implements AndroidFunctionality {
|
32
|
+
|
33
|
+
|
34
|
+
}
|
data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality08.java
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2011 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
package com.rhomobile.rhodes.osfunctionality;
|
28
|
+
|
29
|
+
import com.rhomobile.rhodes.RhodesService;
|
30
|
+
|
31
|
+
import android.content.Context;
|
32
|
+
import android.view.Display;
|
33
|
+
import android.view.WindowManager;
|
34
|
+
|
35
|
+
|
36
|
+
//Android 2.2
|
37
|
+
class AndroidFunctionality08 extends AndroidFunctionality07 implements AndroidFunctionality {
|
38
|
+
|
39
|
+
public int getDeviceRotation() {
|
40
|
+
Display display = ((WindowManager) RhodesService.getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
|
41
|
+
int rotation = display.getRotation();
|
42
|
+
return rotation;
|
43
|
+
}
|
44
|
+
}
|
data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality09.java
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2011 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
package com.rhomobile.rhodes.osfunctionality;
|
28
|
+
|
29
|
+
|
30
|
+
//Android 2.3.1
|
31
|
+
class AndroidFunctionality09 extends AndroidFunctionality08 implements AndroidFunctionality {
|
32
|
+
|
33
|
+
|
34
|
+
}
|
data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality10.java
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2011 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
package com.rhomobile.rhodes.osfunctionality;
|
28
|
+
|
29
|
+
|
30
|
+
//Android 2.3.3
|
31
|
+
class AndroidFunctionality10 extends AndroidFunctionality09 implements AndroidFunctionality {
|
32
|
+
|
33
|
+
|
34
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
/*------------------------------------------------------------------------
|
2
|
+
* (The MIT License)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2011 Rhomobile, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
* http://rhomobile.com
|
25
|
+
*------------------------------------------------------------------------*/
|
26
|
+
|
27
|
+
package com.rhomobile.rhodes.osfunctionality;
|
28
|
+
|
29
|
+
import android.os.Build;
|
30
|
+
|
31
|
+
|
32
|
+
public class AndroidFunctionalityManager {
|
33
|
+
|
34
|
+
private static AndroidFunctionality ourFunctionality = null;
|
35
|
+
|
36
|
+
public static AndroidFunctionality getAndroidFunctionality() {
|
37
|
+
if (ourFunctionality == null) {
|
38
|
+
int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
|
39
|
+
if (sdkVersion >= 10) {
|
40
|
+
ourFunctionality = new AndroidFunctionality10();
|
41
|
+
}
|
42
|
+
else if (sdkVersion >= 9) {
|
43
|
+
ourFunctionality = new AndroidFunctionality09();
|
44
|
+
}
|
45
|
+
else if (sdkVersion >= 8) {
|
46
|
+
ourFunctionality = new AndroidFunctionality08();
|
47
|
+
}
|
48
|
+
else if (sdkVersion >= 7) {
|
49
|
+
ourFunctionality = new AndroidFunctionality07();
|
50
|
+
}
|
51
|
+
else if (sdkVersion >= 6) {
|
52
|
+
ourFunctionality = new AndroidFunctionality06();
|
53
|
+
}
|
54
|
+
else if (sdkVersion >= 5) {
|
55
|
+
ourFunctionality = new AndroidFunctionality05();
|
56
|
+
}
|
57
|
+
else if (sdkVersion >= 4) {
|
58
|
+
ourFunctionality = new AndroidFunctionality04();
|
59
|
+
}
|
60
|
+
else if (sdkVersion >= 3) {
|
61
|
+
ourFunctionality = new AndroidFunctionality03();
|
62
|
+
}
|
63
|
+
else if (sdkVersion >= 2) {
|
64
|
+
ourFunctionality = new AndroidFunctionality02();
|
65
|
+
}
|
66
|
+
else {
|
67
|
+
ourFunctionality = new AndroidFunctionality01();
|
68
|
+
}
|
69
|
+
}
|
70
|
+
return ourFunctionality;
|
71
|
+
}
|
72
|
+
|
73
|
+
}
|
@@ -29,6 +29,7 @@ package com.rhomobile.rhodes.phonebook;
|
|
29
29
|
|
30
30
|
import java.util.HashMap;
|
31
31
|
import java.util.Map;
|
32
|
+
import java.util.Set;
|
32
33
|
|
33
34
|
import com.rhomobile.rhodes.Logger;
|
34
35
|
|
@@ -43,12 +44,62 @@ public class Contact {
|
|
43
44
|
|
44
45
|
public Contact() { }
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
public Contact(ContactAccessor accessor, String id, String displayName) {
|
48
|
+
this.id = id;
|
49
|
+
mFields.put(Phonebook.PB_ID, id);
|
50
|
+
mFields.put(Phonebook.PB_DISPLAY_NAME, displayName);
|
51
|
+
}
|
52
|
+
|
53
|
+
void reset(String id, String displayName) {
|
54
|
+
mFields.clear();
|
55
|
+
this.id = id;
|
56
|
+
mFields.put(Phonebook.PB_ID, id);
|
57
|
+
mFields.put(Phonebook.PB_DISPLAY_NAME, displayName);
|
58
|
+
}
|
59
|
+
|
60
|
+
boolean checkConditions(Map<String, Object> conditions)
|
61
|
+
{
|
62
|
+
if (conditions == null)
|
63
|
+
return true;
|
64
|
+
|
65
|
+
Set<String> cond_keys = conditions.keySet();
|
66
|
+
for (String key: cond_keys) {
|
67
|
+
Object condObj = conditions.get(key);
|
68
|
+
String cond = null;
|
69
|
+
boolean isNullFields = true;
|
70
|
+
|
71
|
+
if (condObj instanceof String) {
|
72
|
+
cond = (String)condObj;
|
73
|
+
}
|
74
|
+
//TODO: if (condObj instanceof Map<String, String>)
|
75
|
+
|
76
|
+
Logger.I(TAG, "Check " + key + " " + cond + ", contact: " + id());
|
77
|
+
|
78
|
+
|
79
|
+
if (key.equalsIgnoreCase("phone")) {
|
80
|
+
isNullFields = getField(Phonebook.PB_BUSINESS_NUMBER) == null
|
81
|
+
&& getField(Phonebook.PB_HOME_NUMBER) == null
|
82
|
+
&& getField(Phonebook.PB_MOBILE_NUMBER) == null;
|
83
|
+
}
|
84
|
+
else if (key.equalsIgnoreCase("email")) {
|
85
|
+
isNullFields = getField(Phonebook.PB_EMAIL_ADDRESS) == null;
|
86
|
+
}
|
87
|
+
|
88
|
+
if (cond.equalsIgnoreCase("not_nil")) {
|
89
|
+
if (isNullFields)
|
90
|
+
return false;
|
91
|
+
}
|
92
|
+
else if (cond.equalsIgnoreCase("is_nil")) {
|
93
|
+
if (!isNullFields)
|
94
|
+
return false;
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
Logger.I(TAG, "Condition is passed");
|
100
|
+
return true;
|
101
|
+
}
|
102
|
+
|
52
103
|
public void setField(String key, String value)
|
53
104
|
{
|
54
105
|
mFields.put(key,value);
|
@@ -31,8 +31,8 @@ import java.util.Map;
|
|
31
31
|
|
32
32
|
public interface ContactAccessor {
|
33
33
|
|
34
|
-
public int getCount(int offset, int limit) throws Exception;;
|
35
|
-
public Map<String, Contact> getContacts(int offset, int max_results, List<String> select) throws Exception;
|
34
|
+
public int getCount(int offset, int limit, Map<String, Object> conditions) throws Exception;;
|
35
|
+
public Map<String, Contact> getContacts(int offset, int max_results, List<String> select, Map<String, Object> conditions) throws Exception;
|
36
36
|
public Contact getContact(String id) throws Exception;
|
37
37
|
public void save(Contact contact) throws Exception;
|
38
38
|
public void remove(Contact contact);
|
@@ -27,8 +27,10 @@
|
|
27
27
|
package com.rhomobile.rhodes.phonebook;
|
28
28
|
|
29
29
|
import java.util.HashMap;
|
30
|
+
import java.util.LinkedList;
|
30
31
|
import java.util.List;
|
31
32
|
import java.util.Map;
|
33
|
+
import java.util.Set;
|
32
34
|
|
33
35
|
import com.rhomobile.rhodes.Logger;
|
34
36
|
import com.rhomobile.rhodes.RhodesService;
|
@@ -196,85 +198,329 @@ public class ContactAccessorNew implements ContactAccessor {
|
|
196
198
|
cursor.close();
|
197
199
|
}
|
198
200
|
}
|
199
|
-
|
200
|
-
@Override
|
201
|
-
public int getCount(int offset, int max_results) {
|
202
|
-
StringBuilder sortMode = new StringBuilder();
|
203
|
-
if (max_results > 0 || offset > 0) {
|
204
|
-
sortMode.append(Contacts._ID).append(" ASC");
|
205
|
-
if (max_results > 0)
|
206
|
-
sortMode.append(" LIMIT ").append(max_results);
|
207
|
-
if (offset > 0)
|
208
|
-
sortMode.append(" OFFSET ").append(offset);
|
209
|
-
}
|
210
201
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
return count;
|
221
|
-
}
|
202
|
+
@Override
|
203
|
+
public int getCount(int offset, int max_results, Map<String, Object> conditions) {
|
204
|
+
int count = 0;
|
205
|
+
List<String> select = null;
|
206
|
+
|
207
|
+
if (conditions != null && conditions.isEmpty())
|
208
|
+
conditions = null;
|
209
|
+
else
|
210
|
+
select = new LinkedList<String>();
|
222
211
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
212
|
+
boolean manualOffset = false;
|
213
|
+
|
214
|
+
StringBuilder contactSortMode = new StringBuilder(Contacts.DISPLAY_NAME).append(',').append(Contacts._ID).append(" ASC");
|
215
|
+
if (conditions == null) {
|
216
|
+
if (max_results > 0)
|
217
|
+
contactSortMode.append(" LIMIT ").append(max_results);
|
218
|
+
if (offset > 0)
|
219
|
+
contactSortMode.append(" OFFSET ").append(offset);
|
220
|
+
} else {
|
221
|
+
manualOffset = offset > 0;
|
222
|
+
}
|
223
|
+
|
224
|
+
StringBuilder selection = new StringBuilder();
|
225
|
+
List<String> selectionArgs = new LinkedList<String>();
|
226
|
+
String[] selectionArray = null;
|
227
|
+
Cursor dataCursor = null;
|
228
|
+
|
229
|
+
if (conditions != null) {
|
230
|
+
Set<String> cond_keys = conditions.keySet();
|
231
|
+
for (String key: cond_keys) {
|
232
|
+
if (key.equalsIgnoreCase("phone")) {
|
233
|
+
if (!select.contains(Phonebook.PB_BUSINESS_NUMBER))
|
234
|
+
select.add(Phonebook.PB_BUSINESS_NUMBER);
|
235
|
+
if (!select.contains(Phonebook.PB_HOME_NUMBER))
|
236
|
+
select.add(Phonebook.PB_HOME_NUMBER);
|
237
|
+
if (!select.contains(Phonebook.PB_MOBILE_NUMBER))
|
238
|
+
select.add(Phonebook.PB_MOBILE_NUMBER);
|
239
|
+
}
|
240
|
+
else if (key.equalsIgnoreCase("email")) {
|
241
|
+
if (!select.contains(Phonebook.PB_EMAIL_ADDRESS))
|
242
|
+
select.add(Phonebook.PB_EMAIL_ADDRESS);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
for(String field : select) {
|
246
|
+
if (selection.length() != 0) {
|
247
|
+
selection.append(" OR ");
|
248
|
+
}
|
249
|
+
|
250
|
+
if (field.equals(Phonebook.PB_MOBILE_NUMBER) ||
|
251
|
+
field.equals(Phonebook.PB_HOME_NUMBER) ||
|
252
|
+
field.equals(Phonebook.PB_BUSINESS_NUMBER)) {
|
253
|
+
selection.append(Data.MIMETYPE).append("=?");
|
254
|
+
selectionArgs.add(Phone.CONTENT_ITEM_TYPE);
|
255
|
+
}
|
256
|
+
else if (field.equals(Phonebook.PB_EMAIL_ADDRESS)) {
|
257
|
+
selection.append(Data.MIMETYPE).append("=?");
|
258
|
+
selectionArgs.add(Email.CONTENT_ITEM_TYPE);
|
259
|
+
}
|
260
|
+
}
|
261
|
+
|
262
|
+
selectionArray = new String[selectionArgs.size()];
|
263
|
+
selectionArgs.toArray(selectionArray);
|
264
|
+
|
265
|
+
dataCursor = cr.query(Data.CONTENT_URI,
|
266
|
+
new String[] {Data.CONTACT_ID, Data.LOOKUP_KEY, Data.DISPLAY_NAME, Data.MIMETYPE, Data.DATA1, Data.DATA2, Data.DATA3},
|
267
|
+
selection.toString(),
|
268
|
+
selectionArray,
|
269
|
+
new StringBuilder(Data.DISPLAY_NAME).append(',').append(Data.CONTACT_ID).append(" ASC").toString());
|
270
|
+
|
271
|
+
}
|
272
|
+
|
273
|
+
Cursor contactCursor = cr.query(Contacts.CONTENT_URI,
|
274
|
+
new String[] {Contacts._ID, Contacts.LOOKUP_KEY, Contacts.DISPLAY_NAME},
|
275
|
+
null, null, contactSortMode.toString());
|
276
|
+
|
277
|
+
try {
|
278
|
+
long pos = 0;
|
279
|
+
Contact contact = null;
|
280
|
+
|
281
|
+
Logger.I(TAG, "Contact records: " + contactCursor.getCount());
|
282
|
+
|
283
|
+
if (dataCursor == null)
|
284
|
+
return contactCursor.getCount();
|
285
|
+
|
286
|
+
Logger.I(TAG, "Contacts' data records: " + dataCursor.getCount());
|
287
|
+
|
288
|
+
boolean hasData = dataCursor != null && dataCursor.moveToFirst();
|
289
|
+
|
290
|
+
if (contactCursor.moveToFirst()) do {
|
291
|
+
long curId = contactCursor.getLong(contactCursor.getColumnIndex(Contacts._ID));
|
292
|
+
Logger.I(TAG, "Processing contact id: " + curId + ", position: " + pos);
|
293
|
+
|
294
|
+
String key = contactCursor.getString(contactCursor.getColumnIndex(Contacts.LOOKUP_KEY));
|
295
|
+
String displayName = contactCursor.getString(contactCursor.getColumnIndex(Contacts.DISPLAY_NAME));
|
296
|
+
|
297
|
+
if (contact == null)
|
298
|
+
contact = new Contact(this, key, displayName);
|
299
|
+
else
|
300
|
+
contact.reset(key, displayName);
|
301
|
+
|
302
|
+
if (hasData)
|
303
|
+
hasData = fillData(contact, curId, dataCursor, select);
|
304
|
+
|
305
|
+
if (contact.checkConditions(conditions)) {
|
306
|
+
if (!manualOffset || pos >= offset) {
|
307
|
+
count++;
|
308
|
+
if (max_results > 0 && count >= max_results)
|
309
|
+
break;
|
310
|
+
}
|
311
|
+
pos++;
|
312
|
+
}
|
313
|
+
} while (contactCursor.moveToNext());
|
314
|
+
|
315
|
+
}
|
316
|
+
finally {
|
317
|
+
contactCursor.close();
|
318
|
+
if (dataCursor != null)
|
319
|
+
dataCursor.close();
|
320
|
+
}
|
321
|
+
|
322
|
+
return count;
|
276
323
|
}
|
277
|
-
|
324
|
+
|
325
|
+
|
326
|
+
private boolean fillData(Contact contact, long contactId, Cursor dataCursor, List<String> select)
|
327
|
+
{
|
328
|
+
do {
|
329
|
+
long curId = dataCursor.getLong(dataCursor.getColumnIndex(Data.CONTACT_ID));
|
330
|
+
if (curId != contactId) return true;
|
331
|
+
|
332
|
+
String mime = dataCursor.getString(dataCursor.getColumnIndex(Data.MIMETYPE));
|
333
|
+
if ((select == null || select.contains(Phonebook.PB_FIRST_NAME) || select.contains(Phonebook.PB_LAST_NAME))
|
334
|
+
&& mime.equals(StructuredName.CONTENT_ITEM_TYPE)) {
|
335
|
+
|
336
|
+
String firstName = dataCursor.getString(dataCursor.getColumnIndex(StructuredName.GIVEN_NAME));
|
337
|
+
String lastName = dataCursor.getString(dataCursor.getColumnIndex(StructuredName.FAMILY_NAME));
|
338
|
+
|
339
|
+
if (firstName != null)
|
340
|
+
contact.setField(Phonebook.PB_FIRST_NAME, firstName);
|
341
|
+
if (lastName != null)
|
342
|
+
contact.setField(Phonebook.PB_LAST_NAME, lastName);
|
343
|
+
}
|
344
|
+
|
345
|
+
if (mime.equals(Phone.CONTENT_ITEM_TYPE)) {
|
346
|
+
int type = dataCursor.getInt(dataCursor.getColumnIndex(Phone.TYPE));
|
347
|
+
switch (type) {
|
348
|
+
case Phone.TYPE_HOME:
|
349
|
+
if (select == null || select.contains(Phonebook.PB_HOME_NUMBER))
|
350
|
+
contact.setField(Phonebook.PB_HOME_NUMBER, dataCursor.getString(dataCursor.getColumnIndex(Phone.NUMBER)));
|
351
|
+
break;
|
352
|
+
case Phone.TYPE_WORK:
|
353
|
+
if (select == null || select.contains(Phonebook.PB_BUSINESS_NUMBER))
|
354
|
+
contact.setField(Phonebook.PB_BUSINESS_NUMBER, dataCursor.getString(dataCursor.getColumnIndex(Phone.NUMBER)));
|
355
|
+
break;
|
356
|
+
case Phone.TYPE_MOBILE:
|
357
|
+
if (select == null || select.contains(Phonebook.PB_MOBILE_NUMBER))
|
358
|
+
contact.setField(Phonebook.PB_MOBILE_NUMBER, dataCursor.getString(dataCursor.getColumnIndex(Phone.NUMBER)));
|
359
|
+
break;
|
360
|
+
}
|
361
|
+
}
|
362
|
+
|
363
|
+
if (mime.equals(Email.CONTENT_ITEM_TYPE) && (select == null || select.contains(Phonebook.PB_EMAIL_ADDRESS))) {
|
364
|
+
if (contact.getField(Phonebook.PB_EMAIL_ADDRESS) == null) {
|
365
|
+
contact.setField(Phonebook.PB_EMAIL_ADDRESS, dataCursor.getString(dataCursor.getColumnIndex(Email.DATA)));
|
366
|
+
}
|
367
|
+
}
|
368
|
+
|
369
|
+
if (mime.equals(Organization.COMPANY) && (select == null || select.contains(Phonebook.PB_COMPANY_NAME))) {
|
370
|
+
String company = dataCursor.getString(dataCursor.getColumnIndex(Organization.COMPANY));
|
371
|
+
if (company != null)
|
372
|
+
contact.setField(Phonebook.PB_COMPANY_NAME, company);
|
373
|
+
}
|
374
|
+
} while(dataCursor.moveToNext());
|
375
|
+
|
376
|
+
return false;
|
377
|
+
}
|
378
|
+
|
379
|
+
|
380
|
+
@Override
|
381
|
+
public Map<String, Contact> getContacts(int offset, int max_results, List<String> initialSelect, Map<String, Object> conditions) throws Exception {
|
382
|
+
|
383
|
+
List<String> select;
|
384
|
+
if (initialSelect == null || initialSelect.isEmpty())
|
385
|
+
select = null;
|
386
|
+
else
|
387
|
+
select = new LinkedList<String>(initialSelect);
|
388
|
+
|
389
|
+
if (conditions != null && conditions.isEmpty())
|
390
|
+
conditions = null;
|
391
|
+
else if (select == null)
|
392
|
+
select = new LinkedList<String>();
|
393
|
+
|
394
|
+
boolean manualOffset = false;
|
395
|
+
StringBuilder contactSortMode = new StringBuilder(Contacts.DISPLAY_NAME).append(',').append(Contacts._ID).append(" ASC");
|
396
|
+
Map<String, Contact> contacts = new HashMap<String, Contact>();
|
397
|
+
|
398
|
+
if (conditions == null) {
|
399
|
+
if (max_results > 0)
|
400
|
+
contactSortMode.append(" LIMIT ").append(max_results);
|
401
|
+
if (offset > 0)
|
402
|
+
contactSortMode.append(" OFFSET ").append(offset);
|
403
|
+
} else {
|
404
|
+
manualOffset = offset > 0;
|
405
|
+
}
|
406
|
+
|
407
|
+
StringBuilder selection = new StringBuilder();
|
408
|
+
List<String> selectionArgs = new LinkedList<String>();
|
409
|
+
|
410
|
+
if (select == null) {
|
411
|
+
selection.append(Data.MIMETYPE).append("=? OR ")
|
412
|
+
.append(Data.MIMETYPE).append("=? OR ")
|
413
|
+
.append(Data.MIMETYPE).append("=? OR ")
|
414
|
+
.append(Data.MIMETYPE).append("=?");
|
415
|
+
|
416
|
+
selectionArgs.add(StructuredName.CONTENT_ITEM_TYPE);
|
417
|
+
selectionArgs.add(Phone.CONTENT_ITEM_TYPE);
|
418
|
+
selectionArgs.add(Email.CONTENT_ITEM_TYPE);
|
419
|
+
selectionArgs.add(Organization.CONTENT_ITEM_TYPE);
|
420
|
+
} else {
|
421
|
+
if (conditions != null) {
|
422
|
+
Set<String> cond_keys = conditions.keySet();
|
423
|
+
for (String key: cond_keys) {
|
424
|
+
if (key.equalsIgnoreCase("phone")) {
|
425
|
+
if (!select.contains(Phonebook.PB_BUSINESS_NUMBER))
|
426
|
+
select.add(Phonebook.PB_BUSINESS_NUMBER);
|
427
|
+
if (!select.contains(Phonebook.PB_HOME_NUMBER))
|
428
|
+
select.add(Phonebook.PB_HOME_NUMBER);
|
429
|
+
if (!select.contains(Phonebook.PB_MOBILE_NUMBER))
|
430
|
+
select.add(Phonebook.PB_MOBILE_NUMBER);
|
431
|
+
}
|
432
|
+
else if (key.equalsIgnoreCase("email")) {
|
433
|
+
if (!select.contains(Phonebook.PB_EMAIL_ADDRESS))
|
434
|
+
select.add(Phonebook.PB_EMAIL_ADDRESS);
|
435
|
+
}
|
436
|
+
}
|
437
|
+
}
|
438
|
+
for(String field : select) {
|
439
|
+
if (selection.length() != 0) {
|
440
|
+
selection.append(" OR ");
|
441
|
+
}
|
442
|
+
|
443
|
+
if (field.equals(Phonebook.PB_FIRST_NAME) || field.equals(Phonebook.PB_LAST_NAME)) {
|
444
|
+
selection.append(Data.MIMETYPE).append("=?");
|
445
|
+
selectionArgs.add(StructuredName.CONTENT_ITEM_TYPE);
|
446
|
+
}
|
447
|
+
else if (field.equals(Phonebook.PB_MOBILE_NUMBER) ||
|
448
|
+
field.equals(Phonebook.PB_HOME_NUMBER) ||
|
449
|
+
field.equals(Phonebook.PB_BUSINESS_NUMBER)) {
|
450
|
+
selection.append(Data.MIMETYPE).append("=?");
|
451
|
+
selectionArgs.add(Phone.CONTENT_ITEM_TYPE);
|
452
|
+
}
|
453
|
+
else if (field.equals(Phonebook.PB_EMAIL_ADDRESS)) {
|
454
|
+
selection.append(Data.MIMETYPE).append("=?");
|
455
|
+
selectionArgs.add(Email.CONTENT_ITEM_TYPE);
|
456
|
+
}
|
457
|
+
else if (field.equals(Phonebook.PB_COMPANY_NAME)) {
|
458
|
+
selection.append(Data.MIMETYPE).append("=?");
|
459
|
+
selectionArgs.add(Organization.CONTENT_ITEM_TYPE);
|
460
|
+
}
|
461
|
+
}
|
462
|
+
}
|
463
|
+
|
464
|
+
Cursor contactCursor = cr.query(Contacts.CONTENT_URI,
|
465
|
+
new String[] {Contacts._ID, Contacts.LOOKUP_KEY, Contacts.DISPLAY_NAME},
|
466
|
+
null, null, contactSortMode.toString());
|
467
|
+
|
468
|
+
Cursor dataCursor = null;
|
469
|
+
|
470
|
+
if (selection.length() != 0) {
|
471
|
+
String[] selectionArray = new String[selectionArgs.size()];
|
472
|
+
selectionArgs.toArray(selectionArray);
|
473
|
+
|
474
|
+
dataCursor = cr.query(Data.CONTENT_URI,
|
475
|
+
new String[] {Data.CONTACT_ID, Data.LOOKUP_KEY, Data.DISPLAY_NAME, Data.MIMETYPE, Data.DATA1, Data.DATA2, Data.DATA3},
|
476
|
+
selection.toString(),
|
477
|
+
selectionArray,
|
478
|
+
new StringBuilder(Data.DISPLAY_NAME).append(',').append(Data.CONTACT_ID).append(" ASC").toString());
|
479
|
+
}
|
480
|
+
|
481
|
+
try {
|
482
|
+
long pos = 0;
|
483
|
+
Contact contact = null;
|
484
|
+
|
485
|
+
Logger.I(TAG, "Contact records: " + contactCursor.getCount());
|
486
|
+
Logger.I(TAG, "Contacts' data records: " + ((dataCursor != null) ? dataCursor.getCount() : 0));
|
487
|
+
|
488
|
+
boolean hasData = dataCursor != null && dataCursor.moveToFirst();
|
489
|
+
if (contactCursor.moveToFirst()) do {
|
490
|
+
long curId = contactCursor.getLong(contactCursor.getColumnIndex(Contacts._ID));
|
491
|
+
Logger.I(TAG, "Processing contact id: " + curId + ", position: " + pos);
|
492
|
+
|
493
|
+
String key = contactCursor.getString(contactCursor.getColumnIndex(Contacts.LOOKUP_KEY));
|
494
|
+
String displayName = contactCursor.getString(contactCursor.getColumnIndex(Contacts.DISPLAY_NAME));
|
495
|
+
|
496
|
+
if (contact == null)
|
497
|
+
contact = new Contact(this, key, displayName);
|
498
|
+
else
|
499
|
+
contact.reset(key, displayName);
|
500
|
+
|
501
|
+
if (hasData)
|
502
|
+
hasData = fillData(contact, curId, dataCursor, select);
|
503
|
+
|
504
|
+
if (contact.checkConditions(conditions)) {
|
505
|
+
if (!manualOffset || pos >= offset) {
|
506
|
+
contacts.put(contact.id(), contact);
|
507
|
+
if (max_results > 0 && contacts.size() >= max_results)
|
508
|
+
break;
|
509
|
+
contact = null;
|
510
|
+
}
|
511
|
+
pos++;
|
512
|
+
}
|
513
|
+
} while (contactCursor.moveToNext());
|
514
|
+
|
515
|
+
}
|
516
|
+
finally {
|
517
|
+
contactCursor.close();
|
518
|
+
if (dataCursor != null)
|
519
|
+
dataCursor.close();
|
520
|
+
}
|
521
|
+
return contacts;
|
522
|
+
}
|
523
|
+
|
278
524
|
public Contact getContact(String lookupKey) throws Exception {
|
279
525
|
if (DEBUG)
|
280
526
|
Logger.D(TAG, "getContact(lookupKey="+lookupKey+")");
|