os/persistentdata/loggingservices/eventlogger/LogServ/inc/LOGFILTQ.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/LOGFILTQ.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,75 @@
     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 __LOGFILTQ__
    1.20 +#define __LOGFILTQ__
    1.21 +
    1.22 +#include <badesca.h>
    1.23 +#include <logwrap.h>
    1.24 +#include "LogDynBuf.h"
    1.25 +#include "LogCliServShared.h"
    1.26 +
    1.27 +// Classes referenced
    1.28 +class CLogFilter;
    1.29 +class CLogFilterList;
    1.30 +class MLogServDatabaseTransactionInterface;
    1.31 +
    1.32 +/**
    1.33 +This class provides only one public method (apart from constructor) - BuildExprLC().
    1.34 +BuildExprLC() accepts as an input parameter a list with view filters and constructs from them
    1.35 +a "WHERE" SQL expression that is returned to the caller into the RLogDynBuf output parameter. 
    1.36 +
    1.37 +@see CLogFilterList
    1.38 +@see RLogDynBuf
    1.39 +@see MLogServDatabaseTransactionInterface
    1.40 +@internalComponent
    1.41 +*/
    1.42 +class TLogFilterExprBuilder
    1.43 +	{
    1.44 +public:
    1.45 +    TLogFilterExprBuilder(MLogServDatabaseTransactionInterface& aDatabase);
    1.46 +	void BuildExprLC(RLogDynBuf& aExpr, const CLogFilterList& aFilterList, const TDesC& aInitial, 
    1.47 +                     TLogFilterConstructionType aType = ELogFilterConstructFilterByFilterFieldByField);
    1.48 +	
    1.49 +private:
    1.50 +	void DoNextProcessFilterByFilterFieldByFieldL(RLogDynBuf& aExpr);
    1.51 +	void DoNextProcessFieldByFieldFilterByFilterL(RLogDynBuf& aExpr);
    1.52 +	void MakePredicatesL();
    1.53 +	void MakeConditionL(RLogDynBuf& aExpr);
    1.54 +	void MakeFlagPredicatesL();
    1.55 +	const TDesC& ColumnName() const;
    1.56 +    void MakeNullPredicate(TDes& aDes);
    1.57 +	void MakePredicateL(TDes& aDes, const CLogFilter& aFilter);
    1.58 +    TBool IsDuplicateNullField() const;
    1.59 +	TBool IsDuplicateField(const CLogFilter& aFilter) const;
    1.60 +	TBool IsFieldEmpty(const CLogFilter& aFilter) const;
    1.61 +	TBool IsDuplicate(const CLogFilter& aFilter1, const CLogFilter& aFilter2) const;
    1.62 +	void Invariant() const;
    1.63 +
    1.64 +private:
    1.65 +	MLogServDatabaseTransactionInterface& iDatabase;
    1.66 +    const CLogFilterList* iFilterList;
    1.67 +    const TDesC* iInitial;
    1.68 +    TLogFilterConstructionType iConstructionType;
    1.69 +	TInt iFilterIndex;
    1.70 +	TUint16 iField; //It must be 16-bit. The iField value is read from a resource file. 
    1.71 +					//See CLogServRecentCondition::ConstructL() implementation. 
    1.72 +					//The iField type width then restricts the max number of field macro values - 
    1.73 +					//ELogContactField...ELogSimIdField. 
    1.74 +	TInt iFlagIndex;
    1.75 +    CDesCArrayFlat* iPredicateList;
    1.76 +	};
    1.77 +
    1.78 +#endif