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