web_plat/recent_url_store_api/inc/RecentUrlStore.h
changeset 0 dd21522fd290
child 16 a359256acfc6
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 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 the License "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: 
       
    15 *      Header file of RecentUrlStore.cpp
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 
       
    24 #ifndef RECENTURLSTORE_H
       
    25 #define RECENTURLSTORE_H
       
    26 
       
    27 // INCLUDES
       
    28 #include <e32base.h>
       
    29 #include <s32file.h>
       
    30 #include <d32dbms.h>
       
    31 #include <badesca.h>
       
    32 
       
    33 // CONSTANTS
       
    34 
       
    35 #define KMaxSQLLength (4096)// must handle name length + value length + insert statement length
       
    36 
       
    37 // MACROS
       
    38 
       
    39 // DATA TYPES
       
    40 
       
    41 // FUNCTION PROTOTYPES
       
    42 
       
    43 // FORWARD DECLARATIONS
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 
       
    48 /**
       
    49 * CRecentUrlStore
       
    50 *
       
    51 *  \b Library: ?library
       
    52 *
       
    53 *  @since ?Series60_version
       
    54 */
       
    55 class CRecentUrlStore : public CBase
       
    56     {
       
    57 
       
    58     public:
       
    59 
       
    60         /**
       
    61         * Two-phased constructor.
       
    62         * @return CRecentUrlStore *
       
    63         */
       
    64         IMPORT_C static CRecentUrlStore* NewL();
       
    65 
       
    66         /**
       
    67         * Returns url list.
       
    68         */
       
    69         IMPORT_C TInt GetData (CDesCArray&  aUrls, CDesCArray&  aTitles, const TDesC& aUrl = KNullDesC);
       
    70         
       
    71 	    /**
       
    72 	    * DeleteData
       
    73 	    * Deletes a row from the database
       
    74 	    */
       
    75 	    IMPORT_C void DeleteData (const TDesC& aUrl);
       
    76 
       
    77 	    /**
       
    78 	    * Save the url and title in store.
       
    79 	    */
       
    80 	    IMPORT_C void SaveData (const TDesC& aUrl, const TDesC& aTitle);
       
    81 
       
    82 	    /**
       
    83 	    * Clear the saved data
       
    84 	    */
       
    85 	    IMPORT_C void ClearData ();
       
    86 
       
    87         /**
       
    88         * Destructor
       
    89         */
       
    90         ~CRecentUrlStore();
       
    91 
       
    92     private:
       
    93 
       
    94         /**
       
    95         * By default Symbian 2nd phase constructor is private.
       
    96         */
       
    97         void ConstructL();
       
    98 
       
    99 	    /**
       
   100 	    *  Default constructor
       
   101 	    */
       
   102 	    CRecentUrlStore();
       
   103 	    
       
   104         /**
       
   105         * Returns url list.
       
   106         */
       
   107         void GetDataL (RDbNamedDatabase& aDataBase, 
       
   108         				CDesCArray&  aUrls, CDesCArray&  aTitles, const TDesC& aUrl);
       
   109 
       
   110         /**
       
   111         * Delete old rows
       
   112         */
       
   113         void DeleteOldRowsL (RDbNamedDatabase& aDataBase);
       
   114         
       
   115 	    /**
       
   116 	    *  Open the database
       
   117 	    */
       
   118 	    TInt OpenDatabase(RDbNamedDatabase& aDataBase);
       
   119 
       
   120 	    /**
       
   121 	    *  Create the database
       
   122 	    */
       
   123 	    void CreateDatabaseL();
       
   124 	    
       
   125     /*  Private Members  */
       
   126 
       
   127     private :
       
   128 
       
   129 	    RFs 				iDbSession; ///< client side access
       
   130 	    TBuf<KMaxSQLLength> iSQLStatement;
       
   131 	    HBufC*          	iRecentUrlDBFile;
       
   132 	    TBool				iFirstTimeOpened;
       
   133     };
       
   134 
       
   135 #endif  // RECENTURLSTORE_H
       
   136 
       
   137 // End of File