remotestoragefw/remotefileengine/src/rsfwvolume.cpp
branchRCL_3
changeset 15 88ee4cf65e19
parent 12 87c71b25c937
child 16 1aa8c82cb4cb
equal deleted inserted replaced
12:87c71b25c937 15:88ee4cf65e19
     1 /*
       
     2 * Copyright (c) 2003-2006 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:  data structure for a volume
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "rsfwvolume.h"
       
    20 #include "rsfwvolumetable.h"
       
    21 #include "rsfwfiletable.h"
       
    22 #include "rsfwfileengine.h"
       
    23 
       
    24 // ----------------------------------------------------------------------------
       
    25 // CRsfwVolume::~CRsfwVolume
       
    26 // 
       
    27 // ----------------------------------------------------------------------------
       
    28 //
       
    29 CRsfwVolume::~CRsfwVolume()
       
    30     {
       
    31     delete iFileEngine;
       
    32     }
       
    33 
       
    34 // ----------------------------------------------------------------------------
       
    35 // CRsfwVolume::MountInfo
       
    36 // 
       
    37 // ----------------------------------------------------------------------------
       
    38 //
       
    39 TRsfwMountInfo* CRsfwVolume::MountInfo()
       
    40     {
       
    41     return &iMountInfo;
       
    42     }
       
    43 
       
    44 // ----------------------------------------------------------------------------
       
    45 // CRsfwVolume::GetMountInfo
       
    46 // 
       
    47 // ----------------------------------------------------------------------------
       
    48 //
       
    49 void CRsfwVolume::GetMountInfo(TRsfwMountInfo& aMountInfo)
       
    50     {
       
    51     aMountInfo = iMountInfo;
       
    52     aMountInfo.iMountStatus.iConnectionState = iFileEngine->ConnectionState();
       
    53     aMountInfo.iMountStatus.iCachedSize =
       
    54     iFileEngine->iFileTable->TotalCachedSize();
       
    55     }
       
    56 
       
    57 // ----------------------------------------------------------------------------
       
    58 // CRsfwVolume::OperationCompleted()
       
    59 // ----------------------------------------------------------------------------
       
    60 //
       
    61 void CRsfwVolume::OperationCompleted() 
       
    62     {
       
    63     iVolumeTable->OperationCompleted(this);
       
    64     }
       
    65 
       
    66 // ----------------------------------------------------------------------------
       
    67 // CRsfwVolume::ConnectionStateChanged
       
    68 // 
       
    69 // ----------------------------------------------------------------------------
       
    70 //
       
    71 void CRsfwVolume::ConnectionStateChanged(TInt aConnectionState)
       
    72     {
       
    73     // The mount state and connection state are tightly bound together
       
    74     switch (aConnectionState)
       
    75         {    
       
    76         case KMountNotConnected:
       
    77             iMountInfo.iMountStatus.iMountState = KMountStateDormant;
       
    78             iMountInfo.iMountStatus.iConnectionState = KMountNotConnected;
       
    79             break;
       
    80         case KMountStronglyConnected:
       
    81             iMountInfo.iMountStatus.iMountState = KMountStateMounted;
       
    82             iMountInfo.iMountStatus.iConnectionState = KMountStronglyConnected;
       
    83             break;
       
    84         case KMountConnecting:
       
    85             iMountInfo.iMountStatus.iMountState = KMountStateDormant;
       
    86             iMountInfo.iMountStatus.iConnectionState = KMountConnecting;
       
    87             break;
       
    88         default:
       
    89             break;
       
    90         }
       
    91     iVolumeTable->VolumeStateChanged(this);
       
    92     }
       
    93