Example Application Guide

 

CGeoProfilesLBModel Class Reference

#include <geoprofileslbmodel.h>

Inheritance diagram for CGeoProfilesLBModel:

List of all members.

Detailed Description

List box model for Geo Profiles Application

This class provides the implementation of the list-box model for Geo Profiles lists.

Definition at line 35 of file geoprofileslbmodel.h.

Public Member Functions

virtual ~CGeoProfilesLBModel ()
void UpdateModel (RPointerArray< CGeoProfile > *aGeoProfiles)
virtual TInt MdcaCount () const
virtual TPtrC16 MdcaPoint (TInt aIndex) const

Static Public Member Functions

static CGeoProfilesLBModelNewL (RPointerArray< CGeoProfile > *aGeoProfiles)

Private Member Functions

 CGeoProfilesLBModel (RPointerArray< CGeoProfile > *aGeoProfiles)
void ConstructL ()

Private Attributes

HBufC16 * iBuffer
RPointerArray< CGeoProfile > * iGeoProfiles


Constructor & Destructor Documentation

CGeoProfilesLBModel::~CGeoProfilesLBModel  )  [virtual]
 

C++ Destructor. Frees all the resources

Definition at line 42 of file geoprofileslbmodel.cpp.

References iBuffer.

00043     {
00044     // Delete the Conversion buffer
00045     delete iBuffer;   
00046     }

CGeoProfilesLBModel::CGeoProfilesLBModel RPointerArray< CGeoProfile > *  aGeoProfiles  )  [private]
 

Overloaded constructor

Definition at line 32 of file geoprofileslbmodel.cpp.

Referenced by NewL().

00034     :iGeoProfiles( aGeoProfiles )
00035     {    
00036     }


Member Function Documentation

CGeoProfilesLBModel * CGeoProfilesLBModel::NewL RPointerArray< CGeoProfile > *  aGeoProfiles  )  [static]
 

Constructs a new instance of Geo Profiles list box model.

Definition at line 52 of file geoprofileslbmodel.cpp.

References CGeoProfilesLBModel().

Referenced by CGeoProfilesView::ConstructL().

00054     {
00055     CGeoProfilesLBModel* self = new ( ELeave ) CGeoProfilesLBModel( aGeoProfiles );
00056     CleanupStack::PushL( self );
00057     self->ConstructL();
00058     CleanupStack::Pop( self );
00059     return self;
00060     }

void CGeoProfilesLBModel::UpdateModel RPointerArray< CGeoProfile > *  aGeoProfiles  ) 
 

Updates the Geo Profiles model

Definition at line 76 of file geoprofileslbmodel.cpp.

References iGeoProfiles.

Referenced by CGeoProfilesView::ProfileStatusChangedL().

00078     {
00079     iGeoProfiles = aGeoProfiles;
00080     }

TInt CGeoProfilesLBModel::MdcaCount  )  const [virtual]
 

Inherited from MDesCArray

Definition at line 86 of file geoprofileslbmodel.cpp.

References iGeoProfiles.

00087     {
00088     return iGeoProfiles->Count();       
00089     }

TPtrC16 CGeoProfilesLBModel::MdcaPoint TInt  aIndex  )  const [virtual]
 

Inherited from MDesCArray

Definition at line 95 of file geoprofileslbmodel.cpp.

References iBuffer, and iGeoProfiles.

00096     {
00097     // Create formatted item string.
00098     // list item string format: // Format "\t%S\t\t%S"
00099         TPtr16  buf( iBuffer->Des());
00100         buf.Zero();
00101             
00102     if ( iGeoProfiles->Count() < aIndex )
00103         {
00104         return buf;
00105         }
00106        
00107     // Pack the contents into the Buffer. We dont have to re-allocate the buffer
00108     // everytime. Currently the string length is restricted to 256. 
00109     // 
00110     // !!! Could be a potential problem !!!!!
00111                     
00112     // Tabulator Defintion
00113     _LIT( KTab, "\t" );
00114     
00115         // Append the Tab Key
00116         buf.Append( KTab );    
00117         
00118         // Append the Geo Profile Name
00119         buf.Append( (*iGeoProfiles)[ aIndex ]->GeoPlaceName());
00120         
00121         // Append the Tab Key
00122         buf.Append( KTab );
00123         
00124         // Append the Tab Key
00125         buf.Append( KTab );
00126                 
00127         // Append the Geo Profile Name
00128         buf.Append( (*iGeoProfiles)[ aIndex ]->ProfileName());
00129 
00130     return buf;
00131     
00132     }

void CGeoProfilesLBModel::ConstructL  )  [private]
 

Second phase of the two phase constructor

Definition at line 66 of file geoprofileslbmodel.cpp.

References iBuffer.

00067     {
00068     // Allocate the Conversion buffer
00069     iBuffer = HBufC::NewL( KGeoProfilesBufferSize );
00070     }


Member Data Documentation

HBufC16* CGeoProfilesLBModel::iBuffer [private]
 

Buffer for packing the MdcaPoint

Owns

Definition at line 84 of file geoprofileslbmodel.h.

Referenced by ConstructL(), MdcaPoint(), and ~CGeoProfilesLBModel().

RPointerArray<CGeoProfile>* CGeoProfilesLBModel::iGeoProfiles [private]
 

Profile Array

Definition at line 89 of file geoprofileslbmodel.h.

Referenced by MdcaCount(), MdcaPoint(), and UpdateModel().


The documentation for this class was generated from the following files:

© Nokia 2009

Back to top