connectivitymodules/SeCon/servers/syncserver/inc/sconsyncrelationship.h
branchRCL_3
changeset 18 453dfc402455
equal deleted inserted replaced
17:dbd1c5e08735 18:453dfc402455
       
     1 /*
       
     2 * Copyright (c) 2009 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:  CSconSyncRelationship header
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SCONSYNCRELATIONSHIP_H_
       
    20 #define SCONSYNCRELATIONSHIP_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h> 
       
    24 #include <s32file.h>
       
    25 #include <syncml/smldatasyncdefs.h>
       
    26 #include <syncmldef.h>
       
    27 
       
    28 class CDictionaryFileStore;
       
    29 
       
    30 NONSHARABLE_CLASS ( CSconSyncRelationship ) : public CBase, public MSmlSyncRelationship
       
    31     {
       
    32 public:
       
    33     /**
       
    34      * Creates CSconSyncRelationship object.
       
    35      * @param   aFs             reference to open RFs connection
       
    36      * @param   aRelationUid    uniqueID for each server-client pair
       
    37      * @return new CSconSyncRelationship object
       
    38      */
       
    39     static CSconSyncRelationship* NewL( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aProviderId );
       
    40 	~CSconSyncRelationship();
       
    41 	
       
    42 	static void SetTimeStampL( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aId );
       
    43 	static void GetTimeStampL( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aId, TDateTime& aTimeStamp );
       
    44 	
       
    45 public: // From MSmlSyncRelationship
       
    46     
       
    47 	/**
       
    48      * Returns the unique identifier for the synchronisation relationship.
       
    49      *
       
    50      * @return             A unique identifier for the sync relationship.
       
    51      */
       
    52     TSmlSyncTaskKey SyncTaskKey() const;
       
    53     
       
    54     /**
       
    55      * Opens a specified stream for reading, and places an item on the cleanup stack to close it.
       
    56      *
       
    57      * @param               aReadStream    On return, an open read stream
       
    58      * @param               aStreamUid     The UID of the stream to open for reading.
       
    59      */
       
    60     void OpenReadStreamLC(RReadStream& aReadStream, TUid aStreamUid);
       
    61     
       
    62     /**
       
    63      * Opens the specified stream, or creates a new one if it does not exist, and places an item on the cleanup stack to close it.
       
    64      *
       
    65      * @param              aWriteStream    On return, an open write stream
       
    66      * @param              aStreamUid      The UID of the stream to open or create
       
    67      */
       
    68     void OpenWriteStreamLC(RWriteStream& aWriteStream, TUid aStreamUid);
       
    69     
       
    70     /**
       
    71      * Tests if the specified stream identified exists in the store.
       
    72      *
       
    73      * @param              aStreamUid The stream UID
       
    74      * @return             Non-zero if the stream exists, otherwise EFalse.
       
    75      */
       
    76     TBool IsStreamPresentL(TUid aStreamUid) const;
       
    77     
       
    78 private:
       
    79 	CSconSyncRelationship( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aProviderId );
       
    80 	void ConstructL();
       
    81 	
       
    82 private:
       
    83     
       
    84 	CDictionaryFileStore* iDictionaryStore;
       
    85 	RFs&   iFs;
       
    86 	TUid   iID;
       
    87 	TSmlDataProviderId iProviderId;
       
    88     };
       
    89 
       
    90 #endif /*SCONSYNCRELATIONSHIP_H_*/