mds_plat/location_manager_api/inc/reversegeocoderplugin.inl
changeset 60 79f826a55db2
parent 51 87e65c44ff3a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mds_plat/location_manager_api/inc/reversegeocoderplugin.inl	Wed Oct 06 15:08:08 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This is partial interface implementation which is 
+*              used by plugins. 
+* 
+*/
+
+
+
+// INCLUDE FILES
+
+#include <ecom/ecom.h>       // declares E-com framework classes
+
+
+// -----------------------------------------------------------------------------
+// CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin()
+// Destroys the plugin implementation
+// -----------------------------------------------------------------------------
+//
+inline CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin()
+{
+    REComSession::DestroyedImplementation( iDtorKey );
+}
+
+
+// -----------------------------------------------------------------------------
+// CReverseGeoCoderPlugin::NewL()
+// Creates the instance of CReverseGeoCoderPlugin concrete implementation.
+// -----------------------------------------------------------------------------
+//
+inline CReverseGeoCoderPlugin* CReverseGeoCoderPlugin::NewL()
+{
+		RImplInfoPtrArray aImplInfoArray;
+		REComSession::ListImplementationsL(KReversegeocodeInterfaceUid, aImplInfoArray);
+		
+		TInt count = aImplInfoArray.Count();
+		
+		if(!count) 
+			{
+			/* No implementations found for the reverse geocoding functionality */
+			User::Leave(KErrNotFound);
+			}
+			
+		/* One or more implementations found. Choose the first one */
+		const CImplementationInformation* plugin = aImplInfoArray[0];
+		TUid  pluginId = plugin->ImplementationUid();
+		
+		CReverseGeoCoderPlugin* self = reinterpret_cast<CReverseGeoCoderPlugin*>(
+	       		REComSession::CreateImplementationL(
+	           pluginId, _FOFF( CReverseGeoCoderPlugin,iDtorKey ) ) );
+	
+	    return self;
+}
+
+// End of file