CB-219 Rename PhoneGap to Cordova
diff --git a/.project b/.project
index 659de2c..98aa230 100755
--- a/.project
+++ b/.project
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>

 <projectDescription>

-	<name>PhoneGap</name>

+	<name>Cordova</name>

 	<comment></comment>

 	<projects>

 	</projects>

diff --git a/inc/Accelerometer.h b/inc/Accelerometer.h
index 47b59d7..ca43939 100755
--- a/inc/Accelerometer.h
+++ b/inc/Accelerometer.h
@@ -8,12 +8,12 @@
 #ifndef ACCELEROMETER_H_

 #define ACCELEROMETER_H_

 

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 #include <FUix.h>

 

 using namespace Osp::Uix;

 

-class Accelerometer: public PhoneGapCommand, ISensorEventListener

+class Accelerometer: public CordovaCommand, ISensorEventListener

  {

 public:

 	Accelerometer();

diff --git a/inc/Compass.h b/inc/Compass.h
index c6775cc..ee9f6b2 100755
--- a/inc/Compass.h
+++ b/inc/Compass.h
@@ -9,11 +9,11 @@
 #define COMPASS_H_

 

 #include <FUix.h>

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 

 using namespace Osp::Uix;

 

-class Compass: public PhoneGapCommand, ISensorEventListener {

+class Compass: public CordovaCommand, ISensorEventListener {

 public:

 	Compass(Web* pWeb);

 	virtual ~Compass();

diff --git a/inc/Contacts.h b/inc/Contacts.h
index bf95102..71dad11 100755
--- a/inc/Contacts.h
+++ b/inc/Contacts.h
@@ -9,11 +9,11 @@
 #define CONTACTS_H_

 

 #include <FSocial.h>

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 using namespace Osp::Social;

 using namespace Osp::Base::Collection;

 

-class Contacts: public PhoneGapCommand {

+class Contacts: public CordovaCommand {

 public:

 	Contacts(Web* pWeb);

 	virtual ~Contacts();

diff --git a/inc/PhoneGap.h b/inc/Cordova.h
similarity index 85%
rename from inc/PhoneGap.h
rename to inc/Cordova.h
index 19f17db..0c95c9f 100755
--- a/inc/PhoneGap.h
+++ b/inc/Cordova.h
@@ -1,5 +1,5 @@
-#ifndef __PHONEGAP_H__

-#define __PHONEGAP_H__

+#ifndef __CORDOVA_H__

+#define __CORDOVA_H__

 

 

 #include <FApp.h>

@@ -11,21 +11,21 @@
  * [WebBasedApp] application must inherit from Application class

  * which provides basic features necessary to define an application.

  */

-class PhoneGap :

+class Cordova :

 	public Osp::App::Application,

 	public Osp::System::IScreenEventListener

 {

 public:

 

 	/**

-	 * [PhoneGap] application must have a factory method that creates an instance of itself.

+	 * [Cordova] application must have a factory method that creates an instance of itself.

 	 */

 	static Osp::App::Application* CreateInstance(void);

 

 

 public:

-	PhoneGap();

-	~PhoneGap();

+	Cordova();

+	~Cordova();

 

 

 public:

@@ -58,4 +58,4 @@
 	void OnScreenOff (void);

 };

 

-#endif	//__PHONEGAP_H__

+#endif	//__CORDOVA_H__

diff --git a/inc/CordovaCommand.h b/inc/CordovaCommand.h
new file mode 100755
index 0000000..5f18b01
--- /dev/null
+++ b/inc/CordovaCommand.h
@@ -0,0 +1,29 @@
+/*

+ * CordovaCommand.h

+ *

+ *  Created on: Mar 7, 2011

+ *      Author: Anis Kadri

+ */

+

+#ifndef CORDOVACOMMAND_H_

+#define CORDOVACOMMAND_H_

+

+#include <FWeb.h>

+#include <FBase.h>

+

+using namespace Osp::Web::Controls;

+using namespace Osp::Base;

+using namespace Osp::Base::Utility;

+

+class CordovaCommand {

+public:

+	CordovaCommand();

+	CordovaCommand(Web* pWeb);

+	virtual ~CordovaCommand();

+protected:

+	Web* pWeb;

+public:

+	virtual void Run(const String& command) =0;

+};

+

+#endif /* CORDOVACOMMAND_H_ */

diff --git a/inc/DebugConsole.h b/inc/DebugConsole.h
index 71d7d08..21493da 100755
--- a/inc/DebugConsole.h
+++ b/inc/DebugConsole.h
@@ -8,9 +8,9 @@
 #ifndef DEBUGCONSOLE_H_

 #define DEBUGCONSOLE_H_

 

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 

-class DebugConsole: public PhoneGapCommand {

+class DebugConsole: public CordovaCommand {

 public:

 	DebugConsole(Web* pWeb);

 	virtual ~DebugConsole();

diff --git a/inc/Device.h b/inc/Device.h
index 32d31fe..47e5dcb 100755
--- a/inc/Device.h
+++ b/inc/Device.h
@@ -8,12 +8,12 @@
 #ifndef DEVICE_H_

 #define DEVICE_H_

 

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 #include <FSystem.h>

 

 using namespace Osp::System;

 

-class Device: public PhoneGapCommand {

+class Device: public CordovaCommand {

 public:

 	Device();

 	Device(Web* pWeb);

diff --git a/inc/GeoLocation.h b/inc/GeoLocation.h
index 3f637b5..e157f6c 100755
--- a/inc/GeoLocation.h
+++ b/inc/GeoLocation.h
@@ -8,12 +8,12 @@
 #ifndef GEOLOCATION_H_

 #define GEOLOCATION_H_

 

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 #include <FLocations.h>

 

 using namespace Osp::Locations;

 

-class GeoLocation: public PhoneGapCommand, ILocationListener {

+class GeoLocation: public CordovaCommand, ILocationListener {

 private:

 	LocationProvider* locProvider;

 	bool			  watching;

diff --git a/inc/Kamera.h b/inc/Kamera.h
index aef22bd..0814831 100755
--- a/inc/Kamera.h
+++ b/inc/Kamera.h
@@ -8,7 +8,7 @@
 #ifndef KAMERA_H_

 #define KAMERA_H_

 

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 #include <FApp.h>

 #include <FIo.h>

 

@@ -16,7 +16,7 @@
 using namespace Osp::Base::Collection;

 using namespace Osp::Io;

 

-class Kamera: public PhoneGapCommand, IAppControlEventListener {

+class Kamera: public CordovaCommand, IAppControlEventListener {

 public:

 	Kamera(Web* pWeb);

 	virtual ~Kamera();

diff --git a/inc/Network.h b/inc/Network.h
index 2e483ea..be173ec 100755
--- a/inc/Network.h
+++ b/inc/Network.h
@@ -8,7 +8,7 @@
 #ifndef NETWORK_H_

 #define NETWORK_H_

 

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 #include <FNet.h>

 #include <FSystem.h>

 

@@ -16,7 +16,7 @@
 using namespace Osp::Net::Http;

 using namespace Osp::System;

 

-class Network: public PhoneGapCommand, public IHttpTransactionEventListener  {

+class Network: public CordovaCommand, public IHttpTransactionEventListener  {

 public:

 	Network(Web* pWeb);

 	virtual ~Network();

diff --git a/inc/Notification.h b/inc/Notification.h
index d6094f7..0756d08 100755
--- a/inc/Notification.h
+++ b/inc/Notification.h
@@ -11,13 +11,13 @@
 #include <FUi.h>

 #include <FUix.h>

 #include <FSystem.h>

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 using namespace Osp::System;

 using namespace Osp::Ui;

 using namespace Osp::Ui::Controls;

 using namespace Osp::Uix;

 

-class Notification: public PhoneGapCommand {

+class Notification: public CordovaCommand {

 public:

 	Notification(Web* pWeb);

 	virtual ~Notification();

diff --git a/inc/PhoneGapCommand.h b/inc/PhoneGapCommand.h
deleted file mode 100755
index d780c4b..0000000
--- a/inc/PhoneGapCommand.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*

- * PhoneGapCommand.h

- *

- *  Created on: Mar 7, 2011

- *      Author: Anis Kadri

- */

-

-#ifndef PHONEGAPCOMMAND_H_

-#define PHONEGAPCOMMAND_H_

-

-#include <FWeb.h>

-#include <FBase.h>

-

-using namespace Osp::Web::Controls;

-using namespace Osp::Base;

-using namespace Osp::Base::Utility;

-

-class PhoneGapCommand {

-public:

-	PhoneGapCommand();

-	PhoneGapCommand(Web* pWeb);

-	virtual ~PhoneGapCommand();

-protected:

-	Web* pWeb;

-public:

-	virtual void Run(const String& command) =0;

-};

-

-#endif /* PHONEGAPCOMMAND_H_ */

diff --git a/inc/WebForm.h b/inc/WebForm.h
index 2afada6..90b8d35 100755
--- a/inc/WebForm.h
+++ b/inc/WebForm.h
@@ -6,7 +6,7 @@
 #include <FUi.h>

 #include <FWeb.h>

 #include <FSystem.h>

-#include "PhoneGapCommand.h"

+#include "CordovaCommand.h"

 #include "GeoLocation.h"

 #include "Device.h"

 #include "Accelerometer.h"

@@ -52,7 +52,7 @@
 	Contacts*					contacts;

 	Notification*				notification;

 	Kamera*						camera;

-	String*						__phonegapCommand;

+	String*						__cordovaCommand;

 

 public:

 	virtual result OnInitializing(void);

diff --git a/src/Accelerometer.cpp b/src/Accelerometer.cpp
index 710a0e6..75c7aee 100755
--- a/src/Accelerometer.cpp
+++ b/src/Accelerometer.cpp
@@ -12,7 +12,7 @@
 	started = false;

 }

 

-Accelerometer::Accelerometer(Web* pWeb): PhoneGapCommand(pWeb) {

+Accelerometer::Accelerometer(Web* pWeb): CordovaCommand(pWeb) {

 	__sensorMgr.Construct();

 	started = false;

 	x = y = z = 0.0;

diff --git a/src/Compass.cpp b/src/Compass.cpp
index 54b6119..b2f6de7 100755
--- a/src/Compass.cpp
+++ b/src/Compass.cpp
@@ -7,7 +7,7 @@
 

 #include "../inc/Compass.h"

 

-Compass::Compass(Web* pWeb) : PhoneGapCommand(pWeb) {

+Compass::Compass(Web* pWeb) : CordovaCommand(pWeb) {

 	__sensorMgr.Construct();

 	started = false;

 	x = y = z = 0.0;

diff --git a/src/Contacts.cpp b/src/Contacts.cpp
index 3feb854..8ef29e7 100755
--- a/src/Contacts.cpp
+++ b/src/Contacts.cpp
@@ -7,7 +7,7 @@
 

 #include "../inc/Contacts.h"

 

-Contacts::Contacts(Web* pWeb) : PhoneGapCommand(pWeb) {

+Contacts::Contacts(Web* pWeb) : CordovaCommand(pWeb) {

 }

 

 Contacts::~Contacts() {

diff --git a/src/PhoneGap.cpp b/src/Cordova.cpp
similarity index 84%
rename from src/PhoneGap.cpp
rename to src/Cordova.cpp
index 806e940..d32a8f3 100755
--- a/src/PhoneGap.cpp
+++ b/src/Cordova.cpp
@@ -5,7 +5,7 @@
  * Description : 

  */

 

-#include "PhoneGap.h"

+#include "Cordova.h"

 #include "WebForm.h"

 

 using namespace Osp::App;

@@ -14,23 +14,23 @@
 using namespace Osp::Ui;

 using namespace Osp::Ui::Controls;

 

-PhoneGap::PhoneGap()

+Cordova::Cordova()

 {

 }

 

-PhoneGap::~PhoneGap()

+Cordova::~Cordova()

 {

 }

 

 Application*

-PhoneGap::CreateInstance(void)

+Cordova::CreateInstance(void)

 {

 	// Create the instance through the constructor.

-	return new PhoneGap();

+	return new Cordova();

 }

 

 bool

-PhoneGap::OnAppInitializing(AppRegistry& appRegistry)

+Cordova::OnAppInitializing(AppRegistry& appRegistry)

 {

 	// TODO:

 	// Initialize UI resources and application specific data.

@@ -73,7 +73,7 @@
 }

 

 bool

-PhoneGap::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)

+Cordova::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)

 {

 	// TODO:

 	// Deallocate resources allocated by this application for termination.

@@ -82,28 +82,28 @@
 }

 

 void

-PhoneGap::OnForeground(void)

+Cordova::OnForeground(void)

 {

 	// TODO:

 	// Start or resume drawing when the application is moved to the foreground.

 }

 

 void

-PhoneGap::OnBackground(void)

+Cordova::OnBackground(void)

 {

 	// TODO:

 	// Stop drawing when the application is moved to the background.

 }

 

 void

-PhoneGap::OnLowMemory(void)

+Cordova::OnLowMemory(void)

 {

 	// TODO:

 	// Free unused resources or close the application.

 }

 

 void

-PhoneGap::OnBatteryLevelChanged(BatteryLevel batteryLevel)

+Cordova::OnBatteryLevelChanged(BatteryLevel batteryLevel)

 {

 	// TODO:

 	// Handle any changes in battery level here.

@@ -111,14 +111,14 @@
 }

 

 void

-PhoneGap::OnScreenOn (void)

+Cordova::OnScreenOn (void)

 {

 	// TODO:

 	// Get the released resources or resume the operations that were paused or stopped in OnScreenOff().

 }

 

 void

-PhoneGap::OnScreenOff (void)

+Cordova::OnScreenOff (void)

 {

 	// TODO:

 	//  Unless there is a strong reason to do otherwise, release resources (such as 3D, media, and sensors) to allow the device to enter the sleep mode to save the battery.

diff --git a/src/CordovaCommand.cpp b/src/CordovaCommand.cpp
new file mode 100755
index 0000000..2831e6a
--- /dev/null
+++ b/src/CordovaCommand.cpp
@@ -0,0 +1,16 @@
+/*

+ * CordovaCommand.cpp

+ *

+ *  Created on: Mar 7, 2011

+ *      Author: Anis Kadri

+ */

+

+#include "CordovaCommand.h"

+

+CordovaCommand::CordovaCommand() : pWeb(null) {

+}

+CordovaCommand::CordovaCommand(Web* pWeb) : pWeb(pWeb) {

+}

+

+CordovaCommand::~CordovaCommand() {

+}

diff --git a/src/PhoneGapEntry.cpp b/src/CordovaEntry.cpp
similarity index 89%
rename from src/PhoneGapEntry.cpp
rename to src/CordovaEntry.cpp
index 453b544..78fbba4 100755
--- a/src/PhoneGapEntry.cpp
+++ b/src/CordovaEntry.cpp
@@ -1,7 +1,7 @@
 /**

  * This file contains the bada application entry point.

  */

-#include "PhoneGap.h"

+#include "Cordova.h"

 

 using namespace Osp::Base;

 using namespace Osp::Base::Collection;

@@ -27,7 +27,7 @@
 	for (int i = 0; i < argc; i++)

 		pArgs->Add(*(new String(pArgv[i])));

 

-	r = Osp::App::Application::Execute(PhoneGap::CreateInstance, pArgs);

+	r = Osp::App::Application::Execute(Cordova::CreateInstance, pArgs);

 	if (IsFailed(r))

 	{

 		AppLogException("Application execution failed-[%s].", GetErrorMessage(r));

diff --git a/src/DebugConsole.cpp b/src/DebugConsole.cpp
index f77684a..e068670 100755
--- a/src/DebugConsole.cpp
+++ b/src/DebugConsole.cpp
@@ -7,7 +7,7 @@
 

 #include "../inc/DebugConsole.h"

 

-DebugConsole::DebugConsole(Web* pWeb): PhoneGapCommand(pWeb) {

+DebugConsole::DebugConsole(Web* pWeb): CordovaCommand(pWeb) {

 	// TODO Auto-generated constructor stub

 }

 

diff --git a/src/Device.cpp b/src/Device.cpp
index 9c2b7af..97835d2 100755
--- a/src/Device.cpp
+++ b/src/Device.cpp
@@ -12,7 +12,7 @@
 

 }

 

-Device::Device(Web* pWeb): PhoneGapCommand(pWeb) {

+Device::Device(Web* pWeb): CordovaCommand(pWeb) {

 

 }

 

diff --git a/src/GeoLocation.cpp b/src/GeoLocation.cpp
index da9c673..d02de27 100755
--- a/src/GeoLocation.cpp
+++ b/src/GeoLocation.cpp
@@ -12,7 +12,7 @@
 

 }

 

-GeoLocation::GeoLocation(Web* pWeb): PhoneGapCommand(pWeb) {

+GeoLocation::GeoLocation(Web* pWeb): CordovaCommand(pWeb) {

 	locProvider = new LocationProvider();

 	locProvider->Construct(LOC_METHOD_HYBRID);

 	watching = false;

diff --git a/src/Kamera.cpp b/src/Kamera.cpp
index 5728803..5bf71a2 100755
--- a/src/Kamera.cpp
+++ b/src/Kamera.cpp
@@ -7,7 +7,7 @@
 

 #include "../inc/Kamera.h"

 

-Kamera::Kamera(Web* pWeb) : PhoneGapCommand(pWeb) {

+Kamera::Kamera(Web* pWeb) : CordovaCommand(pWeb) {

 }

 

 Kamera::~Kamera() {

diff --git a/src/Network.cpp b/src/Network.cpp
index e2e7715..1b321ab 100755
--- a/src/Network.cpp
+++ b/src/Network.cpp
@@ -7,7 +7,7 @@
 

 #include "../inc/Network.h"

 

-Network::Network(Web* pWeb) : PhoneGapCommand(pWeb) {

+Network::Network(Web* pWeb) : CordovaCommand(pWeb) {

 }

 

 Network::~Network() {

diff --git a/src/Notification.cpp b/src/Notification.cpp
index 2727c12..bb5f958 100755
--- a/src/Notification.cpp
+++ b/src/Notification.cpp
@@ -7,7 +7,7 @@
 

 #include "../inc/Notification.h"

 

-Notification::Notification(Web* pWeb) : PhoneGapCommand(pWeb) {

+Notification::Notification(Web* pWeb) : CordovaCommand(pWeb) {

 }

 

 Notification::~Notification() {

diff --git a/src/PhoneGapCommand.cpp b/src/PhoneGapCommand.cpp
deleted file mode 100755
index 9f743e8..0000000
--- a/src/PhoneGapCommand.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-/*

- * PhoneGapCommand.cpp

- *

- *  Created on: Mar 7, 2011

- *      Author: Anis Kadri

- */

-

-#include "PhoneGapCommand.h"

-

-PhoneGapCommand::PhoneGapCommand() : pWeb(null) {

-}

-PhoneGapCommand::PhoneGapCommand(Web* pWeb) : pWeb(pWeb) {

-}

-

-PhoneGapCommand::~PhoneGapCommand() {

-}

diff --git a/src/WebForm.cpp b/src/WebForm.cpp
index 84c5f59..52494c0 100755
--- a/src/WebForm.cpp
+++ b/src/WebForm.cpp
@@ -1,7 +1,7 @@
 #include "WebForm.h"

 

 WebForm::WebForm(void)

-	:__pWeb(null), __phonegapCommand(null)

+	:__pWeb(null), __cordovaCommand(null)

 {

 	geolocation = null;

 	device = null;

@@ -49,7 +49,7 @@
 {

 	result r = E_SUCCESS;

 

-//	delete __phonegapCommand;

+//	delete __cordovaCommand;

 //	delete geolocation;

 //	delete device;

 //	delete accel;

@@ -97,9 +97,9 @@
 WebForm::OnLoadingRequested (const Osp::Base::String& url, WebNavigationType type) {

 	AppLogDebug("URL REQUESTED %S", url.GetPointer());

 	if(url.StartsWith("gap://", 0)) {

-//		__phonegapCommand = null;

+//		__cordovaCommand = null;

 

-		__phonegapCommand = new String(url);

+		__cordovaCommand = new String(url);

 		//	FIXME: for some reason this does not work if we return true. Web freezes.

 //		__pWeb->StopLoading();

 //		String* test;

@@ -131,35 +131,35 @@
 	delete deviceInfo;

 

 	// Analyzing PhoneGap command

-	if(__phonegapCommand) {

-		if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Geolocation", 0)) {

-			geolocation->Run(*__phonegapCommand);

+	if(__cordovaCommand) {

+		if(__cordovaCommand->StartsWith(L"gap://com.phonegap.Geolocation", 0)) {

+			geolocation->Run(*__cordovaCommand);

 		}

-		else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Accelerometer", 0)) {

-			accel->Run(*__phonegapCommand);

+		else if(__cordovaCommand->StartsWith(L"gap://com.phonegap.Accelerometer", 0)) {

+			accel->Run(*__cordovaCommand);

 		}

-		else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Network", 0)) {

-			network->Run(*__phonegapCommand);

+		else if(__cordovaCommand->StartsWith(L"gap://com.phonegap.Network", 0)) {

+			network->Run(*__cordovaCommand);

 		}

-		else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.DebugConsole", 0)) {

-			console->Run(*__phonegapCommand);

+		else if(__cordovaCommand->StartsWith(L"gap://com.phonegap.DebugConsole", 0)) {

+			console->Run(*__cordovaCommand);

 		}

-		else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Compass", 0)) {

-			compass->Run(*__phonegapCommand);

+		else if(__cordovaCommand->StartsWith(L"gap://com.phonegap.Compass", 0)) {

+			compass->Run(*__cordovaCommand);

 		}

-		else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Contacts", 0)) {

-			contacts->Run(*__phonegapCommand);

+		else if(__cordovaCommand->StartsWith(L"gap://com.phonegap.Contacts", 0)) {

+			contacts->Run(*__cordovaCommand);

 		}

-		else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Notification", 0)) {

-			notification->Run(*__phonegapCommand);

+		else if(__cordovaCommand->StartsWith(L"gap://com.phonegap.Notification", 0)) {

+			notification->Run(*__cordovaCommand);

 		}

-		else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Camera", 0)) {

-			camera->Run(*__phonegapCommand);

+		else if(__cordovaCommand->StartsWith(L"gap://com.phonegap.Camera", 0)) {

+			camera->Run(*__cordovaCommand);

 		}

 		// Tell the JS code that we got this command, and we're ready for another

 		__pWeb->EvaluateJavascriptN(L"PhoneGap.queue.ready = true;");

-		delete __phonegapCommand;

-		__phonegapCommand = null;

+		delete __cordovaCommand;

+		__cordovaCommand = null;

 	}

 	else {

 		AppLogDebug("Non PhoneGap command completed");