rhodes 2.2.4.beta.1 → 2.2.5.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 +119 -3
- data/lib/build/jake.rb +15 -1
- data/lib/framework/dateME.rb +6 -1
- data/lib/framework/rho/render.rb +18 -15
- data/lib/framework/rho/rho.rb +105 -43
- data/lib/framework/rho/rhoapplication.rb +1 -1
- data/lib/framework/rho/rhocontact.rb +41 -13
- data/lib/framework/rho/rhocontroller.rb +10 -1
- data/lib/framework/rho/rhoevent_c.rb +6 -1
- data/lib/framework/rho/rhosupport.rb +1 -1
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rholang/rhomsg_de.rb +1 -1
- data/lib/framework/rholang/rhomsg_es.rb +1 -1
- data/lib/framework/rholang/rhomsg_it.rb +28 -0
- data/lib/framework/rhom/rhom.rb +6 -0
- data/lib/framework/rhom/rhom_model.rb +14 -7
- data/lib/framework/rhom/rhom_object_factory.rb +121 -56
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.full.xml +62 -0
- data/platform/android/Rhodes/AndroidManifest.xml +3 -34
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +17 -2
- data/platform/android/Rhodes/jni/src/alert.cpp +16 -0
- data/platform/android/Rhodes/jni/src/callbacks.cpp +27 -3
- data/platform/android/Rhodes/jni/src/nativebar.cpp +3 -0
- data/platform/android/Rhodes/jni/src/nativeview.cpp +131 -1
- data/platform/android/Rhodes/jni/src/phonebook.cpp +102 -41
- data/platform/android/Rhodes/jni/src/rhodes.cpp +113 -32
- data/platform/android/Rhodes/jni/src/ringtones.cpp +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +9 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +184 -49
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +49 -25
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +104 -57
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +36 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +24 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +7 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +185 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +54 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +107 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +72 -24
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +22 -21
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +91 -11
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +10 -0
- data/platform/android/build/android.rake +50 -9
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Parser.java +3 -2
- data/platform/bb/Hsqldb/src/org/hsqldb/SchemaManager.java +3 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Session.java +7 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Tokenizer.java +2 -2
- data/platform/bb/RubyVM/RubyVM.jdp +1 -0
- data/platform/bb/RubyVM/src/com/rho/AppBuildConfig.java +22 -0
- data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +5 -0
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +51 -4
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +21 -10
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +82 -33
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +59 -6
- data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyFloat_Methods.java +5 -0
- data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyString_Methods.java +19 -7
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/ArrayPacker.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyFloat.java +5 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyString.java +55 -11
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyTime.java +18 -2
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule.java +8 -5
- data/platform/bb/RubyVM/src/j2me/lang/CharacterMe.java +1 -1
- data/platform/bb/RubyVM/src/j2me/util/StringParser.java +2 -0
- data/platform/bb/build/RubyVM_build.files +1 -0
- data/platform/bb/build/bb.rake +21 -2
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +3 -3
- data/platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java +1 -1
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +1 -2
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +15 -16
- data/platform/bb/rhodes/src/com/rho/rubyext/RhoCalendar.java +4 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +58 -0
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +90 -4
- data/platform/iphone/Classes/AppManager/AppManager.m +43 -5
- data/platform/iphone/Classes/Event/Event.h +2 -0
- data/platform/iphone/Classes/Event/Event.m +12 -1
- data/platform/iphone/Classes/GeoLocation/LocationController.m +9 -3
- data/platform/iphone/Classes/MapView/MapViewController.m +20 -9
- data/platform/iphone/Classes/NativeBar.m +27 -0
- data/platform/iphone/Classes/Phonebook/phonebook.m +17 -0
- data/platform/iphone/Classes/RhoAlert.m +61 -1
- data/platform/iphone/Classes/RhoMainView.h +1 -0
- data/platform/iphone/Classes/Rhodes.h +2 -0
- data/platform/iphone/Classes/Rhodes.m +108 -1
- data/platform/iphone/Classes/SimpleMainView.h +4 -0
- data/platform/iphone/Classes/SimpleMainView.m +30 -3
- data/platform/iphone/Classes/SplashViewController.m +3 -1
- data/platform/iphone/Classes/TabbedMainView.h +2 -0
- data/platform/iphone/Classes/TabbedMainView.m +63 -11
- data/platform/iphone/Classes/rho/net/NetRequestImpl.m +26 -0
- data/platform/iphone/Info.plist +12 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +8 -0
- data/platform/iphone/rbuild/iphone.rake +181 -25
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +5 -5
- data/platform/shared/common/IRhoThreadImpl.h +1 -1
- data/platform/shared/common/PosixThreadImpl.cpp +5 -3
- data/platform/shared/common/PosixThreadImpl.h +1 -1
- data/platform/shared/common/RhoFilePath.h +11 -0
- data/platform/shared/common/RhoNativeViewManager.h +17 -0
- data/platform/shared/common/RhoThread.h +1 -1
- data/platform/shared/common/RhodesApp.cpp +29 -8
- data/platform/shared/common/ThreadQueue.cpp +5 -3
- data/platform/shared/common/ThreadQueue.h +2 -1
- data/platform/shared/common/app_build_configs.c +25 -0
- data/platform/shared/common/app_build_configs.h +11 -0
- data/platform/shared/net/AsyncHttp.cpp +5 -5
- data/platform/shared/net/CURLNetRequest.cpp +25 -7
- data/platform/shared/net/CURLNetRequest.h +2 -1
- data/platform/shared/net/HttpServer.cpp +28 -0
- data/platform/shared/ruby/ext/nativebar/nativebar.i +3 -0
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +26 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +6 -0
- data/platform/shared/ruby/ext/rho/rhoruby.h +1 -0
- data/platform/shared/ruby/ext/rho/rhosupport.c +15 -2
- data/platform/shared/ruby/ext/syncengine/syncengine.i +14 -2
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +97 -2
- data/platform/shared/ruby/ext/system/system.i +13 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +104 -1
- data/platform/shared/rubyext/RhoAppAdapter.cpp +7 -0
- data/platform/shared/sync/SyncEngine.cpp +43 -3
- data/platform/shared/sync/SyncEngine.h +13 -0
- data/platform/shared/sync/SyncNotify.cpp +41 -23
- data/platform/shared/sync/SyncNotify.h +18 -4
- data/platform/shared/sync/SyncSource.cpp +52 -14
- data/platform/shared/sync/SyncSource.h +1 -0
- data/platform/shared/sync/SyncThread.cpp +29 -9
- data/platform/shared/sync/SyncThread.h +4 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +8 -0
- data/platform/wm/build/build_inf.js +15 -9
- data/platform/wm/build/wm.rake +10 -5
- data/platform/wm/rhodes/Alert.cpp +10 -0
- data/platform/wm/rhodes/Alert.h +3 -3
- data/platform/wm/rhodes/MainWindow.cpp +171 -26
- data/platform/wm/rhodes/MainWindow.h +23 -1
- data/platform/wm/rhodes/MetaHandler.cpp +192 -0
- data/platform/wm/rhodes/MetaHandler.h +31 -0
- data/platform/wm/rhodes/RhoNativeViewManager.cpp +126 -0
- data/platform/wm/rhodes/RhoNativeViewManagerWM.h +20 -0
- data/platform/wm/rhodes/Rhodes.cpp +91 -2
- data/platform/wm/rhodes/Rhodes.rc +15 -6
- data/platform/wm/rhodes/SyncStatusDlg.cpp +32 -0
- data/platform/wm/rhodes/SyncStatusDlg.h +29 -0
- data/platform/wm/rhodes/resource.h +5 -2
- data/platform/wm/rhodes/rho/common/RhoThreadImpl.cpp +3 -1
- data/platform/wm/rhodes/rho/common/RhoThreadImpl.h +1 -1
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +146 -14
- data/platform/wm/rhodes/rhodes.vcproj +28 -0
- data/rakefile.rb +119 -3
- data/res/build-tools/iphonesim/README +58 -0
- data/res/build-tools/iphonesim/Source/iPhoneSimulator.h +43 -0
- data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +224 -0
- data/res/build-tools/iphonesim/Source/main.m +52 -0
- data/res/build-tools/iphonesim/Source/nsprintf.h +3 -0
- data/res/build-tools/iphonesim/Source/nsprintf.m +42 -0
- data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
- data/res/build-tools/iphonesim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h +124 -0
- data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +261 -0
- data/res/build-tools/iphonesim/iphonesim_Prefix.pch +7 -0
- data/res/generators/rhogen.rb +5 -0
- data/res/generators/templates/application/app/layout.erb +7 -13
- data/res/generators/templates/application/app/loading.png +0 -0
- data/res/generators/templates/application/build.yml +3 -0
- data/res/generators/templates/application/icon/icon114.png +0 -0
- data/res/generators/templates/application/icon/icon57.png +0 -0
- data/res/generators/templates/application/icon/icon72.png +0 -0
- data/res/generators/templates/application/public/css/iphone.css +96 -0
- data/res/generators/templates/application/public/images/backButton.png +0 -0
- data/res/generators/templates/application/public/jqtouch/jqtouch.js +2 -1
- data/res/generators/templates/application/rhoconfig.txt +2 -0
- data/rhodes.gemspec +1 -1
- data/spec/phone_spec/app/spec/array_pack_spec.rb +108 -0
- data/spec/phone_spec/app/spec/bulksync_spec.rb +1 -0
- data/spec/phone_spec/app/spec/date_spec.rb +27 -0
- data/spec/phone_spec/app/spec/fixtures/classes.rb +91 -0
- data/spec/phone_spec/app/spec/lstrip_spec.rb +57 -0
- data/spec/phone_spec/app/spec/rho_spec.rb +50 -19
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +78 -0
- data/spec/phone_spec/app/spec/rstrip_spec.rb +51 -0
- data/spec/phone_spec/app/spec/strip_spec.rb +50 -0
- data/spec/phone_spec/app/spec/syncengine_spec.rb +46 -3
- data/spec/phone_spec/app/spec_runner.rb +6 -0
- metadata +34 -4
@@ -10,6 +10,7 @@
|
|
10
10
|
#include "Alert.h"
|
11
11
|
#include "MainWindow.h"
|
12
12
|
#include "Vibrate.h"
|
13
|
+
#include "common/RhoAppAdapter.h"
|
13
14
|
|
14
15
|
extern "C" HWND getMainWnd();
|
15
16
|
|
@@ -363,6 +364,15 @@ void CAlert::playFile(String fileName)
|
|
363
364
|
|
364
365
|
#endif //_WIN32_WCE
|
365
366
|
|
367
|
+
extern "C" void alert_show_status(const char* szMessage, const char* szHide)
|
368
|
+
{
|
369
|
+
String message = szMessage ? szMessage : "";
|
370
|
+
Vector<CAlertDialog::Params::CAlertButton> buttons;
|
371
|
+
//buttons.addElement( CAlertDialog::Params::CAlertButton(szHide, "") );
|
372
|
+
|
373
|
+
CAlert::showPopup(new CAlertDialog::Params(String(), message, String(), String(), buttons, CAlertDialog::Params::DLG_STATUS ));
|
374
|
+
}
|
375
|
+
|
366
376
|
extern "C" void alert_show_popup(rho_param *p)
|
367
377
|
{
|
368
378
|
if (p->type == RHO_PARAM_STRING) {
|
data/platform/wm/rhodes/Alert.h
CHANGED
@@ -19,7 +19,7 @@ public:
|
|
19
19
|
*/
|
20
20
|
class Params {
|
21
21
|
public:
|
22
|
-
enum {DLG_DEFAULT, DLG_CUSTOM};
|
22
|
+
enum {DLG_DEFAULT, DLG_CUSTOM, DLG_STATUS};
|
23
23
|
struct CAlertButton
|
24
24
|
{
|
25
25
|
String m_strCaption, m_strID;
|
@@ -33,9 +33,9 @@ public:
|
|
33
33
|
m_message = message;
|
34
34
|
}
|
35
35
|
|
36
|
-
Params (String &title, String &message, String &icon, String &callback, Vector<CAlertButton>& buttons)
|
36
|
+
Params (String &title, String &message, String &icon, String &callback, Vector<CAlertButton>& buttons, int dlgType = DLG_STATUS)
|
37
37
|
{
|
38
|
-
m_dlgType =
|
38
|
+
m_dlgType = dlgType;
|
39
39
|
m_title = title;
|
40
40
|
m_message = message;
|
41
41
|
m_icon = icon;
|
@@ -26,7 +26,7 @@
|
|
26
26
|
#include "common/RhoFilePath.h"
|
27
27
|
#include "common/RhoFile.h"
|
28
28
|
#include "bluetooth/Bluetooth.h"
|
29
|
-
|
29
|
+
#include "MetaHandler.h"
|
30
30
|
#include <hash_map>
|
31
31
|
|
32
32
|
IMPLEMENT_LOGCLASS(CMainWindow,"MainWindow");
|
@@ -55,6 +55,11 @@ int CMainWindow::m_screenHeight;
|
|
55
55
|
|
56
56
|
CMainWindow::CMainWindow()
|
57
57
|
{
|
58
|
+
mIsBrowserViewHided = false;
|
59
|
+
mNativeView = NULL;
|
60
|
+
mNativeViewFactory = NULL;
|
61
|
+
mNativeViewType = "";
|
62
|
+
|
58
63
|
m_bLoading = true;
|
59
64
|
#if defined(_WIN32_WCE)
|
60
65
|
memset(&m_sai, 0, sizeof(m_sai));
|
@@ -73,11 +78,21 @@ CMainWindow::~CMainWindow()
|
|
73
78
|
}
|
74
79
|
|
75
80
|
void CMainWindow::Navigate2(BSTR URL) {
|
76
|
-
|
81
|
+
String cleared_url = processForNativeView(convertToStringA(OLE2CT(URL)));
|
82
|
+
if (!cleared_url.empty()) {
|
83
|
+
StringW cw = convertToStringW(cleared_url);
|
84
|
+
BSTR cleared_url_bstr = SysAllocString(cw.c_str());
|
85
|
+
m_spIWebBrowser2->Navigate2(&CComVariant(cleared_url_bstr), NULL, &CComVariant(L"_self"), NULL, NULL);
|
86
|
+
}
|
77
87
|
}
|
78
88
|
|
79
89
|
void CMainWindow::Navigate(BSTR URL) {
|
80
|
-
|
90
|
+
String cleared_url = processForNativeView(convertToStringA(OLE2CT(URL)));
|
91
|
+
if (!cleared_url.empty()) {
|
92
|
+
StringW cw = convertToStringW(cleared_url);
|
93
|
+
BSTR cleared_url_bstr = SysAllocString(cw.c_str());
|
94
|
+
m_spIWebBrowser2->Navigate(cleared_url_bstr, NULL, &CComVariant(L"_self"), NULL, NULL);
|
95
|
+
}
|
81
96
|
}
|
82
97
|
|
83
98
|
// **************************************************************************
|
@@ -223,6 +238,23 @@ LRESULT CMainWindow::OnSetText(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam
|
|
223
238
|
return TRUE;
|
224
239
|
}
|
225
240
|
|
241
|
+
HWND CMainWindow::getWebViewHWND() {
|
242
|
+
return m_browser.m_hWnd;
|
243
|
+
}
|
244
|
+
|
245
|
+
void CMainWindow::hideWebView() {
|
246
|
+
//::ShowWindow(m_browser.m_hWnd, SW_HIDE);
|
247
|
+
m_browser.ShowWindow(SW_HIDE);
|
248
|
+
mIsBrowserViewHided = true;
|
249
|
+
//m_browser.DestroyWindow();
|
250
|
+
}
|
251
|
+
|
252
|
+
void CMainWindow::showWebView() {
|
253
|
+
//::ShowWindow(m_browser.m_hWnd, SW_SHOW);
|
254
|
+
m_browser.ShowWindow(SW_SHOW);
|
255
|
+
mIsBrowserViewHided = false;
|
256
|
+
}
|
257
|
+
|
226
258
|
LRESULT CMainWindow::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
|
227
259
|
{
|
228
260
|
#if defined (_WIN32_WCE)
|
@@ -279,7 +311,16 @@ LRESULT CMainWindow::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/
|
|
279
311
|
splash.start();
|
280
312
|
#ifdef _WIN32_WCE
|
281
313
|
StringW pathW = convertToStringW(RHODESAPP().getLoadingPngPath());
|
282
|
-
|
314
|
+
|
315
|
+
StringW path_wm_W = pathW.substr(0, pathW.length() - 3);
|
316
|
+
String wm_png = "wm.png";
|
317
|
+
path_wm_W.append(convertToStringW(wm_png));
|
318
|
+
|
319
|
+
HBITMAP hbitmap = SHLoadImageFile(path_wm_W.c_str());
|
320
|
+
if (!hbitmap) {
|
321
|
+
hbitmap = SHLoadImageFile(pathW.c_str());
|
322
|
+
}
|
323
|
+
|
283
324
|
if (!hbitmap)
|
284
325
|
return 0;
|
285
326
|
|
@@ -339,6 +380,106 @@ LRESULT CMainWindow::OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOO
|
|
339
380
|
return 0;
|
340
381
|
}
|
341
382
|
|
383
|
+
// return true if NativeView was created
|
384
|
+
String CMainWindow::processForNativeView(String _url) {
|
385
|
+
|
386
|
+
String url = _url.c_str();
|
387
|
+
String callback_prefix = "call_stay_native";
|
388
|
+
|
389
|
+
// find protocol:navto pairs
|
390
|
+
|
391
|
+
int last = -1;
|
392
|
+
int cur = url.find_first_of(':', last+1);
|
393
|
+
while (cur > 0) {
|
394
|
+
String protocol = url.substr(last+1, cur - last - 1);
|
395
|
+
String navto = url.substr(cur+1, url.size() - cur);
|
396
|
+
|
397
|
+
if (callback_prefix.compare(protocol) == 0) {
|
398
|
+
// navigate but still in native view
|
399
|
+
String cleared_url = url.substr(callback_prefix.size()+1, url.size() - callback_prefix.size());
|
400
|
+
return cleared_url;
|
401
|
+
}
|
402
|
+
// check protocol for nativeView
|
403
|
+
NativeViewFactory* nvf = RhoNativeViewManagerWM::getFactoryByViewType(protocol.c_str());
|
404
|
+
if (nvf != NULL) {
|
405
|
+
// we should switch to NativeView
|
406
|
+
if (mNativeView != NULL) {
|
407
|
+
if (protocol.compare(mNativeViewType) == 0) {
|
408
|
+
mNativeView->navigate(navto.c_str());
|
409
|
+
return "";
|
410
|
+
}
|
411
|
+
}
|
412
|
+
|
413
|
+
restoreWebView();
|
414
|
+
NativeView* nv = nvf->getNativeView(protocol.c_str());
|
415
|
+
if (nv != NULL) {
|
416
|
+
mNativeView = nv;
|
417
|
+
mNativeViewFactory = nvf;
|
418
|
+
mNativeViewType = protocol;
|
419
|
+
|
420
|
+
HWND nvh = (HWND)mNativeView->getView();
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
::SetParent(nvh, m_hWnd);
|
426
|
+
|
427
|
+
RECT rect;
|
428
|
+
::GetWindowRect(getWebViewHWND(),&rect);
|
429
|
+
|
430
|
+
int x = 0;
|
431
|
+
int y = 0;
|
432
|
+
int w = rect.right - rect.left;
|
433
|
+
int h = rect.bottom - rect.top;
|
434
|
+
|
435
|
+
::SetWindowPos(nvh, HWND_TOP, x, y, w, h, SWP_SHOWWINDOW);
|
436
|
+
|
437
|
+
nv->navigate(navto.c_str());
|
438
|
+
|
439
|
+
::ShowWindow(nvh, SW_SHOWNORMAL);
|
440
|
+
hideWebView();
|
441
|
+
|
442
|
+
return "";
|
443
|
+
}
|
444
|
+
restoreWebView();
|
445
|
+
return url;
|
446
|
+
}
|
447
|
+
last = cur;
|
448
|
+
int c1 = url.find_first_of(':', last+1);
|
449
|
+
int c2 = url.find_first_of('/', last+1);
|
450
|
+
if ((c1 < c2)) {
|
451
|
+
if (c1 <= 0) {
|
452
|
+
cur = c2;
|
453
|
+
}
|
454
|
+
else {
|
455
|
+
cur = c1;
|
456
|
+
}
|
457
|
+
}
|
458
|
+
else {
|
459
|
+
if (c2 <= 0) {
|
460
|
+
cur = c1;
|
461
|
+
}
|
462
|
+
else {
|
463
|
+
cur = c2;
|
464
|
+
}
|
465
|
+
}
|
466
|
+
}
|
467
|
+
restoreWebView();
|
468
|
+
return url;
|
469
|
+
}
|
470
|
+
|
471
|
+
|
472
|
+
void CMainWindow::restoreWebView() {
|
473
|
+
if (mNativeView != NULL) {
|
474
|
+
mNativeViewFactory->destroyNativeView(mNativeView);
|
475
|
+
mNativeView = NULL;
|
476
|
+
mNativeViewFactory = NULL;
|
477
|
+
mNativeViewType = "";
|
478
|
+
showWebView();
|
479
|
+
}
|
480
|
+
}
|
481
|
+
|
482
|
+
|
342
483
|
LRESULT CMainWindow::OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
|
343
484
|
{
|
344
485
|
#if defined(_WIN32_WCE)
|
@@ -376,6 +517,7 @@ LRESULT CMainWindow::OnExitCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hW
|
|
376
517
|
|
377
518
|
LRESULT CMainWindow::OnNavigateBackCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
378
519
|
{
|
520
|
+
restoreWebView();
|
379
521
|
m_spIWebBrowser2->GoBack();
|
380
522
|
return 0;
|
381
523
|
}
|
@@ -412,6 +554,7 @@ LRESULT CMainWindow::OnFullscreenCommand (WORD /*wNotifyCode*/, WORD /*wID*/, HW
|
|
412
554
|
|
413
555
|
LRESULT CMainWindow::OnRefreshCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
414
556
|
{
|
557
|
+
|
415
558
|
if (m_spIWebBrowser2)
|
416
559
|
m_spIWebBrowser2->Refresh();
|
417
560
|
return 0;
|
@@ -507,11 +650,21 @@ LRESULT CMainWindow::OnSelectPicture(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lP
|
|
507
650
|
|
508
651
|
LRESULT CMainWindow::OnAlertShowPopup (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
|
509
652
|
{
|
510
|
-
LOG(INFO) + __FUNCTION__;
|
653
|
+
//LOG(INFO) + __FUNCTION__;
|
511
654
|
StringW strAppName = getRhodesAppName();
|
512
655
|
CAlertDialog::Params *params = (CAlertDialog::Params *)lParam;
|
513
656
|
|
514
|
-
|
657
|
+
if (params->m_dlgType == CAlertDialog::Params::DLG_STATUS)
|
658
|
+
{
|
659
|
+
m_SyncStatusDlg.setStatusText(convertToStringW(params->m_message).c_str());
|
660
|
+
if ( !m_SyncStatusDlg.m_hWnd )
|
661
|
+
m_SyncStatusDlg.Create(m_hWnd, 0);
|
662
|
+
else
|
663
|
+
{
|
664
|
+
m_SyncStatusDlg.ShowWindow(SW_SHOW);
|
665
|
+
m_SyncStatusDlg.BringWindowToTop();
|
666
|
+
}
|
667
|
+
}else if (params->m_dlgType == CAlertDialog::Params::DLG_DEFAULT) {
|
515
668
|
MessageBox(convertToStringW(params->m_message).c_str(), strAppName.c_str(), MB_ICONWARNING | MB_OK);
|
516
669
|
} else if (params->m_dlgType == CAlertDialog::Params::DLG_CUSTOM)
|
517
670
|
{
|
@@ -569,6 +722,14 @@ LRESULT CMainWindow::OnBluetoothDiscovered (UINT /*uMsg*/, WPARAM /*wParam*/, LP
|
|
569
722
|
return 0;
|
570
723
|
}
|
571
724
|
|
725
|
+
LRESULT CMainWindow::OnExecuteCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) {
|
726
|
+
RhoNativeViewRunnable* command = (RhoNativeViewRunnable*)wParam;
|
727
|
+
if (command != NULL) {
|
728
|
+
command->run();
|
729
|
+
}
|
730
|
+
return 0;
|
731
|
+
}
|
732
|
+
|
572
733
|
LRESULT CMainWindow::OnBluetoothCallback(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) {
|
573
734
|
char* callback_url = (char*)wParam;
|
574
735
|
char* body = (char*)lParam;
|
@@ -665,7 +826,8 @@ void __stdcall CMainWindow::OnNavigateComplete2(IDispatch* pDisp, VARIANT * pvtU
|
|
665
826
|
{
|
666
827
|
USES_CONVERSION;
|
667
828
|
if (!m_bLoading)
|
668
|
-
|
829
|
+
if (!mIsBrowserViewHided)
|
830
|
+
m_browser.ShowWindow(SW_SHOW);
|
669
831
|
LOG(TRACE) + "OnNavigateComplete2: " + OLE2CT(V_BSTR(pvtURL));
|
670
832
|
}
|
671
833
|
|
@@ -772,25 +934,8 @@ void __stdcall CMainWindow::OnDocumentComplete(IDispatch* pDisp, VARIANT * pvtUR
|
|
772
934
|
if (m_pageCounter > 2) //"loading" page + first page
|
773
935
|
SetToolbarButtonEnabled(IDM_SK1_EXIT, TRUE);
|
774
936
|
#endif
|
775
|
-
|
776
|
-
|
777
|
-
//TEST
|
778
|
-
CComPtr<IDispatch> pDispDoc;
|
779
|
-
m_spIWebBrowser2->get_Document(&pDispDoc);
|
780
|
-
|
781
|
-
CComPtr<IPIEHTMLDocument3> pDoc;
|
782
|
-
pDispDoc.QueryInterface(&pDoc);
|
783
|
-
|
784
|
-
CComPtr<IPIEHTMLElementCollection> pColl;
|
785
|
-
pDoc->getElementsByTagName(CComBSTR("meta"), &pColl);
|
786
|
-
long size = 0;
|
787
|
-
pColl->get_length(&size);
|
788
|
-
|
789
|
-
if ( size > 0 )
|
790
|
-
{
|
791
|
-
}
|
792
|
-
//TEST
|
793
|
-
#endif */
|
937
|
+
|
938
|
+
//CMetaHandler oHandler(m_spIWebBrowser2);
|
794
939
|
}
|
795
940
|
|
796
941
|
void __stdcall CMainWindow::OnCommandStateChange(long lCommand, BOOL bEnable)
|
@@ -11,6 +11,8 @@
|
|
11
11
|
#include "common/RhoConf.h"
|
12
12
|
#include "common/RhodesApp.h"
|
13
13
|
#include "Alert.h"
|
14
|
+
#include "RhoNativeViewManagerWM.h"
|
15
|
+
#include "SyncStatusDlg.h"
|
14
16
|
|
15
17
|
#if defined(OS_WINDOWS)
|
16
18
|
#include "menubar.h"
|
@@ -31,6 +33,7 @@ static UINT WM_DATETIME_PICKER = ::RegisterWindowMessage(L"RHODES_WM_DAT
|
|
31
33
|
static UINT WM_BLUETOOTH_DISCOVER = ::RegisterWindowMessage(L"RHODES_WM_BLUETOOTH_DISCOVER");
|
32
34
|
static UINT WM_BLUETOOTH_DISCOVERED = ::RegisterWindowMessage(L"RHODES_WM_BLUETOOTH_DISCOVERED");
|
33
35
|
static UINT WM_BLUETOOTH_CALLBACK = ::RegisterWindowMessage(L"RHODES_WM_BLUETOOTH_CALLBACK");
|
36
|
+
static UINT WM_EXECUTE_COMMAND = ::RegisterWindowMessage(L"RHODES_WM_EXECUTE_COMMAND");
|
34
37
|
|
35
38
|
|
36
39
|
class CMainWindow :
|
@@ -49,6 +52,8 @@ public:
|
|
49
52
|
//
|
50
53
|
void Navigate2(BSTR URL);
|
51
54
|
void Navigate(BSTR URL);
|
55
|
+
|
56
|
+
HWND getWebViewHWND();
|
52
57
|
|
53
58
|
//char* GetCurrentLocation() { return m_current_url; }
|
54
59
|
|
@@ -78,7 +83,7 @@ public:
|
|
78
83
|
MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)
|
79
84
|
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
|
80
85
|
//MESSAGE_HANDLER(WM_SETTEXT, OnSetText)
|
81
|
-
MESSAGE_HANDLER(WM_PAINT, OnPaint)
|
86
|
+
//MESSAGE_HANDLER(WM_PAINT, OnPaint)
|
82
87
|
COMMAND_ID_HANDLER(IDM_EXIT, OnExitCommand)
|
83
88
|
COMMAND_ID_HANDLER(IDM_NAVIGATE_BACK, OnNavigateBackCommand)
|
84
89
|
COMMAND_ID_HANDLER(IDM_SK1_EXIT, OnBackCommand)
|
@@ -100,6 +105,7 @@ public:
|
|
100
105
|
MESSAGE_HANDLER(WM_BLUETOOTH_DISCOVER, OnBluetoothDiscover);
|
101
106
|
MESSAGE_HANDLER(WM_BLUETOOTH_DISCOVERED, OnBluetoothDiscovered);
|
102
107
|
MESSAGE_HANDLER(WM_BLUETOOTH_CALLBACK, OnBluetoothCallback);
|
108
|
+
MESSAGE_HANDLER(WM_EXECUTE_COMMAND, OnExecuteCommand);
|
103
109
|
END_MSG_MAP()
|
104
110
|
|
105
111
|
private:
|
@@ -136,6 +142,7 @@ private:
|
|
136
142
|
LRESULT OnBluetoothDiscover (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
|
137
143
|
LRESULT OnBluetoothDiscovered (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
|
138
144
|
LRESULT OnBluetoothCallback (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
|
145
|
+
LRESULT OnExecuteCommand (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
|
139
146
|
|
140
147
|
public:
|
141
148
|
BEGIN_SINK_MAP(CMainWindow)
|
@@ -166,12 +173,25 @@ private:
|
|
166
173
|
static rho::StringW getRhodesAppName();
|
167
174
|
void createCustomMenu(void);
|
168
175
|
|
176
|
+
// return cleared URL or empty string
|
177
|
+
String processForNativeView(String url);
|
178
|
+
void restoreWebView();
|
179
|
+
void hideWebView();
|
180
|
+
void showWebView();
|
181
|
+
|
182
|
+
private:
|
183
|
+
NativeViewFactory* mNativeViewFactory;
|
184
|
+
NativeView* mNativeView;
|
185
|
+
String mNativeViewType;
|
186
|
+
|
187
|
+
|
169
188
|
private:
|
170
189
|
// Represents the PIEWebBrowser control contained in the main application.
|
171
190
|
// window. m_browser is used to manage the control and its associated
|
172
191
|
// "AtlAxWin" window. (AtlAxWin is a window class that ATL uses to support
|
173
192
|
// containment of controls in windows.)
|
174
193
|
CAxWindow m_browser;
|
194
|
+
bool mIsBrowserViewHided;
|
175
195
|
|
176
196
|
// cached copy of hosted control's IWebBrowser2 interface pointer
|
177
197
|
CComPtr<IWebBrowser2> m_spIWebBrowser2;
|
@@ -206,4 +226,6 @@ private:
|
|
206
226
|
|
207
227
|
rho::Vector<rho::common::CAppMenuItem> m_arAppMenuItems;
|
208
228
|
CAlertDialog *m_alertDialog;
|
229
|
+
|
230
|
+
CSyncStatusDlg m_SyncStatusDlg;
|
209
231
|
};
|
@@ -0,0 +1,192 @@
|
|
1
|
+
#include "StdAfx.h"
|
2
|
+
#include "MetaHandler.h"
|
3
|
+
#include "MainWindow.h"
|
4
|
+
|
5
|
+
#if defined (_WIN32_WCE)
|
6
|
+
#include <webvw.h>
|
7
|
+
#if _WIN32_WCE > 0x501
|
8
|
+
#define IHTMLDocument3 IPIEHTMLDocument3
|
9
|
+
#define IHTMLElement IPIEHTMLElement2
|
10
|
+
#else
|
11
|
+
#define IHTMLDocument3 IPIEHTMLDocument2
|
12
|
+
#define IHTMLElement IPIEHTMLElement
|
13
|
+
#endif
|
14
|
+
#define IHTMLElementCollection IPIEHTMLElementCollection
|
15
|
+
|
16
|
+
#endif
|
17
|
+
|
18
|
+
extern "C" HWND getMainWnd();
|
19
|
+
|
20
|
+
IMPLEMENT_LOGCLASS(CMetaHandler,"MetaHandler");
|
21
|
+
|
22
|
+
CMetaHandler::CMetaHandler(CComPtr<IWebBrowser2> pIWebBrowser2)
|
23
|
+
{
|
24
|
+
readMetaTags(pIWebBrowser2);
|
25
|
+
checkEvents();
|
26
|
+
}
|
27
|
+
|
28
|
+
CMetaHandler::~CMetaHandler(void)
|
29
|
+
{
|
30
|
+
}
|
31
|
+
|
32
|
+
CStringW CMetaHandler::CBatteryEvent::makeJSCallback()
|
33
|
+
{
|
34
|
+
if ( m_strCallback.GetLength() == 0 )
|
35
|
+
return CStringW();
|
36
|
+
|
37
|
+
CStringW strParam1, strParam2, strParam3;
|
38
|
+
#ifdef _WIN32_WCE
|
39
|
+
SYSTEM_POWER_STATUS_EX2 pwrstat = {0};
|
40
|
+
if (!GetSystemPowerStatusEx2(&pwrstat,sizeof(pwrstat),FALSE))
|
41
|
+
{
|
42
|
+
LOG(ERROR) + "GetSystemPowerStatusEx2 failed.";
|
43
|
+
return CStringW();
|
44
|
+
}
|
45
|
+
strParam1 = pwrstat.ACLineStatus == AC_LINE_BACKUP_POWER ? L"1" : L"0";
|
46
|
+
strParam2.Format(L"%d", pwrstat.BatteryLifePercent);
|
47
|
+
strParam3.Format(L"%d", pwrstat.BackupBatteryLifePercent);
|
48
|
+
#else
|
49
|
+
SYSTEM_POWER_STATUS pwrstat = {0};
|
50
|
+
if (!GetSystemPowerStatus(&pwrstat))
|
51
|
+
{
|
52
|
+
LOG(ERROR) + "GetSystemPowerStatus failed.";
|
53
|
+
return CStringW();
|
54
|
+
}
|
55
|
+
strParam1 = L"0";
|
56
|
+
strParam2.Format(L"%d", pwrstat.BatteryLifePercent);
|
57
|
+
strParam3.Format(L"%c", '0');
|
58
|
+
|
59
|
+
#endif
|
60
|
+
|
61
|
+
CStringW strRes;
|
62
|
+
strRes.Format(m_strCallback, strParam1.GetString(), strParam2.GetString(), strParam3.GetString());
|
63
|
+
|
64
|
+
if ( strRes.Find(L"BatteryEvent:url(\'") == 0 )
|
65
|
+
{
|
66
|
+
strRes = strRes.Mid(18, (strRes.GetLength()-18-2));
|
67
|
+
}
|
68
|
+
|
69
|
+
return strRes;
|
70
|
+
}
|
71
|
+
|
72
|
+
void CMetaHandler::checkEvents()
|
73
|
+
{
|
74
|
+
CStringW strJS = m_oBatteryEvent.makeJSCallback();
|
75
|
+
if (strJS.GetLength() > 0 )
|
76
|
+
::PostMessage( getMainWnd(), WM_COMMAND, IDM_NAVIGATE, (LPARAM)_tcsdup(strJS) );
|
77
|
+
}
|
78
|
+
|
79
|
+
void CMetaHandler::handleMetaTag(BSTR bstrHttpEquiv, BSTR bstrContent)
|
80
|
+
{
|
81
|
+
if (!bstrHttpEquiv || !*bstrHttpEquiv)
|
82
|
+
return;
|
83
|
+
|
84
|
+
if (_wcsicmp(bstrHttpEquiv, L"Battery") == 0)
|
85
|
+
{
|
86
|
+
m_oBatteryEvent = CBatteryEvent(bstrContent);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
int CMetaHandler::checkHResult(HRESULT res, const char* file, int line, const char* msg )
|
91
|
+
{
|
92
|
+
m_hResult = res;
|
93
|
+
if (FAILED(res))
|
94
|
+
{
|
95
|
+
//LOG(ERROR) + "Error Code:" + res + ";Method: " + msg + ";Line: " + line;
|
96
|
+
// rho_ruby_raise_runtime("Calendar method failed.");
|
97
|
+
return 0;
|
98
|
+
}
|
99
|
+
|
100
|
+
return 1;
|
101
|
+
}
|
102
|
+
|
103
|
+
#define CHECK(res, ptr) {if(!checkHResult(res, __FILE__, __LINE__, #res ) || !ptr) break;}
|
104
|
+
#define CHECKC(res, ptr) {if(!checkHResult(res, __FILE__, __LINE__, #res ) || !ptr) continue;}
|
105
|
+
|
106
|
+
void CMetaHandler::readMetaTags(CComPtr<IWebBrowser2> pIWebBrowser2)
|
107
|
+
{
|
108
|
+
do
|
109
|
+
{
|
110
|
+
m_oBatteryEvent = CBatteryEvent();
|
111
|
+
|
112
|
+
CComPtr<IDispatch> pDispDoc;
|
113
|
+
CHECK(pIWebBrowser2->get_Document(&pDispDoc), pDispDoc);
|
114
|
+
|
115
|
+
CComPtr<IHTMLDocument3> pDoc;
|
116
|
+
CHECK(pDispDoc.QueryInterface(&pDoc), pDoc);
|
117
|
+
|
118
|
+
#if defined(_WIN32_WCE) && _WIN32_WCE <= 0x501
|
119
|
+
/*
|
120
|
+
DISPID id = 0;
|
121
|
+
OLECHAR* szMember = L"body";
|
122
|
+
CHECK( pDispDoc->GetIDsOfNames(IID_NULL, &szMember, 1, LOCALE_USER_DEFAULT, &id), 1);
|
123
|
+
|
124
|
+
CComVariant varResult;
|
125
|
+
varResult.vt = VT_DISPATCH;
|
126
|
+
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
|
127
|
+
|
128
|
+
CHECK(pDoc->Invoke(id, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, &dispparamsNoArgs, &varResult, NULL, NULL), varResult.pdispVal);
|
129
|
+
CComPtr<IDispatch> dispHead = varResult.pdispVal;
|
130
|
+
CComPtr<IHTMLElement> pHead;
|
131
|
+
CHECKC( dispHead.QueryInterface(&pHead), pHead);
|
132
|
+
|
133
|
+
CComPtr<IHTMLElementCollection> pColl;
|
134
|
+
CHECK(pHead->get_children(&pColl), pColl);
|
135
|
+
|
136
|
+
long size = 0;
|
137
|
+
CHECK(pColl->get_length(&size), size);
|
138
|
+
|
139
|
+
for( long i = 0; i < size; i++)
|
140
|
+
{
|
141
|
+
CComVariant index = i;
|
142
|
+
CComPtr<IDispatch> dispMeta;
|
143
|
+
CHECKC(pColl->item(index, index, &dispMeta), dispMeta);
|
144
|
+
|
145
|
+
CComPtr<IHTMLElement> pMeta;
|
146
|
+
CHECKC( dispMeta.QueryInterface(&pMeta), pMeta);
|
147
|
+
|
148
|
+
CComBSTR bodyValue;
|
149
|
+
CHECKC( pMeta->get_innerHTML(&bodyValue), bodyValue);
|
150
|
+
}*/
|
151
|
+
#else
|
152
|
+
CComPtr<IHTMLElementCollection> pColl;
|
153
|
+
CHECK(pDoc->getElementsByTagName(CComBSTR("meta"), &pColl), pColl);
|
154
|
+
|
155
|
+
long size = 0;
|
156
|
+
CHECK(pColl->get_length(&size), size);
|
157
|
+
|
158
|
+
for( long i = 0; i < size; i++)
|
159
|
+
{
|
160
|
+
CComVariant index = i;
|
161
|
+
CComPtr<IDispatch> dispMeta;
|
162
|
+
CHECKC(pColl->item(index, index, &dispMeta), dispMeta);
|
163
|
+
|
164
|
+
#ifndef _WIN32_WCE
|
165
|
+
CComPtr<IHTMLMetaElement> pMeta;
|
166
|
+
CHECKC( dispMeta.QueryInterface(&pMeta), pMeta);
|
167
|
+
|
168
|
+
CComBSTR bstrHttpEquiv;
|
169
|
+
CHECKC( pMeta->get_httpEquiv(&bstrHttpEquiv), bstrHttpEquiv);
|
170
|
+
|
171
|
+
CComBSTR bstrContent;
|
172
|
+
CHECKC( pMeta->get_content(&bstrContent), bstrContent);
|
173
|
+
|
174
|
+
handleMetaTag(bstrHttpEquiv, bstrContent);
|
175
|
+
#else
|
176
|
+
|
177
|
+
CComPtr<IHTMLElement> pMeta;
|
178
|
+
CHECKC( dispMeta.QueryInterface(&pMeta), pMeta);
|
179
|
+
|
180
|
+
CComBSTR bstrHttpEquiv = L"http-equiv";
|
181
|
+
CComVariant varHttpEquiv;
|
182
|
+
CHECKC( pMeta->getAttribute(bstrHttpEquiv, 0, &varHttpEquiv), 1);
|
183
|
+
CComBSTR bstrContent = L"content";
|
184
|
+
CComVariant varContent;
|
185
|
+
CHECKC( pMeta->getAttribute(bstrContent, 0, &varContent), 1);
|
186
|
+
|
187
|
+
handleMetaTag(varHttpEquiv.vt == VT_BSTR ? varHttpEquiv.bstrVal : 0, varContent.vt == VT_BSTR ? varContent.bstrVal : 0);
|
188
|
+
#endif
|
189
|
+
}
|
190
|
+
#endif
|
191
|
+
}while(false);
|
192
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include "logging/RhoLog.h"
|
4
|
+
|
5
|
+
class CMetaHandler
|
6
|
+
{
|
7
|
+
DEFINE_LOGCLASS;
|
8
|
+
|
9
|
+
class CBatteryEvent
|
10
|
+
{
|
11
|
+
CStringW m_strCallback;
|
12
|
+
|
13
|
+
public:
|
14
|
+
CBatteryEvent(){}
|
15
|
+
CBatteryEvent(const CStringW& strCallback) : m_strCallback(strCallback){}
|
16
|
+
|
17
|
+
CStringW makeJSCallback();
|
18
|
+
};
|
19
|
+
|
20
|
+
HRESULT m_hResult;
|
21
|
+
CBatteryEvent m_oBatteryEvent;
|
22
|
+
|
23
|
+
public:
|
24
|
+
CMetaHandler(CComPtr<IWebBrowser2> pIWebBrowser2);
|
25
|
+
~CMetaHandler(void);
|
26
|
+
private:
|
27
|
+
void readMetaTags(CComPtr<IWebBrowser2> pIWebBrowser2);
|
28
|
+
void handleMetaTag(BSTR bstrHttpEquiv, BSTR bstrContent);
|
29
|
+
int checkHResult(HRESULT res, const char* file, int line, const char* msg );
|
30
|
+
void checkEvents();
|
31
|
+
};
|