appinstall_plat/task_management_api/inc/SWInstLogTaskParam.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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:   This file contains declarations of log task parameters.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SWINSTLOGTASKPARAM_H
       
    20 #define SWINSTLOGTASKPARAM_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <SWInstUid.h>
       
    25 
       
    26 namespace SwiUI
       
    27 {
       
    28 
       
    29 // CONSTANTS
       
    30 const TInt KMaxLogNameLength = 128;
       
    31 const TInt KMaxLogVendorLength = 128;
       
    32 
       
    33 /**
       
    34 * Actions to indicate the operation conducted by the installer.
       
    35 *
       
    36 * @since 3.0
       
    37 */
       
    38 enum TLogTaskAction
       
    39     {
       
    40     ELogTaskActionInstall,
       
    41     ELogTaskActionUninstall
       
    42     };
       
    43 
       
    44 /**
       
    45 * Parameters for log task.
       
    46 *
       
    47 * @since 3.0
       
    48 */
       
    49 class TLogTaskParam
       
    50     {
       
    51     public:    
       
    52         
       
    53         TBuf<KMaxLogNameLength> iName;
       
    54         TBuf<KMaxLogVendorLength> iVendor;
       
    55         TVersion iVersion;
       
    56         TUid iUid;  // Package uid
       
    57         TTime iTime;  // Time of the operation
       
    58         TLogTaskAction iAction;
       
    59         TBool iIsStartup; // Indicates did the operation modify startup list
       
    60     };
       
    61 
       
    62 // Package buffer for log task parameters
       
    63 typedef TPckg<TLogTaskParam> TLogTaskParamPckg;
       
    64 
       
    65 // Uid for startup list addition implementation
       
    66 const TUid KLogTaskImplUid = { KSWInstLogTaskImplUid };
       
    67 
       
    68 
       
    69 // Constants for accessing the DB
       
    70 
       
    71 
       
    72 // Name of the log db
       
    73 _LIT( KLogDatabaseName, "c:SWInstLog.db" );
       
    74 
       
    75 // Name of the log table
       
    76 _LIT( KLogTableName, "log" );
       
    77 
       
    78 // SQL query to retrieve data from log table
       
    79 _LIT( KLogReadTableSQL, "SELECT time,name,vendor,version,action FROM log" );
       
    80 
       
    81 // SQL query to create the log table
       
    82 _LIT( KLogCreateTableSQL, 
       
    83 "CREATE TABLE log (time BIGINT NOT NULL,uid UNSIGNED INTEGER NOT NULL,\
       
    84 name VARCHAR(128) NOT NULL,vendor VARCHAR(128) NOT NULL,\
       
    85 version VARCHAR(16) NOT NULL,action UNSIGNED INTEGER,startup UNSIGNED INTEGER)" );
       
    86 
       
    87 // SQL query to insert row into the log table
       
    88 _LIT( KLogInsertSQLFormat, 
       
    89 "INSERT INTO log (time, uid, name, vendor, version, action, startup) \
       
    90 VALUES (%S, %u, '%S', '%S', '%S', %u, %u)" );
       
    91 
       
    92 // UID of the SWInstLog db access policy
       
    93 const TUid KLogAccessPolicyUid = { KSWInstLogAccessPolicyUid };
       
    94 }
       
    95 
       
    96 #endif // SWINSTLOGPARAM_H