CPbk2ViewState Class Reference

class CPbk2ViewState : public CBase

Phonebook 2 view state.

Responsible for storing the state of a Phonebook 2 view. The state includes, for example, focused contact, focused contact field and other information for restoring the state later. This state object can be externalized to a buffer and initialized from a buffer.

Inherits from

Public Member Functions
~CPbk2ViewState ()
IMPORT_C TUint Flags ()
IMPORT_C const MVPbkContactLink * FocusedContact ()
IMPORT_C TInt FocusedFieldIndex ()
IMPORT_C TInt FocusedPropertiesIndex ()
IMPORT_C const MVPbkContactLinkArray * MarkedContacts ()
IMPORT_C CPbk2ViewState * NewL ()
IMPORT_C CPbk2ViewState * NewL (const TDesC8 &)
IMPORT_C CPbk2ViewState * NewLC ()
IMPORT_C CPbk2ViewState * NewLC (const TDesC8 &)
IMPORT_C HBufC8 * PackL ()
IMPORT_C HBufC8 * PackLC ()
IMPORT_C const MVPbkContactLink * ParentContact ()
IMPORT_C void Reset ()
IMPORT_C void SetFlags ( TUint )
IMPORT_C void SetFocusedContact ( MVPbkContactLink *)
IMPORT_C void SetFocusedFieldIndex ( TInt )
IMPORT_C void SetFocusedPropertiesIndex ( TInt )
IMPORT_C void SetMarkedContacts ( MVPbkContactLinkArray *)
IMPORT_C void SetParentContact ( MVPbkContactLink *)
IMPORT_C void SetTopContact ( MVPbkContactLink *)
IMPORT_C void SetTopFieldIndex ( TInt )
IMPORT_C void SetTopPropertiesIndex ( TInt )
IMPORT_C MVPbkContactLink * TakeFocusedContact ()
IMPORT_C MVPbkContactLinkArray * TakeMarkedContacts ()
IMPORT_C MVPbkContactLink * TakeParentContact ()
IMPORT_C MVPbkContactLink * TakeTopContact ()
IMPORT_C const MVPbkContactLink * TopContact ()
IMPORT_C TInt TopFieldIndex ()
IMPORT_C TInt TopPropertiesIndex ()
IMPORT_C TUid Uid ()
IMPORT_C void UnpackL (const TDesC8 &)
IMPORT_C TBool operator== (const CPbk2ViewState &)
Private Member Functions
CPbk2ViewState ()
void ConstructL (const TDesC8 &)
void ExternalizeL ( RWriteStream &)
void InternalizeL ( RReadStream &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TDataType {
EEnd  = 0, EFocusedContact , ETopContact , EMarkedContacts , EFocusedFieldIndex , ETopFieldIndex , EParentContact , EFlags , EFocusedPropertiesIndex , ETopPropertiesIndex
}
enum TFlags { ENullFlags  = 0, EFocusFirst  = 0x0001, EFocusLast  = 0x0002, EInitialized  = 0x0004, ESendToBackground  = 0x0008 }
Private Attributes
const TUid KUid
MVPbkContactLinkArray * iArray
TUint iFlags
MVPbkContactLink * iFocusedContact
TInt iFocusedFieldIndex
TInt iFocusedPropertiesIndex
MVPbkContactLink * iParentContact
MVPbkContactLink * iTopContact
TInt iTopFieldIndex
TInt iTopPropertiesIndex

Constructor & Destructor Documentation

CPbk2ViewState()

CPbk2ViewState ( ) [private]

~CPbk2ViewState()

~CPbk2ViewState ( )

Destructor.

Member Functions Documentation

ConstructL(const TDesC8 &)

void ConstructL ( const TDesC8 & aBuf ) [private, inline]

Parameters

const TDesC8 & aBuf

ExternalizeL(RWriteStream &)

void ExternalizeL ( RWriteStream & aStream ) const [private]

Parameters

RWriteStream & aStream

Flags()

IMPORT_C TUint Flags ( ) const

Returns the view state flags.

FocusedContact()

IMPORT_C const MVPbkContactLink * FocusedContact ( ) const

Returns a link to the focused contact. Null if not set.

FocusedFieldIndex()

IMPORT_C TInt FocusedFieldIndex ( ) const

Returns the index of the focused field. KErrNotFound indicates there is no focused field information available.

FocusedPropertiesIndex()

IMPORT_C TInt FocusedPropertiesIndex ( ) const

Returns the index of the focused properties item. KErrNotFound indicates there is no focused properties item information available.

InternalizeL(RReadStream &)

void InternalizeL ( RReadStream & aStream ) [private]

Parameters

RReadStream & aStream

MarkedContacts()

IMPORT_C const MVPbkContactLinkArray * MarkedContacts ( ) const

Returns const array of marked contacts. NULL if not set.

NewL()

IMPORT_C CPbk2ViewState * NewL ( ) [static]

Creates a new instace of this class.

NewL(const TDesC8 &)

IMPORT_C CPbk2ViewState * NewL ( const TDesC8 & aBuf ) [static]

Creates a new instace of this class initialized from a buffer. CPbk2ViewState::PackL and CPbk2ViewState::PackLC for constructing the buffer.

Parameters

const TDesC8 & aBuf Buffer to initialize this instance from.

NewLC()

IMPORT_C CPbk2ViewState * NewLC ( ) [static]

Creates a new instace of this class.

NewLC(const TDesC8 &)

IMPORT_C CPbk2ViewState * NewLC ( const TDesC8 & aBuf ) [static]

Creates a new instace of this class initialized from a buffer. CPbk2ViewState::PackL and CPbk2ViewState::PackLC for constructing the buffer.

Parameters

const TDesC8 & aBuf Buffer to initialize this instance from.

PackL()

IMPORT_C HBufC8 * PackL ( ) const

Packages and returns this object in a buffer. Caller is responsible for deleting the buffer.

PackLC()

IMPORT_C HBufC8 * PackLC ( ) const

Packages and returns this object in a buffer. Caller is responsible for deleting the buffer.

ParentContact()

IMPORT_C const MVPbkContactLink * ParentContact ( ) const

Returns a link to the parent contact.

Reset()

IMPORT_C void Reset ( )

Reset this view state to an empty state.

SetFlags(TUint)

IMPORT_C void SetFlags ( TUint aFlags )

Sets the view state flags.

Parameters

TUint aFlags The flags to set.

SetFocusedContact(MVPbkContactLink *)

IMPORT_C void SetFocusedContact ( MVPbkContactLink * aContact )

Sets focused contact to given contact.

Parameters

MVPbkContactLink * aContact The contact to set.

SetFocusedFieldIndex(TInt)

IMPORT_C void SetFocusedFieldIndex ( TInt aIndex )

Sets the index of the focused field to the given index. KErrNotFound indicates there is no focused field information available.

Parameters

TInt aIndex The index to set.

SetFocusedPropertiesIndex(TInt)

IMPORT_C void SetFocusedPropertiesIndex ( TInt aIndex )

Sets the index of the focused properties item to the given index. KErrNotFound indicates there is no focused properties item information available.

Parameters

TInt aIndex The index to set.

SetMarkedContacts(MVPbkContactLinkArray *)

IMPORT_C void SetMarkedContacts ( MVPbkContactLinkArray * aArray )

Sets marked contacts according to given array of contact links.

Parameters

MVPbkContactLinkArray * aArray The contacts to set marked.

SetParentContact(MVPbkContactLink *)

IMPORT_C void SetParentContact ( MVPbkContactLink * aParentContact )

Sets parent contact to given contact.

Parameters

MVPbkContactLink * aParentContact The contact to set.

SetTopContact(MVPbkContactLink *)

IMPORT_C void SetTopContact ( MVPbkContactLink * aTopContact )

Sets top contact to given contact.

Parameters

MVPbkContactLink * aTopContact The contact to set.

SetTopFieldIndex(TInt)

IMPORT_C void SetTopFieldIndex ( TInt aIndex )

Sets the index of the topmost field to the given index. KErrNotFound indicates there is no topmost field information available.

Parameters

TInt aIndex The index to set.

SetTopPropertiesIndex(TInt)

IMPORT_C void SetTopPropertiesIndex ( TInt aIndex )

Sets the index of the topmost properties item to the given index. KErrNotFound indicates there is no topmost properties item information available.

Parameters

TInt aIndex The index to set.

TakeFocusedContact()

IMPORT_C MVPbkContactLink * TakeFocusedContact ( )

Returns a link to the focused contact. Null if not set. Ownership is transferred to the caller.

TakeMarkedContacts()

IMPORT_C MVPbkContactLinkArray * TakeMarkedContacts ( )

Returns const array of marked contacts. NULL if not set. Ownership is transferred to caller.

TakeParentContact()

IMPORT_C MVPbkContactLink * TakeParentContact ( )

Returns a link to the parent contact. Null if not set. Ownership is transferred to caller.

TakeTopContact()

IMPORT_C MVPbkContactLink * TakeTopContact ( )

Returns a link to the topmost contact. Null if not set. Ownership is transferred to caller.

TopContact()

IMPORT_C const MVPbkContactLink * TopContact ( ) const

Returns a link to the the topmost contact. Null if not set.

TopFieldIndex()

IMPORT_C TInt TopFieldIndex ( ) const

Returns the index of the top field. KErrNotFound indicates there is no focused field information available.

TopPropertiesIndex()

IMPORT_C TInt TopPropertiesIndex ( ) const

Returns the index of the top properties item. KErrNotFound indicates there is no focused properties item information available.

Uid()

IMPORT_C TUid Uid ( ) [static]

Returns the message uid for use with view server messages.

UnpackL(const TDesC8 &)

IMPORT_C void UnpackL ( const TDesC8 & aPack )

Sets this view state from given packaged buffer.

Parameters

const TDesC8 & aPack Packaged view state buffer.

operator==(const CPbk2ViewState &)

IMPORT_C TBool operator== ( const CPbk2ViewState & aRhs ) const

Comparison operator.

Parameters

const CPbk2ViewState & aRhs View state instance to compare to this instance.

Member Enumerations Documentation

Enum TDataType

Enumerators

EEnd = 0
EFocusedContact
ETopContact
EMarkedContacts
EFocusedFieldIndex
ETopFieldIndex
EParentContact
EFlags
EFocusedPropertiesIndex
ETopPropertiesIndex

Enum TFlags

Enumerators

ENullFlags = 0
EFocusFirst = 0x0001
EFocusLast = 0x0002
EInitialized = 0x0004
ESendToBackground = 0x0008

Member Data Documentation

const TUid KUid

const TUid KUid [private, static]

MVPbkContactLinkArray * iArray

MVPbkContactLinkArray * iArray [private]

TUint iFlags

TUint iFlags [private]

MVPbkContactLink * iFocusedContact

MVPbkContactLink * iFocusedContact [private]

TInt iFocusedFieldIndex

TInt iFocusedFieldIndex [private]

TInt iFocusedPropertiesIndex

TInt iFocusedPropertiesIndex [private]

MVPbkContactLink * iParentContact

MVPbkContactLink * iParentContact [private]

MVPbkContactLink * iTopContact

MVPbkContactLink * iTopContact [private]

TInt iTopFieldIndex

TInt iTopFieldIndex [private]

TInt iTopPropertiesIndex

TInt iTopPropertiesIndex [private]