PECengine/StorageManager2/ClientInc/PEngStorageGlobals.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002 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:  See class description below.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __PENGSTORAGEGLOBALS_H__
       
    20 #define __PENGSTORAGEGLOBALS_H__
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 
       
    26 //  CONSTANTS
       
    27 _LIT( KPEngStorageDrive, "C:" );
       
    28 _LIT( KPEngStorageTempFolder, "temp\\" );
       
    29 _LIT( KPEngStorageStateSuffix, ".st" );
       
    30 const TInt KMinimalHashSize = 28; // Minimal size of the Hashed ID
       
    31 
       
    32 
       
    33 // DATA TYPES
       
    34 enum TPEngStorageType
       
    35     {
       
    36     //////////////////////////////////////////////////////////////////////////
       
    37     /**
       
    38      *	When CPEngStoreEntry::ExternalizeL() and CPEngStoreEntry::InternalizeL()
       
    39      *	and CPEngStoreEntry::GetEntrySize() is called for the mixed model
       
    40      *	types, type of the part of the model to be processed if passed.
       
    41      *	For single type Store models, this parameter should be
       
    42      *	ignored in the implementation of those functions in the
       
    43      *	derived classes.
       
    44      *
       
    45      *	When Mixed model type is used, for before each call of the
       
    46      *	CPEngStoreEntry::ExternalizeL() and CPEngStoreEntry::InternalizeL()
       
    47      *	CPEngStoreEntry::GetEntrySize() is called to get size of the current
       
    48      *	part of the model to be Externalizeddd / Internalized
       
    49      */
       
    50     //////////////////////////////////////////////////////////////////////////
       
    51 
       
    52     //////////////////////////////////////////////////////////////////////////
       
    53     /////////////	Basic Store Entry types //////////////////////////////////
       
    54     //////////////////////////////////////////////////////////////////////////
       
    55     /**
       
    56      * Signals First basic type, not to be used by clients as a Storage
       
    57      * type. How ever it can be used by the client as signalization
       
    58      * of the beginning of the Externalize/ Internalize operation
       
    59      */
       
    60     EPEngStorageBasicFirst =							0x00000001,
       
    61 
       
    62     /*
       
    63      * These models cannot be stored, StoreL and RetrieveL leaves with KErrNotSupported
       
    64      */
       
    65     EPEngStorageBasicTemporary =						0x00000002,
       
    66 
       
    67     /*
       
    68      * Permanent models, these remains there after boot
       
    69      * Storage Type in the ExternalizeL(), InternalizeL() GetEntrySize()
       
    70      * functions of the CPEngStoreEntry() can be ignored
       
    71      */
       
    72     EPEngStorageBasicPermanent =						0x00000004,
       
    73 
       
    74     /*
       
    75      * Cached models, these are deleted when cache is cleaned or when phone is booted
       
    76      * Storage Type in the ExternalizeL(), InternalizeL() GetEntrySize()
       
    77      * functions of the CPEngStoreEntry() can be ignored
       
    78       */
       
    79     EPEngStorageBasicCached =							0x00000008,
       
    80 
       
    81     /**
       
    82      * Signals last basic type, not to be used by clients!!
       
    83      */
       
    84     EPEngStorageBasicLast =								0x00000010,
       
    85 
       
    86 
       
    87 
       
    88     //////////////////////////////////////////////////////////////////////////
       
    89     ///////////// Additional Store entry types flag features /////////////////
       
    90     //////////////////////////////////////////////////////////////////////////
       
    91     /**
       
    92      * If this flag is switched one. Version of the stored Store entry model
       
    93      * is checked if it match the one which is stored in the store
       
    94      * If client modified different version, storing is denied
       
    95      */
       
    96     EPEngStorageFlagVersionChecked =			0x00000100,
       
    97 
       
    98     /**
       
    99      * This flag is used to notify if Lock of the store entry is obeyed or
       
   100      * not, while entry is stored in the Storage.
       
   101      * Setting up of this flag will disable check of the lock.
       
   102      */
       
   103     EPEngStorageLockIgnored =					0x00000200,
       
   104 
       
   105     //////////////////////////////////////////////////////////////////////////
       
   106     /**
       
   107      *	Mixed Store Entry types
       
   108      *	Those are predefined versions to be used as examples,
       
   109      *	it can be used by client
       
   110      */
       
   111     //////////////////////////////////////////////////////////////////////////
       
   112 
       
   113     /**
       
   114      *	Cached model with version control
       
   115      */
       
   116     EPEngMixedCachedVersionCon =
       
   117     EPEngStorageBasicCached | EPEngStorageFlagVersionChecked,
       
   118 
       
   119     /**
       
   120      *	Permanent with version control activated
       
   121      */
       
   122     EPEngMixedPermanentVersionCon =
       
   123     EPEngStorageBasicPermanent | EPEngStorageFlagVersionChecked,
       
   124 
       
   125     /*
       
   126      * Mixed model, this model has Permanent and Cached part.
       
   127      * CPEngStoreEntry::ExternalizeL() and CPEngStoreEntry::InternalizeL()
       
   128      * Is called twice. Current part to be processed is passed as parameter
       
   129      * to the called function.
       
   130      * When storing, either both or none of the parts is stored to the store.
       
   131      * Version check is not activated
       
   132      */
       
   133     EPEngMixedPermanentCached =
       
   134     EPEngStorageBasicPermanent | EPEngStorageBasicCached,
       
   135 
       
   136     /*
       
   137      * Mixed model, this model has Permanent and Cached part.
       
   138      * CPEngStoreEntry::ExternalizeL() and CPEngStoreEntry::InternalizeL()
       
   139      * Is called twice. Current part to be processed is passed as parameter
       
   140      * to the called function.
       
   141      * When storing, either both or none of the parts is stored to the store.
       
   142      * Version check is activated
       
   143      */
       
   144     // EPEngStoragePermanentNoVersionCheck | EPEngStorageCachedNoVersionCheck
       
   145     EPEngMixedPermanentCachedVersionCon =
       
   146     EPEngMixedPermanentCached | EPEngStorageFlagVersionChecked,
       
   147 
       
   148 
       
   149     //////////////////////////////////////////////////////////////////////////
       
   150     /////////////	Add new Store Entry types here ///////////////////////////
       
   151     //////////////////////////////////////////////////////////////////////////
       
   152 
       
   153     };
       
   154 
       
   155 /**
       
   156  *	Levels of the storage Lock system. When requirement to the higher
       
   157  *	level of the lock is received by the storage, previous low level lock
       
   158  *	i released and replaced by the new lock. Owner of the previous lock
       
   159  *	is not allowed to manipulate with data anymore.
       
   160  */
       
   161 enum TPengStorageLockPriority
       
   162     {
       
   163     EStorageLockLevelLow	= 0x0010,
       
   164     EStorageLockLevelBasic	= 0x0020,
       
   165     EStorageLockLevelHigh	= 0x0030
       
   166     };
       
   167 
       
   168 
       
   169 
       
   170 //Panic definitions
       
   171 _LIT( KPEngSMPanic, "PECSM" );
       
   172 _LIT( KPEngSMEuserCBasePanic, "E32USER-CBase" );
       
   173 const TInt KPEngSMEuserCBasePanicReason = 33 ;
       
   174 enum TPEngStoragePanics
       
   175     {
       
   176     EPEngSM_StorageBaseNotSet = 1,
       
   177     EPEngSM_UnknownStorageType,
       
   178     EPEngSM_StoreManNotDefined,
       
   179     EPEngSM_SetNewEngagedSIdsHasBackup,
       
   180     EPEngSM_RemoveEngagedSIdsHasBackup,
       
   181     EPEngSM_SIdContainerHasStillObservers,
       
   182     EPEngSM_SIdNotifyUnderFlow,
       
   183     EPEngSM_SIdNotifyOverflow,
       
   184     EPEngSM_TypeOrderMismatch,
       
   185     EPEngSM_InternalizeLengthMismatch
       
   186     };
       
   187 
       
   188 #endif      // __PENGSTORAGEGLOBALS_H__