--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alfoogmplugin/src/alfoogmplugin.cpp Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 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: OOM plugin for ALFserver.
+*
+*/
+
+#include <ecom/ecom.h>
+#include <ecom/implementationproxy.h>
+#include <goommonitorplugin.h>
+#include <w32std.h>
+
+#include <alf/alfdirectclient.h>
+
+class CAlfOogmMonitorPlugin : public CGOomMonitorPlugin
+ {
+public:
+ CAlfOogmMonitorPlugin();
+ ~CAlfOogmMonitorPlugin();
+ void ConstructL();
+
+public:
+ void FreeRam(TInt aBytesToFree);
+ void MemoryGood();
+
+private:
+ RAlfDirectClient iAlfDirectClient;
+ };
+
+// -----------------------------------------------------------------------------
+// C++ constructor.
+// -----------------------------------------------------------------------------
+//
+CAlfOogmMonitorPlugin::CAlfOogmMonitorPlugin()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CAlfOogmMonitorPlugin::~CAlfOogmMonitorPlugin()
+ {
+
+ }
+
+// -----------------------------------------------------------------------------
+// Symbian two-phased constructor (2nd phase).
+// -----------------------------------------------------------------------------
+//
+void CAlfOogmMonitorPlugin::ConstructL()
+ {
+ CGOomMonitorPluginBase::ConstructL();
+ }
+
+
+// -----------------------------------------------------------------------------
+// Tries to free RAM.
+// -----------------------------------------------------------------------------
+//
+void CAlfOogmMonitorPlugin::FreeRam(TInt aBytesToFree)
+ {
+ iAlfDirectClient.EnableLowMemoryState(aBytesToFree);
+ }
+
+// -----------------------------------------------------------------------------
+// CAlfOogmMonitorPlugin::MemoryGood
+// -----------------------------------------------------------------------------
+//
+void CAlfOogmMonitorPlugin::MemoryGood()
+ {
+ iAlfDirectClient.EnableLowMemoryState(EFalse);
+ }
+
+// -----------------------------------------------------------------------------
+// Creates plugin.
+// -----------------------------------------------------------------------------
+//
+TAny* CreatePlugin()
+ {
+ CAlfOogmMonitorPlugin* plugin = new(ELeave) CAlfOogmMonitorPlugin;
+ CleanupStack::PushL(plugin);
+ plugin->ConstructL();
+ CleanupStack::Pop(plugin);
+ return plugin;
+ }
+
+// -----------------------------------------------------------------------------
+// Implementation table for plugin.
+// -----------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+ {
+ {{0xE4B6C988}, ::CreatePlugin}
+ };
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+ {
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
+ return ImplementationTable;
+ }
+
+// End of file
+