contacts_plat/predictivesearch_utils_api/inc/CPsPattern.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Utility class to hold a result pattern for predictive search.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CPS_PATTERN_H__
       
    20 #define __CPS_PATTERN_H__
       
    21 
       
    22 // SYSTEM INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <s32strm.h>
       
    25 #include <CPcsDefs.h>
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30  * Utility class to hold a result pattern for predictive search.
       
    31  * 
       
    32  * @lib pcsutils.lib
       
    33  * @since S60 v3.2
       
    34  */
       
    35 class CPsPattern : public CBase
       
    36 {
       
    37 	public:
       
    38 
       
    39 		/**
       
    40 		* Two phase construction
       
    41 		*
       
    42 		* @return Instance of CPsPattern
       
    43 		*/
       
    44 		IMPORT_C static CPsPattern* NewL();
       
    45 
       
    46 		/**
       
    47 		* Destructor
       
    48 		*/
       
    49 		IMPORT_C ~CPsPattern();
       
    50 
       
    51 		/**
       
    52 		* Sets the pattern
       
    53 		*
       
    54 		* @param aPattern The match pattern 
       
    55 		*/
       
    56 		IMPORT_C void SetPatternL(TDesC& aPattern);
       
    57 
       
    58 		/**
       
    59 		* Sets the first index
       
    60 		*
       
    61 		* @param aCharacter The first index
       
    62 		*/
       
    63 		IMPORT_C void SetFirstIndex(TInt aIndex);
       
    64 
       
    65 		/**
       
    66 		* Returns the match pattern
       
    67 		*
       
    68 		* @return Mode of input for this character
       
    69 		*/
       
    70 		IMPORT_C TDesC& Pattern();
       
    71 
       
    72 		/**
       
    73 		* Returns the first index
       
    74 		*
       
    75 		* @return First index
       
    76 		*/
       
    77 		IMPORT_C TInt FirstIndex();
       
    78 
       
    79 		/**
       
    80 		* Writes 'this' to the stream
       
    81 		*
       
    82 		* @param aStream WriteStream with externalized contents
       
    83 		*/
       
    84 		IMPORT_C virtual void ExternalizeL(RWriteStream& aStream);		
       
    85 
       
    86 		/**
       
    87 		* Initializes 'this' from stream
       
    88 		*
       
    89 		* @param aStream ReadStream with data contents to be internalized
       
    90 		*/
       
    91 		IMPORT_C virtual void InternalizeL(RReadStream& aStream);
       
    92 			
       
    93 
       
    94 	private:
       
    95 
       
    96 		/**
       
    97 		* Default Constructor
       
    98 		*/
       
    99 		CPsPattern();
       
   100 
       
   101 		/**
       
   102 		* Second phase constructor
       
   103 		*/
       
   104 		void ConstructL();		
       
   105 				
       
   106 	private:	
       
   107 
       
   108 		/**
       
   109 		* Match pattern.
       
   110 		*/
       
   111 		HBufC* iPattern;
       
   112 		
       
   113 		/**
       
   114 		* First index of this pattern in result set.
       
   115 		*/
       
   116 		TInt iFirstIndex;
       
   117 
       
   118 };
       
   119 
       
   120 #endif // __CPS_PATTERN_H__
       
   121 
       
   122 // End of file