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 __LOGFILTQ__
|
sl@0
|
17 |
#define __LOGFILTQ__
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <badesca.h>
|
sl@0
|
20 |
#include <logwrap.h>
|
sl@0
|
21 |
#include "LogDynBuf.h"
|
sl@0
|
22 |
#include "LogCliServShared.h"
|
sl@0
|
23 |
|
sl@0
|
24 |
// Classes referenced
|
sl@0
|
25 |
class CLogFilter;
|
sl@0
|
26 |
class CLogFilterList;
|
sl@0
|
27 |
class MLogServDatabaseTransactionInterface;
|
sl@0
|
28 |
|
sl@0
|
29 |
/**
|
sl@0
|
30 |
This class provides only one public method (apart from constructor) - BuildExprLC().
|
sl@0
|
31 |
BuildExprLC() accepts as an input parameter a list with view filters and constructs from them
|
sl@0
|
32 |
a "WHERE" SQL expression that is returned to the caller into the RLogDynBuf output parameter.
|
sl@0
|
33 |
|
sl@0
|
34 |
@see CLogFilterList
|
sl@0
|
35 |
@see RLogDynBuf
|
sl@0
|
36 |
@see MLogServDatabaseTransactionInterface
|
sl@0
|
37 |
@internalComponent
|
sl@0
|
38 |
*/
|
sl@0
|
39 |
class TLogFilterExprBuilder
|
sl@0
|
40 |
{
|
sl@0
|
41 |
public:
|
sl@0
|
42 |
TLogFilterExprBuilder(MLogServDatabaseTransactionInterface& aDatabase);
|
sl@0
|
43 |
void BuildExprLC(RLogDynBuf& aExpr, const CLogFilterList& aFilterList, const TDesC& aInitial,
|
sl@0
|
44 |
TLogFilterConstructionType aType = ELogFilterConstructFilterByFilterFieldByField);
|
sl@0
|
45 |
|
sl@0
|
46 |
private:
|
sl@0
|
47 |
void DoNextProcessFilterByFilterFieldByFieldL(RLogDynBuf& aExpr);
|
sl@0
|
48 |
void DoNextProcessFieldByFieldFilterByFilterL(RLogDynBuf& aExpr);
|
sl@0
|
49 |
void MakePredicatesL();
|
sl@0
|
50 |
void MakeConditionL(RLogDynBuf& aExpr);
|
sl@0
|
51 |
void MakeFlagPredicatesL();
|
sl@0
|
52 |
const TDesC& ColumnName() const;
|
sl@0
|
53 |
void MakeNullPredicate(TDes& aDes);
|
sl@0
|
54 |
void MakePredicateL(TDes& aDes, const CLogFilter& aFilter);
|
sl@0
|
55 |
TBool IsDuplicateNullField() const;
|
sl@0
|
56 |
TBool IsDuplicateField(const CLogFilter& aFilter) const;
|
sl@0
|
57 |
TBool IsFieldEmpty(const CLogFilter& aFilter) const;
|
sl@0
|
58 |
TBool IsDuplicate(const CLogFilter& aFilter1, const CLogFilter& aFilter2) const;
|
sl@0
|
59 |
void Invariant() const;
|
sl@0
|
60 |
|
sl@0
|
61 |
private:
|
sl@0
|
62 |
MLogServDatabaseTransactionInterface& iDatabase;
|
sl@0
|
63 |
const CLogFilterList* iFilterList;
|
sl@0
|
64 |
const TDesC* iInitial;
|
sl@0
|
65 |
TLogFilterConstructionType iConstructionType;
|
sl@0
|
66 |
TInt iFilterIndex;
|
sl@0
|
67 |
TUint16 iField; //It must be 16-bit. The iField value is read from a resource file.
|
sl@0
|
68 |
//See CLogServRecentCondition::ConstructL() implementation.
|
sl@0
|
69 |
//The iField type width then restricts the max number of field macro values -
|
sl@0
|
70 |
//ELogContactField...ELogSimIdField.
|
sl@0
|
71 |
TInt iFlagIndex;
|
sl@0
|
72 |
CDesCArrayFlat* iPredicateList;
|
sl@0
|
73 |
};
|
sl@0
|
74 |
|
sl@0
|
75 |
#endif
|