contacts_plat/predictivesearch_utils_api/inc/CPcsDefs.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2007 - 2010 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:  PCS general definitions 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __PCSSERVERDEFS_H__
       
    19 #define __PCSSERVERDEFS_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <biditext.h>
       
    23 
       
    24 /**
       
    25  * PCS Server Exe Name
       
    26  */
       
    27 _LIT(KPcsServerName,           "PcsServer");
       
    28 _LIT(KPcsServerExeName,        "PcsServer.exe");
       
    29 _LIT(KPcsAlgorithm_NonChinese, "PCS-ALG-1");
       
    30 _LIT(KPcsAlgorithm_Chinese,    "PCS-ALG-2");
       
    31 
       
    32 /**
       
    33  * PCS Server Version details
       
    34  */
       
    35 const TInt KPcsServerMajorVersionNumber = 1;
       
    36 const TInt KPcsServerMinorVersionNumber = 0;
       
    37 const TInt KPcsServerBuildVersionNumber = 0;
       
    38 
       
    39 /**
       
    40  * PCS Server request Commands
       
    41  */
       
    42 enum TPsServerRequestCommands
       
    43 { 
       
    44     ESearchSettings,
       
    45     ESearch,
       
    46     ESearchInput,
       
    47     ECancelSearch,
       
    48     ELangSupport,
       
    49     EGetDataOrder,
       
    50     EGetSortOrder,
       
    51     ESetSortOrder,
       
    52     EShutdown,
       
    53     ESearchMatchString,
       
    54     EGetAdaptiveGrid
       
    55 };
       
    56 
       
    57 /**
       
    58  * PS Server response commands
       
    59  */
       
    60 enum TPsServerResponseCommand
       
    61 {
       
    62     ESearchComplete,
       
    63     ECancelComplete
       
    64 };
       
    65 
       
    66 /**
       
    67  * PS Keyboard Modes
       
    68  */
       
    69 enum TKeyboardModes
       
    70 {
       
    71     /**
       
    72      * Predictive matching mode with default keyboard. 
       
    73      * The key mappings used are either those of the first available
       
    74      * hardware keyboard or those of virtual-ITU-T if no hardware keyboard
       
    75      * is available.
       
    76      */
       
    77     EPredictiveDefaultKeyboard = 0,
       
    78     
       
    79     /**
       
    80      * Non-predictive matching mode.
       
    81      * Keyboard mappings of any kind are not used. Entered characters are
       
    82      * matched just as themselves, but using locale specific tolerant
       
    83      * matching rules (i.e. the collated comparison).
       
    84      */
       
    85     ENonPredictive = 1,
       
    86     
       
    87     /**
       
    88      * Predictive matching using 12-key ITU-T keymappings.
       
    89      */
       
    90     EPredictiveItuT = 2,
       
    91     
       
    92     /**
       
    93      * Predictive matching using hardware QWERTY key mappings.
       
    94      * Also half-QWERTY is here considered as QWERTY.
       
    95      */
       
    96     EPredictiveQwerty = 3,
       
    97     
       
    98     // These modes are provided for backward source and binary compatibility.
       
    99     EItut = EPredictiveDefaultKeyboard,  //! deprecated
       
   100     EQwerty = ENonPredictive,            //! deprecated
       
   101     
       
   102     EModeUndefined = -1
       
   103 };
       
   104 
       
   105 /**
       
   106  * Different states of Caching
       
   107  */
       
   108 enum TCachingStatus
       
   109 {
       
   110     ECachingNotStarted          =  0,
       
   111     ECachingInProgress          = 10,
       
   112     ECachingComplete            = 20,
       
   113     ECachingCompleteWithErrors  = 30,
       
   114     ECacheUpdateContactRemoved  = 40,
       
   115     ECacheUpdateContactModified = 50,
       
   116     ECacheUpdateContactAdded    = 60
       
   117 };
       
   118 
       
   119 /**
       
   120  * Different sort types
       
   121  */
       
   122 enum TSortType
       
   123 {
       
   124     EPatternBased,
       
   125     EAlphabetical
       
   126 };
       
   127 
       
   128 /**
       
   129  * PCS Plugin Interface UID
       
   130  */
       
   131 const TUid KPcsPluginInterfaceUid   = { 0x2000B5BD };
       
   132 const TUid KPcsAlgorithm1           = { 0x2000B5BE };
       
   133 const TUid KPsDataStoreInterfaceUid = { 0x2000B5C0 };
       
   134 
       
   135 const TInt KLinksToFetchInOneGo = 20;
       
   136 
       
   137 /**
       
   138  * Max number of supported languages for Key Map
       
   139  */
       
   140 const TInt KMaxNbrOfLangKeymapping = 10;
       
   141 
       
   142 /**
       
   143  * Central Repository constants
       
   144  */
       
   145 const TInt KCRMaxLen = 255;
       
   146 const TInt KPsQueryMaxLen = 150;
       
   147 const TInt KBufferMaxLen = 255;
       
   148 const TInt KSearchResultsBufferLen = 8192;
       
   149 const TInt KPsAdaptiveGridSupportedMaxLen = 0; // Max Len of input Search Text
       
   150 const TInt KPsAdaptiveGridStringMaxLen = 255; // Max Len of returned Adaptive Grid String
       
   151 
       
   152 /**
       
   153  * Data Stores Constants 
       
   154  */
       
   155 _LIT(KVPbkDefaultCntDbURI, "cntdb://c:contacts.cdb"); // Phone Store
       
   156 _LIT(KVPbkSimGlobalAdnURI, "sim://global_adn");       // SIM ADN Store
       
   157 _LIT(KVPbkSimGlobalFdnURI, "sim://global_fdn");       // SIM FDN Store
       
   158 _LIT(KVPbkSimGlobalSdnURI, "sim://global_sdn");       // SIM SDN Store
       
   159 _LIT(KVPbkDefaultGrpDbURI, "cntdb://c:contacts.gdb"); // Groups Store
       
   160 
       
   161 /**
       
   162  * Data Structure to identify the matched locations
       
   163  */
       
   164 struct TPsMatchLocation
       
   165 {
       
   166 	public:
       
   167 		TInt index;   						  // Starting index for the match sequence
       
   168 		TInt length;  						  // Lenght of the match sequence
       
   169 		TBidiText::TDirectionality direction; // Directionality for the sequence
       
   170 };
       
   171 
       
   172 /**
       
   173  * Character constants
       
   174  */
       
   175 const TInt KUnitSeparator  = 31;
       
   176 const TInt KSpaceCharacter = 32;
       
   177 
       
   178 /**
       
   179  * Publish & Subscribe ID and keys for internal use of PCS
       
   180  */
       
   181 const TUid KPcsInternalUidCacheStatus = {0x2000B5B6};
       
   182 enum TPcsInternalKeyCacheStatus
       
   183     {
       
   184     EPsKeyCacheStatus            = 0,
       
   185     EPsKeyCacheError             = 1,
       
   186     EPsKeyContactRemovedCounter  = 2,
       
   187     EPsKeyContactModifiedCounter = 3,
       
   188     EPsKeyContactAddedCounter    = 4
       
   189     };
       
   190 
       
   191 
       
   192 #endif // __PCSSERVERDEFS_H__
       
   193 
       
   194 // End of file