CPbkViewState Class Reference

API published in: S60 1st Ed
API deprecated in: S60 5th Ed

Link against: pbkview.lib

Capability Information

Required Capabilities

None


#include <
cpbkviewstate.h>

Detailed Description

Generic Phonebook view state class.

Class can be used to pass parameters the Phonebook application when launching the application with the symbian view launching mechanism.


Public Types

enum  TDataType {
  EEnd = 0, EFocusedContactId, ETopContactId, EMarkedContactIds,
  EFocusedFieldIndex, ETopFieldIndex, EFieldDataArray, EParentContactId,
  EFlags
}
enum  TFlags {
  ENullFlags = 0, EFocusFirst = 0x0001, EFocusLast = 0x0002, EInitialized = 0x0004,
  ESendToBackground = 0x0008
}

Public Member Functions

 ~CPbkViewState ()
 Destructor.
IMPORT_C TContactItemId FocusedContactId () const
 Returns id of the focused contact.
IMPORT_C TContactItemId TopContactId () const
 Returns id of the topmost contact.
IMPORT_C const CContactIdArray * MarkedContactIds () const
 Returns const array of marked contacts ids, NULL if not set.
IMPORT_C CContactIdArray * MarkedContactIds ()
 Returns array of marked contacts ids, NULL if not set.
IMPORT_C TInt FocusedFieldIndex () const
 Returns index of the focused field (field is from FocusedContactId()), -1 when no field focused.
IMPORT_C TInt TopFieldIndex () const
 Returns index of the topmost field (field is from FocusedContactId()), -1 when no topmost field.
IMPORT_C CPbkFieldDataArray * FieldDataArray () const
 Returns field data array, NULL if not set.
IMPORT_C TContactItemId ParentContactId () const
 Returns the focused contact id's parent, KNullContactId if not set.
IMPORT_C TUint Flags () const
 Returns the view state flags.
IMPORT_C void SetFocusedContactId (TContactItemId aId)
 Sets id of the focused contact to aId.
IMPORT_C void SetTopContactId (TContactItemId aId)
 Sets id of the topmost contact to aId.
IMPORT_C void SetMarkedContactIds (CContactIdArray *aArray)
 Sets the array of marked contact ids to aArray.
IMPORT_C void SetFocusedFieldIndex (TInt aIndex)
 Sets index of the focused field to aIndex (field from FocusedContactId()), -1 when no field focused.
IMPORT_C void SetTopFieldIndex (TInt aIndex)
 Sets index of the topmost field to aIndex (field from FocusedContactId()), -1 when no topmost field.
IMPORT_C void SetFieldDataArray (CPbkFieldDataArray *aFieldDataArray)
 Sets field data array to aArray.
IMPORT_C void Reset ()
 Reset this state to empty.
IMPORT_C void SetParentContactId (TContactItemId aParentContactId)
 Sets the focused contact ids parent contact id.
IMPORT_C void SetFlags (TUint aFlags)
 Sets the view state flags.
void MergeViewState (CPbkViewState &aOtherState)
 Merges another view state to this view state by setting values from the parameter and overriding any previous values in this state.
IMPORT_C HBufC8 * PackL () const
 Packages and returns this object in a buffer.
IMPORT_C HBufC8 * PackLC () const
 Like PackL, but leaves the buffer on the cleanup stack.
IMPORT_C void UnpackL (const TDesC8 &aPack)
 Sets this state from aPack previously created with PackL.
IMPORT_C void ExternalizeL (RWriteStream &aStream) const
 Externalizes this object to aStream.
IMPORT_C void InternalizeL (RReadStream &aStream)
 Internalizes this object from aStream.
IMPORT_C TBool operator== (const CPbkViewState &aRhs) const

Static Public Member Functions

static IMPORT_C CPbkViewStateNewL ()
 Creates and returns a new instance of this class.
static IMPORT_C CPbkViewStateNewLC ()
 Like NewL(), but leaves the object on the cleanup stack.
static IMPORT_C CPbkViewStateNewL (RReadStream &aStream)
 Creates and returns a new instance of this class initialized from aStream.
static IMPORT_C CPbkViewStateNewLC (RReadStream &aStream)
 Like NewL(RReadStream& aStream) but leaves the object on the cleanup stack.
static IMPORT_C CPbkViewStateNewL (const TDesC8 &aBuf)
 Creates and returns a new instance of this class initialized from aBuf.
static IMPORT_C CPbkViewStateNewLC (const TDesC8 &aBuf)
 Like NewL(const TDesC8& aBuf) but leaves the object on the cleanup stack.
static IMPORT_C TUid Uid ()
 Returns the message uid for use with view server messages.

Member Enumeration Documentation

enum CPbkViewState::TDataType
 
Enumerator:
EEnd 
EFocusedContactId 
ETopContactId 
EMarkedContactIds 
EFocusedFieldIndex 
ETopFieldIndex 
EFieldDataArray 
EParentContactId 
EFlags 
enum CPbkViewState::TFlags
 
Enumerator:
ENullFlags  Reset flags.
EFocusFirst  Focus the first item in list views.
EFocusLast  Focus the last item in list views.
EInitialized  Reset state to the view's initial state.
ESendToBackground  Send application to background.

Constructor & Destructor Documentation

CPbkViewState::~CPbkViewState  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CPbkViewState::ExternalizeL RWriteStream &  aStream  )  const
 

Externalizes this object to aStream.

See also:
InternalizeL
Parameters:
aSteam Stream where to externalize this objects state.
IMPORT_C CPbkFieldDataArray* CPbkViewState::FieldDataArray  )  const
 

Returns field data array, NULL if not set.

Returns:
Field data array object, NULL if not set.
IMPORT_C TUint CPbkViewState::Flags  )  const
 

Returns the view state flags.

See CPbkViewState::TFlags.

Returns:
View state object flags
IMPORT_C TContactItemId CPbkViewState::FocusedContactId  )  const
 

Returns id of the focused contact.

Returns:
Contact item id of the focused contact, KNullContactId if not set.
IMPORT_C TInt CPbkViewState::FocusedFieldIndex  )  const
 

Returns index of the focused field (field is from FocusedContactId()), -1 when no field focused.

Returns:
Index of the focused field, -1 if no field is focused.
IMPORT_C void CPbkViewState::InternalizeL RReadStream &  aStream  ) 
 

Internalizes this object from aStream.

See also:
ExternalizeL
Parameters:
aStream A stream from where this objects state can be internalized from.
IMPORT_C CContactIdArray* CPbkViewState::MarkedContactIds  ) 
 

Returns array of marked contacts ids, NULL if not set.

Owmership not transferred.

Returns:
Contact id array of the marked contacts, NULL if not set.
IMPORT_C const CContactIdArray* CPbkViewState::MarkedContactIds  )  const
 

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

Returns:
Contact id array of the marked contacts, NULL if not set.
void CPbkViewState::MergeViewState CPbkViewState aOtherState  ) 
 

Merges another view state to this view state by setting values from the parameter and overriding any previous values in this state.

Parameters:
aOtherState The state to merge to this state. The properties which have a value in aOtherState override properties in this object. The aOtherState object may be modified by this function.
static IMPORT_C CPbkViewState* CPbkViewState::NewL const TDesC8 &  aBuf  )  [static]
 

Creates and returns a new instance of this class initialized from aBuf.

Parameters:
aBuf A view state buffer to internalize.
static IMPORT_C CPbkViewState* CPbkViewState::NewL RReadStream &  aStream  )  [static]
 

Creates and returns a new instance of this class initialized from aStream.

Parameters:
aStream A view state stream to internalize.
static IMPORT_C CPbkViewState* CPbkViewState::NewL  )  [static]
 

Creates and returns a new instance of this class.

static IMPORT_C CPbkViewState* CPbkViewState::NewLC const TDesC8 &  aBuf  )  [static]
 

Like NewL(const TDesC8& aBuf) but leaves the object on the cleanup stack.

See also:
NewL(const TDesC8& aBuf)
Parameters:
aBuf A view state buffer to internalize.
static IMPORT_C CPbkViewState* CPbkViewState::NewLC RReadStream &  aStream  )  [static]
 

Like NewL(RReadStream& aStream) but leaves the object on the cleanup stack.

See also:
NewL(RReadStream& aStream)
Parameters:
aStream A view state stream to internalize.
static IMPORT_C CPbkViewState* CPbkViewState::NewLC  )  [static]
 

Like NewL(), but leaves the object on the cleanup stack.

See also:
NewL
IMPORT_C TBool CPbkViewState::operator== const CPbkViewState aRhs  )  const
 
IMPORT_C HBufC8* CPbkViewState::PackL  )  const
 

Packages and returns this object in a buffer.

Caller is responsible of deleting the buffer.

Returns:
Packaged state in a buffer.
IMPORT_C HBufC8* CPbkViewState::PackLC  )  const
 

Like PackL, but leaves the buffer on the cleanup stack.

See also:
PackL
Returns:
Packaged state in a buffer.
IMPORT_C TContactItemId CPbkViewState::ParentContactId  )  const
 

Returns the focused contact id's parent, KNullContactId if not set.

Returns:
Focused contact id's parent, KNullContactId if not set.
IMPORT_C void CPbkViewState::Reset  ) 
 

Reset this state to empty.

IMPORT_C void CPbkViewState::SetFieldDataArray CPbkFieldDataArray *  aFieldDataArray  ) 
 

Sets field data array to aArray.

Destroys previous array and takes ownership of aArray.

Parameters:
aFieldDataArray Sets the field data array.
IMPORT_C void CPbkViewState::SetFlags TUint  aFlags  ) 
 

Sets the view state flags.

Parameters:
aFlags Sets the view state parameters. See CPbkViewState::TFlags.
IMPORT_C void CPbkViewState::SetFocusedContactId TContactItemId  aId  ) 
 

Sets id of the focused contact to aId.

Parameters:
aId Sets the focused contact id.
IMPORT_C void CPbkViewState::SetFocusedFieldIndex TInt  aIndex  ) 
 

Sets index of the focused field to aIndex (field from FocusedContactId()), -1 when no field focused.

Parameters:
aIndex Sets focused field index.
IMPORT_C void CPbkViewState::SetMarkedContactIds CContactIdArray *  aArray  ) 
 

Sets the array of marked contact ids to aArray.

Destroys previous array and takes ownership of aArray.

Parameters:
aArray Sets the marked contact ids.
IMPORT_C void CPbkViewState::SetParentContactId TContactItemId  aParentContactId  ) 
 

Sets the focused contact ids parent contact id.

Parameters:
aParentContactId Sets the contact ids parent id.
IMPORT_C void CPbkViewState::SetTopContactId TContactItemId  aId  ) 
 

Sets id of the topmost contact to aId.

Parameters:
aId Sets the topmost contact id.
IMPORT_C void CPbkViewState::SetTopFieldIndex TInt  aIndex  ) 
 

Sets index of the topmost field to aIndex (field from FocusedContactId()), -1 when no topmost field.

Parameters:
aIndex Sets the topmost field index.
IMPORT_C TContactItemId CPbkViewState::TopContactId  )  const
 

Returns id of the topmost contact.

Returns:
Contact item id of the top contact, KNullContactId if not set.
IMPORT_C TInt CPbkViewState::TopFieldIndex  )  const
 

Returns index of the topmost field (field is from FocusedContactId()), -1 when no topmost field.

Returns:
Index of the topmost field, -1 if no topmost field.
static IMPORT_C TUid CPbkViewState::Uid  )  [static]
 

Returns the message uid for use with view server messages.

IMPORT_C void CPbkViewState::UnpackL const TDesC8 &  aPack  ) 
 

Sets this state from aPack previously created with PackL.

See also:
PackL

PackLC

Parameters:
aPack Previously packaged state.

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

Copyright © Nokia Corporation 2001-2008
Back to top