contacts_plat/predictivesearch_utils_api/inc/CPsQueryItem.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2007 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 single query item for predictive search.
       
    15 *                Used to represent the search sequence character-by-character
       
    16 *                along with the keyboard type(eg ITU-T, QWERTY ) in which the 
       
    17 *                character was input.
       
    18 *
       
    19 */
       
    20 
       
    21 #ifndef __CPS_QUERY_ITEM_H__
       
    22 #define __CPS_QUERY_ITEM_H__
       
    23 
       
    24 // SYSTEM INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <s32strm.h>
       
    27 #include <CPcsDefs.h>
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32  * Utility class to hold a single query item for predictive search.
       
    33  * This class that is used to represent one character of the search sequence.
       
    34  * 
       
    35  * @lib pcsutils.lib
       
    36  * @since S60 v3.2
       
    37  */
       
    38 class CPsQueryItem : public CBase
       
    39 {
       
    40 	public:
       
    41 
       
    42 		/**
       
    43 		* Two phase construction
       
    44 		*
       
    45 		* @return Instance of CPsQueryItem
       
    46 		*/
       
    47 		IMPORT_C static CPsQueryItem* NewL();
       
    48 
       
    49 		/**
       
    50 		* Destructor
       
    51 		*/
       
    52 		IMPORT_C ~CPsQueryItem();
       
    53 
       
    54 		/**
       
    55 		* Sets the keyboard mode eg ITU-T, QWERTY etc
       
    56 		*
       
    57 		* @param aMode The keyborad mode 
       
    58 		*/
       
    59 		IMPORT_C void SetMode(const TKeyboardModes aMode);
       
    60 
       
    61 		/**
       
    62 		* Sets a character of the search sequence
       
    63 		*
       
    64 		* @param aCharacter Character of the search sequence
       
    65 		*/
       
    66 		IMPORT_C void SetCharacter(const TChar aCharacter);
       
    67 
       
    68 		/**
       
    69 		* Returns the keyboard mode eg ITU-T, QWERTY etc
       
    70 		*
       
    71 		* @return Mode of input for this character
       
    72 		*/
       
    73 		IMPORT_C TKeyboardModes Mode() const;
       
    74 
       
    75 		/**
       
    76 		* Returns a character of the search sequence
       
    77 		*
       
    78 		* @return Character input
       
    79 		*/
       
    80 		IMPORT_C TChar Character() const;
       
    81 
       
    82 		/**
       
    83 		* Writes 'this' to the stream
       
    84 		*
       
    85 		* @param aStream WriteStream with externalized contents
       
    86 		*/
       
    87 		IMPORT_C virtual void ExternalizeL(RWriteStream& aStream) const;		
       
    88 
       
    89 		/**
       
    90 		* Initializes 'this' from stream
       
    91 		*
       
    92 		* @param aStream ReadStream with data contents to be internalized
       
    93 		*/
       
    94 		IMPORT_C virtual void InternalizeL(RReadStream& aStream);
       
    95 			
       
    96 
       
    97 	private:
       
    98 
       
    99 		/**
       
   100 		* Default Constructor
       
   101 		*/
       
   102 		CPsQueryItem();
       
   103 
       
   104 		/**
       
   105 		* Second phase constructor
       
   106 		*/
       
   107 		void ConstructL();		
       
   108 				
       
   109 		private:	
       
   110 				
       
   111 		/**
       
   112 		*  Keyboard mode e.g. ITU-T, QWERTY
       
   113 		*/
       
   114 		TKeyboardModes iMode;
       
   115 
       
   116 		/**
       
   117 		* Character of the serach sequence
       
   118 		*/
       
   119 		TChar iCharacter;
       
   120 
       
   121 };
       
   122 
       
   123 #endif // __CPS_QUERY_ITEM_H__
       
   124 
       
   125 // End of file