emailservices/emailstore/message_store/common/inc/MessageStoreClientServer.h
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Message store client server comunication definitions.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __MESSAGE_STORE_CLIENT_SERVER_H__
       
    21 #define __MESSAGE_STORE_CLIENT_SERVER_H__
       
    22 
       
    23 // ========
       
    24 // INCLUDES
       
    25 // ========
       
    26 
       
    27 #include <e32std.h>
       
    28 //<cmail>
       
    29 #include "MsgStoreTypes.h"
       
    30 #include "MsgStoreAccount.h"
       
    31 //</cmail>
       
    32 
       
    33 // =========
       
    34 // CONSTANTS
       
    35 // =========
       
    36 
       
    37 _LIT( KMsgStoreServerName, "MessageStoreServer" );
       
    38 
       
    39 const TInt KMsgStoreMajorVersion = 0;
       
    40 const TInt KMsgStoreMinorVersion = 1;
       
    41 const TInt KMsgStoreBuild        = 0;
       
    42 
       
    43 // =====================
       
    44 // FUNCTION DECLARATIONS
       
    45 // =====================
       
    46 
       
    47 // If aParams == NULL then this function does a thread rendezvous to signal the client, otherwise it
       
    48 // does a process rendezvous.
       
    49 IMPORT_C TInt MessageStoreServerThreadFunction( TAny* aParams );
       
    50 
       
    51 // ================================================================
       
    52 // Definition of acceptable commands that can be sent to the server
       
    53 // ================================================================
       
    54 enum TMsgStoreMessages
       
    55 	{
       
    56     
       
    57     // These commands should be accessible only in debug builds
       
    58     EMsgStoreCmdShutdownServer       = 0,
       
    59     EMsgStoreCmdInjectBackupRestoreEvent, 
       
    60     EMsgStoreCmdInjectPointSecEvent,      
       
    61     EMsgStoreCmdSimulateLowDiskSpace,     
       
    62     EMsgStoreCmdGetEncryptionState,
       
    63     
       
    64     
       
    65 	// The following messages do not require any platform security capabilities to use.
       
    66     EMsgStoreCmdAuthenticated        = 100,
       
    67     EMsgStoreCmdClearAuthentication,
       
    68     EMsgStoreCmdChildrenCounts,
       
    69     EMsgStoreCmdTotalCounts,
       
    70     EMsgStoreCmdChildrenIds,
       
    71     EMsgStoreCmdContentLength,
       
    72 	EMsgStoreCmdStartObserving,
       
    73 	EMsgStoreCmdGetEvents,
       
    74 	EMsgStoreCmdStopObserving,	
       
    75 	EMsgStoreCmdCancelSearch,
       
    76     EMsgStoreCmdClearSearchResultCache,
       
    77     EMsgStoreCmdGetIteratorGroupCount,
       
    78     EMsgStoreCmdGetIteratorIdsAndFlags,
       
    79     EMsgStoreCmdSortedIndexOf,
       
    80     EMsgStoreCmdGetIteratorIds,
       
    81     EMsgStoreCmdGetIteratorIdsAndGroupCount,
       
    82     EMsgStoreCmdEndSorting,
       
    83 
       
    84     // The following messages require ECapabilityReadUserData to use.
       
    85 
       
    86     EMsgStoreCmdAuthenticate,
       
    87     EMsgStoreCmdHasPassword,
       
    88 	EMsgStoreCmdOpenAccount,
       
    89 	EMsgStoreCmdListAccounts,
       
    90     EMsgStoreCmdPropertiesList,
       
    91     EMsgStoreCmdFetchProperties,
       
    92     EMsgStoreCmdFetchContentToBuffer,
       
    93     EMsgStoreCmdFetchContentToFile,
       
    94 	EMsgStoreCmdPrepareSearch,
       
    95 	EMsgStoreCmdGetMatches,
       
    96     EMsgStoreCmdGetSortedRows,
       
    97     EMsgStoreCmdOpenContentFile,
       
    98     EMsgStoreCmdGetMruAddressList,
       
    99     
       
   100     // The following messages require ECapabilityWriteUserData to use.
       
   101     
       
   102     EMsgStoreCmdEnableEncryption,
       
   103     EMsgStoreCmdDisableEncryption,
       
   104     EMsgStoreCmdSetPassword,
       
   105     EMsgStoreCmdChangePassword,
       
   106     EMsgStoreCmdCreateAccount,
       
   107     EMsgStoreCmdRenameAccount,
       
   108     EMsgStoreCmdDeleteAccount,
       
   109 	EMsgStoreCmdCreateContainer,
       
   110 	EMsgStoreCmdCommitContainer,
       
   111 	EMsgStoreCmdAbandonContainer,
       
   112 	EMsgStoreCmdMoveContainer,
       
   113 	EMsgStoreCmdCopyContainer,
       
   114     EMsgStoreCmdDeleteContainer,
       
   115     EMsgStoreCmdUpdateProperties,
       
   116     EMsgStoreCmdUpdateProperty,
       
   117     EMsgStoreCmdReplaceContentWithBuffer,
       
   118     EMsgStoreCmdReplaceContentWithFile,
       
   119     EMsgStoreCmdAppendToContent,
       
   120     EMsgStoreCmdPrependToContent,
       
   121     EMsgStoreCmdRemoveContent,
       
   122     EMsgStoreCmdStartSorting,
       
   123     EMsgStoreCmdSetMaxMruAddressCount,
       
   124     EMsgStoreCmdSetMruAddressList,
       
   125     EMsgStoreCmdBeginBatchInsert,
       
   126     EMsgStoreCmdFinishBatchInsert,
       
   127     EMsgStoreCmdWipeEverything
       
   128   	};
       
   129 
       
   130 const TMsgStoreMessages KMsgStoreCmdAlwaysPass          = EMsgStoreCmdAuthenticated;
       
   131 const TMsgStoreMessages KMsgStoreCmdFirstReadUserData   = EMsgStoreCmdAuthenticate;
       
   132 const TMsgStoreMessages KMsgStoreCmdFirstWriteUserData  = EMsgStoreCmdSetPassword;
       
   133 const TMsgStoreMessages KMsgStoreCmdLast                = EMsgStoreCmdWipeEverything;
       
   134 
       
   135 
       
   136 // The first 4 bits of the message ID are used to encode the type of the container.
       
   137 enum TMsgStoreContainerMasks
       
   138 	{
       
   139 	EMsgStoreMailBoxBits    = 0x00000000,
       
   140 	EMsgStoreFolderBits     = 0x10000000,
       
   141 	EMsgStoreMessageBits    = 0x20000000,
       
   142 	EMsgStorePartBits       = 0x30000000,
       
   143 	EMsgStoreContainerMask  = 0xF0000000,
       
   144 	};
       
   145 
       
   146 struct TMsgStoreCounts
       
   147 	{
       
   148 	TUint iMessagesCount;
       
   149 	TUint iUnreadCount;
       
   150 	};
       
   151 	
       
   152 const TUint KMsgStoreCountsLength = sizeof(TMsgStoreCounts);
       
   153 
       
   154 // iType will be a value of TMsgStoreOperation, TMsgStoreSystemEvent, or TMsgStoreAccountEvent
       
   155 // For system events, only the type field is used.
       
   156 struct TMsgStoreEvent
       
   157 	{
       
   158 	TMsgStoreId iMailBoxId;
       
   159 	TUint       iType;
       
   160 	TMsgStoreId iId;
       
   161 	TMsgStoreId iParentId;
       
   162 	TMsgStoreId iOtherId;
       
   163 	TUint32     iFlags;	
       
   164 	TBuf8<KMaxAccountNameLen> iAccountName;
       
   165 	TBuf8<KMaxAccountNameLen> iNewAccountName;   //for rename account only
       
   166 	}; // end TMsgStoreEvent
       
   167     
       
   168 struct TMsgStoreCopyContainerCmdParams
       
   169     {    
       
   170     TMsgStoreId iId;
       
   171     TMsgStoreId iSourceId;
       
   172     TMsgStoreId iSourceParentId;
       
   173     TMsgStoreId iDestinationId;
       
   174     TMsgStoreId iDestinationParentId;
       
   175 	TMsgStoreId iMailBoxId;
       
   176     }; // end TMsgStoreCopyContainerCmdParams
       
   177     
       
   178 struct TMsgStoreFetchPropertiesCmdParams
       
   179 	{
       
   180 	TMsgStoreId iId;
       
   181 	TMsgStoreId iGrandparentId;
       
   182 	TMsgStoreId iMailboxId;
       
   183 	}; // end TMsgStoreFetchPropertiesCmdParams
       
   184 	
       
   185 struct TMsgStorePropertiesListCmdParams
       
   186 	{
       
   187 	// input parameters
       
   188 	TBool iStartOver;
       
   189 	TBool iUseQuery;
       
   190 	TBool iQuickProperties; // only supported if iUseQuery = ETrue
       
   191 	
       
   192 	// output parameters
       
   193 	TBool iMoreProperties;     
       
   194 	TBool iClearExisting;
       
   195 	TUint iNewBufferSize;
       
   196 	}; // end TMsgStoreChildrenPropertiesCmdParams
       
   197 
       
   198 struct TMsgStorePropertiesListQueryParams
       
   199 	{
       
   200 	TMsgStoreId             iId;        
       
   201 	TMsgStoreId             iParentId;  
       
   202 	TMsgStoreContainerMasks iType;      
       
   203 	TBool                   iRecursive; 
       
   204 	}; // end TMsgStoreChildrenPropertiesCmdParams
       
   205 
       
   206 struct TMsgStoreCreateContainerCmdParams
       
   207 	{
       
   208 	TMsgStoreId             iParentId;
       
   209 	TMsgStoreId             iGrandparentId;
       
   210 	TMsgStoreId             iMailBoxId;
       
   211 	TBool                   iCommitContainer;
       
   212 	TMsgStoreContainerMasks iType;
       
   213 	TBool                   iHasContent;
       
   214 	TMsgStoreId             iId;  // out parameter
       
   215 	}; // end TMsgStoreCreateContainerCmdParams
       
   216 	
       
   217 struct TMsgStoreUpdatePropertyCmdParams
       
   218 	{
       
   219 	TMsgStoreId iId;
       
   220 	TMsgStoreId iParentId;
       
   221 	TMsgStoreId iMailBoxId;
       
   222 	TUint8      iType;
       
   223 	}; // end TMsgStoreUpdatePropertyCmdParams
       
   224 	
       
   225 struct TMsgStoreOpenAccountCmdParams
       
   226 	{
       
   227 	TInt32       iOwnerId;
       
   228 	TMsgStoreId  iMailBoxId;
       
   229 	}; // end TMsgStoreOpenAccountCmdParams
       
   230     
       
   231 /** Defines the search criteria (not including the leading string to be ignored ) */
       
   232 struct TMsgStoreSortCriteria 
       
   233     {
       
   234     /** Specifies the mailbox id
       
   235      */
       
   236     TMsgStoreId          iMailBoxId;
       
   237     
       
   238     /** Specifies the folder in which the sorting is to be perform
       
   239      */
       
   240     TMsgStoreId          iFolderId;
       
   241     
       
   242     /** Specifies the sort field
       
   243      */
       
   244     TMsgStoreSortByField iSortBy;
       
   245     
       
   246     /** Specifies the sort order
       
   247      */
       
   248     TMsgStoreSortOrder   iSortOrder;
       
   249     
       
   250     /** defines the order for the secondary field (received date) when primary field is NOT EMsgStoreSortByReceivedDate
       
   251      */
       
   252     TMsgStoreSortOrder   iSecondarySortOrder;  
       
   253     };
       
   254     
       
   255 struct TMsgStoreGetSortedRowsCmdParams
       
   256     {
       
   257     TMsgStoreId                 iSortSessionId;
       
   258     TMsgStoreId                 iStartingMessageId;
       
   259     TMsgStoreIteratorDirection  iDirection;
       
   260     TUint                       iRowsToRetrieve;
       
   261     TBool                       iHasStartWith;
       
   262     TBool                       iSkipCurrentGroup;
       
   263     TBool                       iHasMoreRows;
       
   264     };
       
   265     
       
   266 struct TMsgStoreSearchCmdParams
       
   267     {
       
   268     TUint                 iSearchFields;
       
   269     TMsgStoreSortByField  iSortBy;
       
   270     TMsgStoreSortOrder    iSortOrder;
       
   271     TMsgStoreSortOrder    iSecondarySortOrder;  
       
   272     };
       
   273 
       
   274 #endif // __MESSAGE_STORE_CLIENT_SERVER_H__
       
   275 
       
   276 
       
   277