wvuing/wvuieng/EngInc/MCAChatInterface.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004-2005 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:  Interface for getting access to message containers.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MCACHATINTERFACE_H
       
    20 #define MCACHATINTERFACE_H
       
    21 
       
    22 #include "impsbuilddefinitions.h"
       
    23 #include "MCAMessagesReadInterface.h"
       
    24 
       
    25 //	FORWARD CLASS DECLERATIONS
       
    26 class MCAMessagesWriteInterface;
       
    27 class MCABufferMemoryHandler;
       
    28 class MCAMessageCreator;
       
    29 class MCAChatObserver;
       
    30 class MCAMessageContainerInfo;
       
    31 
       
    32 /**
       
    33  * Internal buffer ids, these must be specified so that they can't appear in
       
    34  * wireless village ids. And they must also be non-matchable to KNullDesC when
       
    35  * comparing with neutral compare.
       
    36  *
       
    37  * From WV_CSP_v1.1.pdf:
       
    38  *   As per URI [RFC2396], certain reserved characters must be escaped if they
       
    39  *   occur within the User-ID, Resource, or Domain portions of a Wireless
       
    40  *   Village address. This includes the characters
       
    41  *   ";", "?", ":", "&", "=", "+", "$" and ",".
       
    42  *
       
    43  * When using neutral compare, atleast ";", "?", ":", "&", "=", "+", "#" and ","
       
    44  * are invalid.
       
    45  */
       
    46 _LIT( KSendBufferId, "$" );
       
    47 _LIT( KLoggerBufferId, "$$" );
       
    48 
       
    49 // CLASS DECLARATION
       
    50 
       
    51 /**
       
    52  *  Interface for getting access to message containers.
       
    53  *
       
    54  *  @lib CAEngine.dll
       
    55  *  @since 3.0
       
    56  */
       
    57 class MCAChatInterface
       
    58     {
       
    59     public: // Interface
       
    60 
       
    61         /**
       
    62          * Provide access to chat messages. If messageContainer does not exists
       
    63          * creates one.
       
    64          * @param aServerAddress Part of identifier to identify container.
       
    65          * @param aUserId Part of identifier to identify container.
       
    66          * @param aTargetId Part of identifier to identify container.
       
    67          * @param aType. Preferred type of container. If ENoneContainer,
       
    68          *               resolved by container.
       
    69          * @return Read interface to container
       
    70          */
       
    71         virtual MCAMessagesReadInterface& MessageReadInterfaceL(
       
    72             const TDesC& aServerAddress,
       
    73             const TDesC& aUserId,
       
    74             const TDesC& aTargetId = KSendBufferId,
       
    75             MCAMessagesReadInterface::TContainerType aType =
       
    76                 MCAMessagesReadInterface::ENoneContainer ) = 0;
       
    77 
       
    78         /**
       
    79          * Provide access to append chat messages.
       
    80          * If messageContainer does not exists, creates one.
       
    81          * @param aServerAddress Part of identifier to identify container.
       
    82          * @param aUserId Part of identifier to identify container.
       
    83          * @param aTargetId Part of identifier to identify container.
       
    84          * @param aType. Preferred type of container. If ENoneContainer,
       
    85          *               resolved by container.
       
    86          * @return Write interface to container
       
    87          */
       
    88         virtual MCAMessagesWriteInterface& MessageWriteInterfaceL(
       
    89             const TDesC& aServerAddress,
       
    90             const TDesC& aUserId,
       
    91             const TDesC& aTargetId = KSendBufferId,
       
    92             MCAMessagesReadInterface::TContainerType aType =
       
    93                 MCAMessagesReadInterface::ENoneContainer ) = 0;
       
    94 
       
    95         /**
       
    96          * Delete identified chat container
       
    97          * @param aServerAddress Part of identifier to identify container.
       
    98          * @param aUserId Part of identifier to identify container.
       
    99          * @param aTargetId Part of identifier to identify container.
       
   100          */
       
   101         virtual void DeleteChatL( const TDesC& aServerAddress,
       
   102                                   const TDesC& aUserId,
       
   103                                   const TDesC& aTargetId = KSendBufferId ) = 0;
       
   104 
       
   105 
       
   106         /**
       
   107          * Close all open containers.
       
   108          */
       
   109         virtual void CloseAllContainers() = 0;
       
   110 
       
   111         /**
       
   112          * Check if chat exists or not.
       
   113          * @param aServerAddress Part of identifier to identify container.
       
   114          * @param aUserId Part of identifier to identify container.
       
   115          * @param aTargetId Part of identifier to identify container.
       
   116          * @return Read interface if chat exists, NULL if not.
       
   117          */
       
   118         virtual MCAMessagesReadInterface* ChatExistsL(
       
   119             const TDesC& aServerAddress,
       
   120             const TDesC& aUserId,
       
   121             const TDesC& aTargetId = KSendBufferId ) = 0;
       
   122 
       
   123         /**
       
   124          * Change identifier of chat. Also type of container can be changed. If
       
   125          * old does not exists, creates new one.
       
   126          * @param aOldServerAddress Part of old identifier to identify container.
       
   127          * @param aOldUserId Part of old identifier to identify container.
       
   128          * @param aOldTargetId Part of old identifier to identify container.
       
   129          * @param aServerAddress Part of new identifier to identify container.
       
   130          * @param aUserId Part of new identifier to identify container.
       
   131          * @param aTargetId Part of new identifier to identify container.
       
   132          * @param aType. Preferred type of container. If ENoneContainer,
       
   133          *               Resolved by container.
       
   134          * @return Read interface to container
       
   135          */
       
   136         virtual MCAMessagesReadInterface& ChangeChatIdL(
       
   137             const TDesC& aOldServerAddress,
       
   138             const TDesC& aOldUserId,
       
   139             const TDesC& aOldTargetId,
       
   140             const TDesC& aNewServerAddress,
       
   141             const TDesC& aNewUserId,
       
   142             const TDesC& aNewTargetId = KSendBufferId,
       
   143             MCAMessagesReadInterface::TContainerType aType =
       
   144                 MCAMessagesReadInterface::ENoneContainer  ) = 0;
       
   145 
       
   146         /**
       
   147          * Get count of group chats.
       
   148          * @return count of group chats.
       
   149          */
       
   150         virtual TInt GroupCount() const = 0;
       
   151 
       
   152         /**
       
   153          * Get count of ptop chats.
       
   154          * @return Count of ptop chats.
       
   155          */
       
   156         virtual TInt ChatCount() const = 0;
       
   157 
       
   158         /**
       
   159          * Get group chat
       
   160          * @param aIndex, Index of chat to get.
       
   161          * @return Read interface based on index.
       
   162          */
       
   163         virtual MCAMessagesReadInterface& GroupAt( TInt aIndex ) const = 0;
       
   164 
       
   165         /**
       
   166          * Get ptop chat
       
   167          * @param aIndex, Index of chat to get.
       
   168          * @return Read interface based on index.
       
   169          */
       
   170         virtual MCAMessagesReadInterface& ChatAt( TInt aIndex ) const = 0;
       
   171 
       
   172         /**
       
   173          * Register observer for chat events. Remember to unregister
       
   174          * when not needed
       
   175          * @param aObserver Observer which is registered.
       
   176          * @return KErrNone if succeed.
       
   177          */
       
   178         virtual TInt RegisterChatObserver( MCAChatObserver* aObserver ) = 0;
       
   179 
       
   180         /**
       
   181          * Unregister observer for chat events.
       
   182          * @param aObserver Observer which is unregistered
       
   183          * @return KErrNone if found and unregistered.
       
   184          */
       
   185         virtual TInt UnregisterChatObserver( MCAChatObserver* aObserver ) = 0;
       
   186 
       
   187         /**
       
   188          * Reset count of pending messages
       
   189          */
       
   190         virtual void ResetPendingCount() = 0;
       
   191 
       
   192         /**
       
   193          * Count of pending messages
       
   194          * @param aCountOfChats. Count of different chats having pending
       
   195          *                       messages
       
   196          * @param aUnreadFilter Count all messages or just received messages
       
   197          * @return count of messages.
       
   198          */
       
   199         virtual TInt MessagesPendingCount( TInt& aCountOfChats,
       
   200                                            MCAMessagesReadInterface::TUnreadFilter aUnreadFilter =
       
   201                                                MCAMessagesReadInterface::EUnreadAll ) const = 0;
       
   202 
       
   203         /**
       
   204          * First pending message containers info.
       
   205          * @return First pending message containers info.
       
   206          */
       
   207         virtual MCAMessageContainerInfo* PendingMessageInfo() const = 0;
       
   208 
       
   209 #ifdef RD_CHAT_GROUP_MESSAGE_INDICATION_NEW
       
   210         /**
       
   211          * Count of unread chat group messages.
       
   212          * @param aCountOfChats. Count of different chats having pending
       
   213          *                       messages
       
   214          * @since S60 v3.2
       
   215          * @return count of messages.
       
   216          */
       
   217         virtual TInt ChatGroupMessagesPendingCount( TInt& aCountOfChats ) const = 0;
       
   218 
       
   219         /**
       
   220          * First pending message containers info.
       
   221          * @return First pending message containers info of group Chat.
       
   222          */
       
   223         virtual MCAMessageContainerInfo* ChatGroupPendingMessageInfo() const = 0 ;
       
   224 
       
   225 #endif  // RD_CHAT_GROUP_MESSAGE_INDICATION_NEW
       
   226 
       
   227     };
       
   228 
       
   229 #endif      // MCACHATINTERFACE_H
       
   230 
       
   231 // End of File