os/persistentdata/loggingservices/eventlogger/LogServ/inc/LogServDatabaseTransactionInterface.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/loggingservices/eventlogger/LogServ/inc/LogServDatabaseTransactionInterface.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,71 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __LOGSERVDATABASETRANSACTIONINTERFACE_H__
    1.20 +#define __LOGSERVDATABASETRANSACTIONINTERFACE_H__
    1.21 +
    1.22 +#include <d32dbms.h>
    1.23 +#include "LogServShared.h"
    1.24 +#include "logservsecurity.h"
    1.25 +
    1.26 +// Classes referenced
    1.27 +class CLogServCacheTypes;
    1.28 +class CLogServCacheConfig;
    1.29 +class CLogServCacheStrings;
    1.30 +class CLogServResourceInterpreter;
    1.31 +class MLogServDatabaseChangeInterface;
    1.32 +
    1.33 +/**
    1.34 +Interface class offering methods for:
    1.35 + - beginning, committing and rolling back a transaction;
    1.36 + - accessors to config, types and strings caches;
    1.37 + - accessors to the resource interpreter and and the change interface;
    1.38 + 
    1.39 +@see CLogServResourceInterpreter  
    1.40 +@see MLogServDatabaseChangeInterface
    1.41 +@see CLogServCacheStrings
    1.42 +@see CLogServCacheTypes
    1.43 +@see CLogServCacheConfig
    1.44 +@internalComponent
    1.45 +*/
    1.46 +class MLogServDatabaseTransactionInterface
    1.47 +	{
    1.48 +public:
    1.49 +	virtual TInt DTIBegin() = 0;//Start a new transaction
    1.50 +	virtual TInt DTICommitAndEnd() = 0;//End an existing transaction
    1.51 +	virtual void DTIRollBack() = 0;//Roll back the current transaction
    1.52 +	virtual TInt DTIExecuteSql(const TDesC& aStatement, TDbTextComparison aComparison = EDbCompareNormal) = 0;//Run some arbitrary SQL
    1.53 +	virtual TBool DTIInTransaction() const = 0;//Is the database in an existing transaction
    1.54 +	virtual TBool DTIDatabaseIsDamaged() const = 0;//Is the database in an existing transaction
    1.55 +
    1.56 +	virtual CLogServResourceInterpreter& DTIResourceInterface() const = 0;//Access the resource interface
    1.57 +	virtual MLogServDatabaseChangeInterface& DTIChangeInterface() const = 0;//Acess the change submission interface
    1.58 +	virtual CLogServCacheStrings& DTICacheStrings() const = 0;//Access the string table cache
    1.59 +	virtual CLogServCacheTypes& DTICacheTypes() const = 0;//Access the type table cache
    1.60 +	virtual CLogServCacheConfig& DTICacheConfig() const = 0;//Access the config table cache
    1.61 +	virtual RDbDatabase& DTIDatabase() = 0;//Access the database
    1.62 +	
    1.63 +	virtual TBool DTIIsAllowed(TEventOp aEventOp, const RMessage2& aMessage, TUid aEventType, const char* aDiagnostic = 0) const = 0;//Check client capability
    1.64 +	virtual const RArray<TUid>& DTIUidsOfStandardTypes() = 0;//Returns a collection of built-in TUids of built-types - those defined in Logwrap.rss
    1.65 +
    1.66 +	void DTIBeginWithRollBackProtectionLC();//Start a transaction with roll-back protection (cleanup)
    1.67 +	void DTICommitAndCancelRollbackProtectionL();//End a transaction previously started with roll-back protection
    1.68 +
    1.69 +private:
    1.70 +	static void RollBackDatabase(TAny* aObject);
    1.71 +
    1.72 +	};
    1.73 +
    1.74 +#endif