xdmprotocols/XcapProtocol/XcapCache/inc/XcapCache.h
branchRCL_3
changeset 18 fbd2e7cec7ef
parent 0 c8caa15ef882
equal deleted inserted replaced
17:2669f8761a99 18:fbd2e7cec7ef
       
     1 /*
       
     2 * Copyright (c) 2005 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:   RXcapCache
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __XCAPCACHE_H__
       
    22 #define __XCAPCACHE_H__
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <f32file.h>
       
    27 
       
    28 //Constants
       
    29 #ifdef _DEBUG
       
    30     _LIT( KCacheClientLogDir,                       "XDM" );
       
    31     _LIT( KCacheClientLogFile,                      "CacheClient.txt" );
       
    32 #endif
       
    33 
       
    34 //FORWARD DECLARATIONS
       
    35 class TCacheEntryInfo;
       
    36 class CXcapCacheClient;
       
    37 
       
    38 //CLASS DECLARATION
       
    39 class RXcapCache : public RSessionBase
       
    40     {
       
    41     public:  // New functions
       
    42         
       
    43         /**
       
    44         * C++ Constructor.
       
    45         */
       
    46         IMPORT_C RXcapCache();
       
    47         
       
    48         /**
       
    49         * Return the version of this component
       
    50         *
       
    51         * @return TVersion The version number
       
    52         */
       
    53         IMPORT_C TVersion Version() const;
       
    54         
       
    55         /**
       
    56         * Connect to the server side session object
       
    57         *
       
    58         * @return TInt Error code
       
    59         */
       
    60         IMPORT_C TInt Connect();
       
    61         
       
    62         /**
       
    63         * Destructor
       
    64         */
       
    65         IMPORT_C ~RXcapCache();
       
    66         
       
    67         /**
       
    68         * Store a new document
       
    69         *
       
    70         * @param TDesC8& ETag of the new document
       
    71         * @param TDesC& Name of the document
       
    72         * @param TDesC8& Root location of the document
       
    73         * @param TDesC8& The document content
       
    74         * @return void
       
    75         */
       
    76         IMPORT_C void Store( const TDesC8& aETag, 
       
    77                              const TDesC& aDocumentName,
       
    78                              const TDesC8& aRootLocation,
       
    79                              const TDesC8& aResponseData );
       
    80         
       
    81         /**
       
    82         * Remove a named document from the cache
       
    83         *
       
    84         * @param TDesC& Name of the document
       
    85         * @param TDesC8& Root location of the document
       
    86         * @return TInt Error code
       
    87         */
       
    88         IMPORT_C TInt Delete( const TDesC& aDocumentName,
       
    89                               const TDesC8& aRootLocation );
       
    90         
       
    91         /**
       
    92         * Fetch information on a named document
       
    93         *
       
    94         * @param TDes8& Contains the ETag string on completion
       
    95         * @param TCacheEntryInfo& Encapsulates root & name 
       
    96         * @return TInt Error code
       
    97         */
       
    98         IMPORT_C TInt FetchDocumentInfo( TDes8& aETagDescriptor,
       
    99                                          const TDesC& aDocumentName,
       
   100                                          const TDesC8& aRootLocation,
       
   101                                          TCacheEntryInfo& aEntryInfo );
       
   102         
       
   103         /**
       
   104         * Fetch content for the named document
       
   105         *
       
   106         * @param TRequestStatus& Request status of the client
       
   107         * @param TDes8& Contains the document contents on completion
       
   108         * @param TCacheEntryInfo& Encapsulates root & name 
       
   109         * @return TInt Error code
       
   110         */                             
       
   111         IMPORT_C void FetchDocumentContent( TDes8& aContentDescriptor,
       
   112                                             const TDesC& aDocumentName,
       
   113                                             const TDesC8& aRootLocation );
       
   114         
       
   115         /**
       
   116         * Check validity of the named document
       
   117         *
       
   118         * @param TDesC8& ETag of the document
       
   119         * @param TDesC& Name of the document
       
   120         * @param TDesC8& Root location of the document
       
   121         * @return TInt Error code
       
   122         */                            
       
   123         IMPORT_C TInt IsCurrent( const TDesC8& aETag, 
       
   124                                  const TDesC& aDocumentName,
       
   125                                  const TDesC8& aRootLocation );
       
   126                                                                                                                             
       
   127         /**
       
   128         * Flush (externalise) cache metadata to disk
       
   129         *
       
   130         * @return void
       
   131         */
       
   132         IMPORT_C void Flush();
       
   133         
       
   134     public:   //Not exported
       
   135         
       
   136         /**
       
   137         * Start the server
       
   138         *
       
   139         * @return TInt Error code
       
   140         */
       
   141         TInt StartServer();
       
   142         
       
   143         /**
       
   144         * Check whether the server is already running
       
   145         *
       
   146         * @return TBool Is the server running
       
   147         */
       
   148         TBool IsRunning();
       
   149 
       
   150 
       
   151     private: //Data
       
   152         
       
   153        TBool                                            iConnected;
       
   154     };
       
   155 
       
   156 #endif      //__XCAPCACHE_H__
       
   157 
       
   158 
       
   159