--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp Mon Jan 18 20:08:26 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* ============================================================================
+* Name : CTestAppContainer from TestAppContainer.h
+* Part of : TestApp
+* Created : 08.10.2004 by Jalemine
+* Implementation notes:
+* Initial content was generated by Series 60 AppWizard.
+* Version :
+* Copyright: Digia
+* ============================================================================
+*/
+
+// INCLUDE FILES
+#include "TestAppContainer.h"
+#include <aknlists.h>
+#include <AknsUtils.h>
+#include <AppLayout.cdl.h>
+#include <AknIconUtils.h>
+#include <AknsConstants.h>
+#include <AknsDrawUtils.h>
+#include <AknsBasicBackgroundControlContext.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CTestAppContainer::ConstructL(const TRect& aRect)
+// EPOC two phased constructor
+// ---------------------------------------------------------
+//
+void CTestAppContainer::ConstructL(const TRect& aRect)
+ {
+ CreateWindowL();
+
+ // Get the skin instance
+ iSkinInstance = AknsUtils::SkinInstance();
+
+ // Create background control context for skinning the background
+ iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL(
+ KAknsIIDSkinBmpMainPaneUsual, aRect, ETrue );
+
+ iListBox = new (ELeave) CEikTextListBox;
+ iListBox->SetContainerWindowL( *this );
+ iListBox->ConstructL( this );
+
+ iItems = new( ELeave )CDesCArrayFlat( 4 );
+ iListBox->Model()->SetItemTextArray( iItems );
+ iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+ iListBox->SetMopParent( this );
+
+ SetRect(aRect);
+ ActivateL();
+ }
+
+// Destructor
+CTestAppContainer::~CTestAppContainer()
+ {
+ delete iListBox;
+ delete iBackgroundSkinContext;
+ }
+
+// ---------------------------------------------------------
+// CTestAppContainer::SizeChanged()
+// Called by framework when the view size is changed
+// ---------------------------------------------------------
+//
+void CTestAppContainer::SizeChanged()
+ {
+ iListBox->SetRect( Rect() );
+ }
+
+// ---------------------------------------------------------
+// CTestAppContainer::CountComponentControls() const
+// ---------------------------------------------------------
+//
+TInt CTestAppContainer::CountComponentControls() const
+ {
+ return 1;
+ }
+
+// ---------------------------------------------------------
+// CTestAppContainer::AppendData
+// ---------------------------------------------------------
+//
+void CTestAppContainer::AppendDataL( TDesC& buf )
+ {
+ iItems->AppendL( buf );
+ iListBox->HandleItemAdditionL();
+ TInt focus = iItems->Count()-1;
+ if ( focus < 0 )
+ focus=0;
+ iListBox->SetCurrentItemIndexAndDraw( focus );
+ }
+
+// ---------------------------------------------------------
+// CTestAppContainer::ComponentControl(TInt aIndex) const
+// ---------------------------------------------------------
+//
+CCoeControl* CTestAppContainer::ComponentControl(TInt aIndex) const
+ {
+ switch ( aIndex )
+ {
+ case 0:
+ return iListBox;
+ default:
+ return NULL;
+ }
+ }
+
+// ---------------------------------------------------------
+// CTestAppContainer::Draw(const TRect& aRect) const
+// ---------------------------------------------------------
+//
+void CTestAppContainer::Draw(const TRect& /*aRect*/) const
+ {
+ CWindowGc& gc = SystemGc();
+
+ AknsDrawUtils::Background( iSkinInstance,
+ iBackgroundSkinContext, this, gc, Rect() );
+ }
+
+// ---------------------------------------------------------
+// CTestAppContainer::HandleControlEventL(
+// CCoeControl* aControl,TCoeEvent aEventType)
+// ---------------------------------------------------------
+//
+void CTestAppContainer::HandleControlEventL(
+ CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
+ {
+ }
+
+// End of File