omads/omadsextensions/adapters/sms/inc/snapshotitem.h
changeset 40 b63e67867dcd
equal deleted inserted replaced
39:9905f7d46607 40:b63e67867dcd
       
     1 /*
       
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Private snapshot item header
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __SNAPSHOTITEM_H__
       
    20 #define __SNAPSHOTITEM_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <msvids.h>
       
    24 #include <nsmlsnapshotitem.h>
       
    25 #include "smsdataproviderdefs.h"
       
    26 
       
    27 typedef TBuf<KMaxFolderNameLength> TFolderName;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 * @brief TSnapshotItem
       
    33 * This class represents a single item in the ChangeFinder snapshot.
       
    34 * It's derived from the generic snapshot item and extended
       
    35 * to contain the read/unread information, which is mandatory when 
       
    36 * partial update of the messages is required.
       
    37 */
       
    38 
       
    39 class TSnapshotItem : public TNSmlSnapshotItem
       
    40 	{ 
       
    41 public:
       
    42 	
       
    43 	/**
       
    44     * Constructor
       
    45     */
       
    46 	TSnapshotItem();
       
    47 
       
    48 	/**
       
    49     * Constructor
       
    50     * 
       
    51     * @param aItemId   IN: id of the item.
       
    52     * @param aParent   IN: parent item, 0 as default.
       
    53     * @param aUnread   IN: read/unread information, the default is read.
       
    54     */
       
    55 	TSnapshotItem( const TSmlDbItemUid& aItemId, const TSmlDbItemUid& aParent = 0, TBool aUnread = EFalse );
       
    56 	
       
    57 	/**
       
    58     * Writes the item to a stream.
       
    59     * 
       
    60     * @param aStream   IN: a reference to a stream, where this item is to be written.
       
    61     */
       
    62 	void ExternalizeL( RWriteStream& aStream ) const;
       
    63 
       
    64 	/**
       
    65     * Reads item from a stream.
       
    66     * 
       
    67     * @param aStream   IN: a reference to a stream, where this item is read from.
       
    68     */
       
    69 	void InternalizeL( RReadStream& aStream );	
       
    70 	
       
    71 	/**
       
    72     * Sets the read flag
       
    73     * 
       
    74     * @param aState   IN: a new state.
       
    75     */
       
    76 	void SetUnread( TBool aState ); 
       
    77 	
       
    78 	/**
       
    79     * Sets the read flag
       
    80     * 
       
    81     * @return TBool, ETrue if the item is not read and EFalse if it has been read.
       
    82     */
       
    83 	TBool Unread() const;	
       
    84 	
       
    85 	void SetFolderNameL( const TDesC& aFolderName );
       
    86 	
       
    87 	const TDesC& FolderName() const;
       
    88 	
       
    89 private:
       
    90 
       
    91     /**
       
    92     * Read / Unread information
       
    93     */
       
    94 	TBool       iUnread;
       
    95 	
       
    96 	TFolderName iFolderName;
       
    97     };
       
    98 
       
    99 #endif