remotestoragefw/webdavaccessplugin/inc/rsfwdavfileinfo.h
branchRCL_3
changeset 19 88ee4cf65e19
parent 16 87c71b25c937
child 20 1aa8c82cb4cb
equal deleted inserted replaced
16:87c71b25c937 19:88ee4cf65e19
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  Cache for file metadata
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CRSFWDAVFILEINFO_H
       
    20 #define CRSFWDAVFILEINFO_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // CLASS DECLARATION
       
    26 
       
    27 class TRsfwDavFileInfoFlags
       
    28     {
       
    29 public:
       
    30     enum TDavFileInfoFlag
       
    31         {
       
    32         EUnlockPending   = 0x01
       
    33         };
       
    34     };
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39  *  WebDAV file information object
       
    40  *  Used by DAV access module to handle file locking
       
    41  *  This information is thus internal to WebDAV access module
       
    42  *  and separated from metadata that is passed to Remote File Engine
       
    43  *
       
    44  *  @lib davaccess.lib
       
    45  *  @since Series 60 3.1
       
    46  */
       
    47 
       
    48 class CRsfwDavFileInfo : public CBase
       
    49     {
       
    50 public: // Constructors and destructor
       
    51     /**
       
    52      * Two-phased constructor.
       
    53      */
       
    54     static CRsfwDavFileInfo* NewL();
       
    55    
       
    56     /**
       
    57      * Destructor.
       
    58      */
       
    59     ~CRsfwDavFileInfo();
       
    60 
       
    61 public: // New functions
       
    62 
       
    63     /**
       
    64      * Get name
       
    65      * @return name
       
    66      */
       
    67     HBufC* Name();
       
    68 
       
    69     /**
       
    70      * Set name
       
    71      * @param aName name
       
    72      */
       
    73     void SetNameL(const TDesC& aName);
       
    74     
       
    75     /**
       
    76      * Get lock token
       
    77      * @return lock token
       
    78      */
       
    79     HBufC8* LockToken();
       
    80 
       
    81     /**
       
    82      * Set lock token
       
    83      * @param aLockToken lock token
       
    84      */
       
    85     void SetLockTokenL(const TDesC8& aLockToken);
       
    86 
       
    87     /**
       
    88      * Clear lock token
       
    89      */
       
    90     void ResetLockToken();
       
    91 
       
    92      /**
       
    93      * Get lock timeout
       
    94      * @return lock timeout
       
    95      */
       
    96     TUint Timeout();
       
    97 
       
    98     /**
       
    99      * Set timeout
       
   100      * @param aTimeout timeout
       
   101      */
       
   102     void SetTimeout(TUint aTimeout);
       
   103 
       
   104     /**
       
   105      * Check if a flag is set
       
   106      * @param aFlag flag mask (only supports a single bit)
       
   107      * @return ETrue if the flag is set
       
   108      */
       
   109     TBool IsFlag(TUint aFlag);
       
   110 
       
   111     /**
       
   112      * Set a flag bit
       
   113      * @param aFlag flag bit to be set
       
   114      */
       
   115     void SetFlag(TUint aFlag);
       
   116 
       
   117     /**
       
   118      * Clear a flag bit
       
   119      * @param flag bit to be cleared
       
   120      */
       
   121     void ResetFlag(TUint aFlag);
       
   122 
       
   123 private:
       
   124     void SetL(HBufC*& aDst, const TDesC& aSrc);
       
   125     void SetL(HBufC8*& aDst, const TDesC8& aSrc);
       
   126     
       
   127 private: // Data
       
   128     // These are used when constructing messages, thus 8 bit
       
   129     HBufC*  iName;
       
   130     HBufC8* iLockToken;
       
   131     
       
   132     // Active lock info:
       
   133     // lock timeout
       
   134     TUint iTimeout;
       
   135     // lock flags (currently always write lock)
       
   136     TUint iFlags;
       
   137     };
       
   138 
       
   139 #endif // CRSFWDAVFILEINFO_H
       
   140 
       
   141 // End of File