cmmanager/cmmgr/cmmserver/inc/cmmdestinationstruct.h
changeset 46 95d45f234cf3
parent 23 7ec726f93df1
child 44 a0c4ceac30d0
--- a/cmmanager/cmmgr/cmmserver/inc/cmmdestinationstruct.h	Thu May 27 13:17:01 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/inc/cmmdestinationstruct.h	Wed Jun 23 18:39:24 2010 +0300
@@ -46,22 +46,22 @@
     static CCmmDestinationStruct* NewL(
             CCmmCache* aCache,
             CCmmTransactionHandler* aTransactionHandler,
-            const TUint32& aId );
+            const TUint32 aId );
     static CCmmDestinationStruct* NewL(
             CCmmCache* aCache,
             CCmmTransactionHandler* aTransactionHandler,
             const TDesC& aName,
-            const TUint32& aId );
+            const TUint32 aId );
 
     static CCmmDestinationStruct* NewLC(
             CCmmCache* aCache,
             CCmmTransactionHandler* aTransactionHandler,
-            const TUint32& aId );
+            const TUint32 aId );
     static CCmmDestinationStruct* NewLC(
             CCmmCache* aCache,
             CCmmTransactionHandler* aTransactionHandler,
             const TDesC& aName,
-            const TUint32& aId );
+            const TUint32 aId );
 
     virtual ~CCmmDestinationStruct();
 
@@ -69,13 +69,13 @@
     CCmmDestinationStruct( CCmmCache* aCache, CCmmTransactionHandler* aTransactionHandler );
 
     // Opens an existing destination, based on ID.
-    void ConstructL( const TUint32& aDestinationId );
+    void ConstructL( const TUint32 aDestinationId );
 
     // Creates a new destination. With name and optionally also with ID.
-    void ConstructL( const TDesC& aName, const TUint32& aId );
+    void ConstructL( const TDesC& aName, const TUint32 aId );
 
 public:
-    void SetId( const TUint32& aId );
+    void SetId( const TUint32 aId );
     TUint32 GetId() const;
 
     /**
@@ -101,18 +101,51 @@
      */
     void SetStatusForAllRecords( const TCmmRecordStatus& aStatus );
 
-    void CreateSessionInstanceL( //TODO, rename to CreateDestinationInstanceL ?
+
+    /**
+     * Copies the data for this destination to a session instance and
+     * increments the reference counter by one.
+     */
+    void CreateDestinationInstanceL(
             CCmmDestinationInstance& aDestinationInstance );
+
+    /**
+     * Refresh the data contained in aDestinationInstance. This means reloading
+     * the data from database if necessary. After this call the contents of
+     * aDestinationInstance will reflect the current state in the database. 
+     */
     void RefreshDestinationInstanceL(
             CCmmDestinationInstance& aDestinationInstance );
+
+    /**
+     * Re-loads a destination record if needed and copies the latest version to
+     * the session instance given as parameter.
+     */
     void LoadRecordL(
             CCmmDestinationInstance& aDestinationInstance,
             TCmmDbRecords aRecordType );
+
+    /**
+     * Save the contents of a session side destination handle into database.
+     */
     void UpdateL(
             CCmmDestinationInstance& aDestinationInstance,
             CCmmCache* aCache );
+
+    /**
+     * Delete all database records of this destination. Also removes any
+     * records making this destination an embedded destination in another
+     * destination.
+     */
     void DeleteL();
-    TInt SessionInstanceClosed(); //TODO, rename to DestinationInstanceClosed ?
+
+    /**
+     * 
+     * This should be called when a client session closes a destination handle.
+     * Reference counter is decremented by one and the remaining number of
+     * references is returned.
+     */
+    TInt DestinationInstanceClosed();
 
     /**
      * Called after this destination has been updated and database transaction
@@ -128,6 +161,15 @@
     void SetDefaultCprL();
     void SetDefaultSCprL();
     void SetDefaultProtocolL();
+
+    /**
+     * Set attribute flag on the given record.
+     * @param aRecord Record to be set.
+     * @param aAttribute Attribute to be set.
+     * @param aSet ETrue to set, EFalse to clear.
+     */
+    void SetAttribute( CommsDat::CCDRecordBase* aRecord, TUint32 aAttribute, TBool aSet );
+
     CommsDat::CCDRecordBase* CopyRecordL(
             TCmmDbRecords aRecordType,
             CommsDat::CCDRecordBase* aSource );