1.1 --- a/epoc32/include/msvfind.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/msvfind.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,192 @@
1.4 -msvfind.h
1.5 +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#if !defined(__MSVFIND_H__)
1.21 +#define __MSVFIND_H__
1.22 +
1.23 +#if !defined(__MSVAPI_H__)
1.24 +#include <msvapi.h>
1.25 +#endif
1.26 +
1.27 +#if !defined __MTCLBASE_H__
1.28 +#include <mtclbase.h>
1.29 +#endif
1.30 +
1.31 +#if !defined(__MTMDEF_H__)
1.32 +#include <mtmdef.h>
1.33 +#endif
1.34 +
1.35 +//**********************************
1.36 +// TMsvFindResult
1.37 +//**********************************
1.38 +//
1.39 +// Contains the result of a find operation for a particular entry
1.40 +//
1.41 +
1.42 +class TMsvFindResult
1.43 +/** A single result from a text search operation. The class encapsulates information
1.44 +which:
1.45 +
1.46 +1. identifies the message in which the search text is found
1.47 +
1.48 +2. identifies the parts of the message that contain the search text.
1.49 +@publishedAll
1.50 +@released
1.51 +*/
1.52 + {
1.53 +public:
1.54 + IMPORT_C TMsvFindResult();
1.55 + IMPORT_C TMsvFindResult(TMsvPartList aPartList, TMsvId aId);
1.56 + //
1.57 +public:
1.58 + /** The parts of the message that contain the search text. */
1.59 + TMsvPartList iPartList;
1.60 + /** The entry Id of the message that contains the search text. */
1.61 + TMsvId iId;
1.62 + };
1.63 +
1.64 +//**********************************
1.65 +// CMsvFindResultSelection
1.66 +//**********************************
1.67 +//
1.68 +// A list of find operation results with an accessor to find
1.69 +// the position for a particular entry
1.70 +//
1.71 +
1.72 +class CMsvFindResultSelection : public CArrayFixFlat<TMsvFindResult>
1.73 +/** Collection of results from a text search operation. The collection is organized
1.74 +as an array.
1.75 +@publishedAll
1.76 +@released
1.77 +*/
1.78 + {
1.79 +public:
1.80 + IMPORT_C CMsvFindResultSelection();
1.81 + //
1.82 +public:
1.83 + IMPORT_C CMsvFindResultSelection* CopyL() const;
1.84 + IMPORT_C CMsvFindResultSelection* CopyLC() const;
1.85 + IMPORT_C TInt Find(TMsvId aId) const;
1.86 + };
1.87 +
1.88 +//**********************************
1.89 +// TMsvFindOperationProgress
1.90 +//**********************************
1.91 +//
1.92 +// Find operation progress
1.93 +//
1.94 +
1.95 +class TMsvFindOperationProgress
1.96 +/** Encapsulates progress information for a text search operation. The class has
1.97 +public data members.
1.98 +@publishedAll
1.99 +@released
1.100 +*/
1.101 + {
1.102 +public:
1.103 + IMPORT_C TMsvFindOperationProgress();
1.104 + //
1.105 +public:
1.106 + /** KErrNone if the search operation completed successfully otherwise one of the
1.107 + system-wide error codes.
1.108 +
1.109 + This has no meaning while the search operation is in progress. */
1.110 + TInt iError;
1.111 + /** The number of messages already searched. */
1.112 + TInt iCompleted;
1.113 + /** The number of messages remaining to be searched.
1.114 +
1.115 + If the search operation is for text within a specified root, folder or service,
1.116 + then this value is zero until the total number of messages has been determined. */
1.117 + TInt iRemaining;
1.118 + /** The entry Id identifying the message currently being searched */
1.119 + TMsvId iCurrentId;
1.120 + };
1.121 +
1.122 +class CClientMtmRegistry;
1.123 +class CMsvChildMessages;
1.124 +
1.125 +//**********************************
1.126 +// CMsvFindOperation
1.127 +//**********************************
1.128 +//
1.129 +// The find operation. Created by calling the relevant static function
1.130 +// The results for all of these are added to the CMsvFindResultSelection which
1.131 +// can be accessed via the accessor function GetFindResult
1.132 +//
1.133 +
1.134 +class CMsvFindOperation : public CMsvOperation
1.135 +/** Encapsulates a text search operation.
1.136 +
1.137 +The class offers an interface for locating messages which contain specified
1.138 +text. Messages may contain data created for, or received from, any of the
1.139 +transport protocols that are supported by the Messaging Architecture (e.g.
1.140 +Email, FAX and SMS).
1.141 +
1.142 +Clients create a new instance for each search operation to be performed. They
1.143 +are also responsible for destroying the instance once a search operation is
1.144 +complete.
1.145 +
1.146 +Clients can derive from this class, typically to implement their own version
1.147 +of the function IsValid().
1.148 +@publishedAll
1.149 +@released
1.150 +*/
1.151 + {
1.152 +public:
1.153 + IMPORT_C static CMsvFindOperation* FindInChildrenL(CMsvSession& aSession, const TDesC& aTextToFind, TMsvId aParentId, TMsvPartList aPartList, TRequestStatus& aObserverRequestStatus);
1.154 + IMPORT_C static CMsvFindOperation* FindInSelectionL(CMsvSession& aSession, const TDesC& aTextToFind, const CMsvEntrySelection& aSelection, TMsvPartList aPartList, TRequestStatus& aObserverRequestStatus);
1.155 + IMPORT_C ~CMsvFindOperation();
1.156 + //
1.157 + IMPORT_C const TDesC8& ProgressL();
1.158 + IMPORT_C const TDesC8& FinalProgress();
1.159 + //
1.160 + inline const CMsvFindResultSelection& GetFindResult() const;
1.161 + //
1.162 +protected:
1.163 + IMPORT_C CMsvFindOperation(CMsvSession& aSession, const TDesC& aTextToFind, TMsvPartList aPartList, TRequestStatus& aObserverRequestStatus);
1.164 + IMPORT_C void ConstructFindInChildrenL(TMsvId aId);
1.165 + IMPORT_C void ConstructFindInSelectionL(const CMsvEntrySelection& aSelection);
1.166 + //
1.167 +private:
1.168 + void ConstructL();
1.169 + //
1.170 + IMPORT_C void DoCancel();
1.171 + IMPORT_C void RunL();
1.172 + //
1.173 + void DoRunL();
1.174 + void FindL();
1.175 + void Complete(TInt aStatus);
1.176 + void StartL();
1.177 + //
1.178 + virtual TBool IsValid(const TMsvEntry& aEntry) const;
1.179 + //
1.180 +private:
1.181 + enum { EMsvFindingText, EMsvExpandingFolders } iState;
1.182 + TBuf<KMsvMaxFindTextLength> iTextToFind;
1.183 + TMsvPartList iPartList;
1.184 + CMsvFindResultSelection* iFindResultSel;
1.185 + TPckgBuf<TMsvFindOperationProgress> iProgress;
1.186 + CMsvEntrySelection* iSelection;
1.187 + CClientMtmRegistry* iClientRegistry;
1.188 + CArrayPtrFlat<CBaseMtm>* iMtmArray;
1.189 + CMsvChildMessages* iChildMessages;
1.190 + TMsvId iCurrentId;
1.191 + TMsvEntry iEntry;
1.192 + };
1.193 +
1.194 +#include <msvfind.inl>
1.195 +
1.196 +#endif