os/persistentdata/loggingservices/eventlogger/LogServ/inc/LogServDatabaseTransactionInterface.h
Update contrib.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __LOGSERVDATABASETRANSACTIONINTERFACE_H__
17 #define __LOGSERVDATABASETRANSACTIONINTERFACE_H__
20 #include "LogServShared.h"
21 #include "logservsecurity.h"
24 class CLogServCacheTypes;
25 class CLogServCacheConfig;
26 class CLogServCacheStrings;
27 class CLogServResourceInterpreter;
28 class MLogServDatabaseChangeInterface;
31 Interface class offering methods for:
32 - beginning, committing and rolling back a transaction;
33 - accessors to config, types and strings caches;
34 - accessors to the resource interpreter and and the change interface;
36 @see CLogServResourceInterpreter
37 @see MLogServDatabaseChangeInterface
38 @see CLogServCacheStrings
39 @see CLogServCacheTypes
40 @see CLogServCacheConfig
43 class MLogServDatabaseTransactionInterface
46 virtual TInt DTIBegin() = 0;//Start a new transaction
47 virtual TInt DTICommitAndEnd() = 0;//End an existing transaction
48 virtual void DTIRollBack() = 0;//Roll back the current transaction
49 virtual TInt DTIExecuteSql(const TDesC& aStatement, TDbTextComparison aComparison = EDbCompareNormal) = 0;//Run some arbitrary SQL
50 virtual TBool DTIInTransaction() const = 0;//Is the database in an existing transaction
51 virtual TBool DTIDatabaseIsDamaged() const = 0;//Is the database in an existing transaction
53 virtual CLogServResourceInterpreter& DTIResourceInterface() const = 0;//Access the resource interface
54 virtual MLogServDatabaseChangeInterface& DTIChangeInterface() const = 0;//Acess the change submission interface
55 virtual CLogServCacheStrings& DTICacheStrings() const = 0;//Access the string table cache
56 virtual CLogServCacheTypes& DTICacheTypes() const = 0;//Access the type table cache
57 virtual CLogServCacheConfig& DTICacheConfig() const = 0;//Access the config table cache
58 virtual RDbDatabase& DTIDatabase() = 0;//Access the database
60 virtual TBool DTIIsAllowed(TEventOp aEventOp, const RMessage2& aMessage, TUid aEventType, const char* aDiagnostic = 0) const = 0;//Check client capability
61 virtual const RArray<TUid>& DTIUidsOfStandardTypes() = 0;//Returns a collection of built-in TUids of built-types - those defined in Logwrap.rss
63 void DTIBeginWithRollBackProtectionLC();//Start a transaction with roll-back protection (cleanup)
64 void DTICommitAndCancelRollbackProtectionL();//End a transaction previously started with roll-back protection
67 static void RollBackDatabase(TAny* aObject);