srsf/nssvasapi/nssvasdb/inc/nssvastvasdbcreator.h
changeset 13 57b735022c18
parent 1 b13cd05eeb2f
equal deleted inserted replaced
1:b13cd05eeb2f 13:57b735022c18
     1 /*
       
     2 * Copyright (c) 2002-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:  TNssVasDbCreator is responsible for creating VasDatabase.db.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TNSSVASDBCREATOR_H
       
    20 #define TNSSVASDBCREATOR_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32std.h>
       
    24 #include <e32cons.h>
       
    25 #include <s32file.h>
       
    26 #include <d32dbms.h>
       
    27 
       
    28 #include "nssvasdbkonsts.h"
       
    29 #include "nssvascvasdbsrvdef.h"
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *
       
    34 *  The TNssVasDbCreator class definition. 
       
    35 * 
       
    36 *  @lib VASInternal.lib
       
    37 *  @since 2.0
       
    38 */
       
    39 class TNssVasDbCreator
       
    40 {
       
    41 public:
       
    42 	
       
    43 	/**
       
    44     * Constructor 
       
    45     * @since 2.0
       
    46     * @param 
       
    47     * @return 
       
    48     */
       
    49 	TNssVasDbCreator();
       
    50 
       
    51 	/**
       
    52     * Method to create vasdatabase.db and its tables 
       
    53     * @since 2.0
       
    54     * @param "RDbs& iDbSession" Database session handle
       
    55     * @return none
       
    56     */
       
    57 	void CreateVasDatabaseL( RDbs& iDbSession );
       
    58 
       
    59 private:
       
    60     /**
       
    61     * Creates the tables and indices of the database
       
    62     */
       
    63 	void CreateTablesAndIndiciesL( RDbNamedDatabase& aDatabase );
       
    64 
       
    65     /**
       
    66     * Creates the context table
       
    67     */
       
    68 	void CreateContextTableL( RDbNamedDatabase& aDatabase );
       
    69 
       
    70     /**
       
    71     * Creates the index of the context table
       
    72     */
       
    73 	void CreateContextIndexL( RDbNamedDatabase& aDatabase );
       
    74 
       
    75     /**
       
    76     * Creates the tag table
       
    77     */
       
    78     void CreateTagTableL( RDbNamedDatabase& aDatabase );
       
    79 
       
    80     /**
       
    81     * Creates the index of the tag table
       
    82     */
       
    83 	void CreateTagIndexL( RDbNamedDatabase& aDatabase );
       
    84 
       
    85     /**
       
    86     * Creates the RRD table
       
    87     */
       
    88     void CreateRRDTableL( RDbNamedDatabase& aDatabase );
       
    89     
       
    90     /**
       
    91     * Creates indeices for RRD tables
       
    92     */
       
    93     void CreateRRDIndexL( RDbNamedDatabase& aDatabase );
       
    94 
       
    95     /**
       
    96     * Creates the write lock table
       
    97     */
       
    98     void CreateWriteLockTableL( RDbNamedDatabase& aDatabase );
       
    99     
       
   100     /**
       
   101     * Creates index for a given table and column. Leaves if creation fails.
       
   102     * Leave codes are the same as error codes in RDbNamedDatabase::CreateIndex + 
       
   103     * general out of memory
       
   104     * @param anIndexName Name of the index to create
       
   105     * @param aColumnName Name of the column to index on
       
   106     * @param aUnique ETrue if index should be unique, EFalse otherwise
       
   107     * @param aTableName Name of the table for which the index should be created
       
   108     */
       
   109     void CreateSingleColumnIndexL( RDbNamedDatabase& aDatabase, const TDesC& anIndexName,
       
   110                  const TDesC& aColumnName, const TBool aUnique, const TDesC& aTableName);
       
   111     
       
   112     /**
       
   113     * Creates index for a given table and columns. Leaves if creation fails.
       
   114     * Leave codes are the same as error codes in RDbNamedDatabase::CreateIndex + 
       
   115     * general out of memory
       
   116     * @param anIndexName Name of the index to create
       
   117     * @param aFirstColumnName Name of the first column to index on
       
   118     * @param aSecondColumnName Name of the second column to index on
       
   119     * @param aUnique ETrue if index should be unique, EFalse otherwise
       
   120     * @param aTableName Name of the table for which the index should be created
       
   121     */
       
   122     void CreateTwoColumnIndexL( const TDesC& anIndexName, 
       
   123                                 const TDesC& aFirstColumnName, 
       
   124                                 const TDesC& aSecondColumnName, 
       
   125                                 const TBool aUnique, const TDesC& aTableName);
       
   126 
       
   127 };
       
   128 
       
   129 #endif // TVASDBCREATOR_H