photosgallery/viewframework/uiutilities/src/glxskinchangemonitor.cpp
changeset 0 4e91876724a2
child 18 bcb43dc84c44
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/photosgallery/viewframework/uiutilities/src/glxskinchangemonitor.cpp	Thu Dec 17 08:45:44 2009 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2008-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:    Implementation of the CGlxSkinChangeMonitor class
+*
+*/
+
+
+
+
+ // Class definition
+
+#include "glxskinchangemonitor.h" 
+
+//-----------------------------------------------------------------------------
+// NewL
+//-----------------------------------------------------------------------------
+CGlxSkinChangeMonitor* CGlxSkinChangeMonitor::NewL()
+    {
+    CGlxSkinChangeMonitor* self = new (ELeave) CGlxSkinChangeMonitor( );  
+    CleanupStack::PushL( self );
+    // 2nd phase
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+//-----------------------------------------------------------------------------
+// Destructor
+//-----------------------------------------------------------------------------
+CGlxSkinChangeMonitor::~CGlxSkinChangeMonitor()
+    {
+    //ResetAndDestroy()???
+    iSkinChangeObservers.Close();
+    }
+
+//-----------------------------------------------------------------------------
+// C++ Constructor
+//-----------------------------------------------------------------------------
+CGlxSkinChangeMonitor::CGlxSkinChangeMonitor( )
+    {
+    }
+ 
+//-----------------------------------------------------------------------------
+// Symbian 2 phase constructor
+//-----------------------------------------------------------------------------    
+void CGlxSkinChangeMonitor::ConstructL()
+    {
+    CreateWindowL();
+    }
+  
+
+//-----------------------------------------------------------------------------
+// HandleResourceChange
+//-----------------------------------------------------------------------------
+void CGlxSkinChangeMonitor::HandleResourceChange( TInt aType )
+    {
+    // Call base class method
+    CCoeControl::HandleResourceChange(aType);
+    
+	// is it skin change 
+   	if( KAknsMessageSkinChange == aType )
+        {  
+        TInt obsCount = iSkinChangeObservers.Count();
+        for (TInt obsIdx = 0; obsIdx < obsCount; ++obsIdx)
+            {            
+            iSkinChangeObservers[obsIdx]->HandleSkinChanged();
+            }     
+        }
+    }
+
+//-----------------------------------------------------------------------------
+// AddSkinChangedObserverL
+//-----------------------------------------------------------------------------
+void CGlxSkinChangeMonitor::AddSkinChangeObserverL( MGlxSkinChangeObserver& aObserver )
+	{
+	iSkinChangeObservers.AppendL( &aObserver );
+	}
+	
+//-----------------------------------------------------------------------------
+// RemoveSkinChangedObserver
+//-----------------------------------------------------------------------------
+void CGlxSkinChangeMonitor::RemoveSkinChangeObserver( MGlxSkinChangeObserver& aObserver )
+	{
+	TInt index = iSkinChangeObservers.Find( &aObserver );
+
+    if ( index != KErrNotFound ) 
+        {
+        iSkinChangeObservers.Remove( index );
+        }
+	}
+
+