cbs/CbsServer/ClientInc/ccbsmessageclientimpl.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     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:  This file contains the header file of the CCbsMessageClientImpl class.
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef     CCBSMESSAGECLIENTIMPL_H
       
    22 #define     CCBSMESSAGECLIENTIMPL_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include "CCbsMessageClient.h"
       
    27 #include "RCbs.h"
       
    28 
       
    29 //  CLASS DECLARATION 
       
    30 
       
    31 /**
       
    32 *   Implementation of CCbsMessageClient interface.
       
    33 *
       
    34 *   @lib CbsClient.lib
       
    35 *   @since 3.2
       
    36 */
       
    37 NONSHARABLE_CLASS( CCbsMessageClientImpl ) : public CCbsMessageClient
       
    38     {
       
    39     public:     // Construction
       
    40     
       
    41         /**
       
    42         *   Instantiates new CCbsMessageClientImpl object and establishes a session with
       
    43         *   CBS server. 
       
    44         *   
       
    45         *   Active scheduler has to be installed prior to calling this function.
       
    46         *
       
    47         *   @return                     A new instance of CCbsMessageClientImpl
       
    48         */
       
    49         static CCbsMessageClientImpl* NewL();
       
    50 
       
    51         /**
       
    52         *   Destructor.
       
    53         */
       
    54         ~CCbsMessageClientImpl();
       
    55 
       
    56     public:     // From base class
       
    57     
       
    58         /**
       
    59         *   Finds a message by given handle.
       
    60         *
       
    61         *   @see CCbsMessageClient::FindMessageByHandle
       
    62         */
       
    63         TInt FindMessageByHandle( 
       
    64             const TCbsMessageHandle& aHandle, 
       
    65             TCbsMessage& aMessage );
       
    66                 
       
    67         /**
       
    68         *   Finds the topic by the given number.
       
    69         *
       
    70         *   @see CCbsMessageClient::FindTopicByNumber
       
    71         */
       
    72         TInt FindTopicByNumber( TCbsTopicNumber aNumber,
       
    73             TCbsTopic& aTopic );
       
    74 
       
    75         /**
       
    76         *   Returns the total amount of topics the topic list contains.
       
    77         *
       
    78         *   @see CCbsMessageClient::TopicCount
       
    79         */        
       
    80         TInt TopicCount();
       
    81 
       
    82         /**
       
    83         *   Returns information about a topic from the topic list.
       
    84         *
       
    85         *   @see CCbsMessageClient::GetTopic
       
    86         */
       
    87         TInt GetTopic( const TInt aIndex, TCbsTopic& aTopic );
       
    88         
       
    89         /**
       
    90         *   Returns the total amount of unread messages.
       
    91         *
       
    92         *   @see CCbsMessageClient::UnreadMessageCount
       
    93         */
       
    94         TInt UnreadMessageCount();
       
    95         
       
    96         /**
       
    97         *   Returns the total amount of messages the topic contains.    
       
    98         *
       
    99         *   @see CCbsMessageClient::GetMessageCount
       
   100         */
       
   101         TInt GetMessageCount( TCbsTopicNumber aNumber,
       
   102             TInt& aCount );
       
   103                             
       
   104         /**
       
   105         *   Returns message information.
       
   106         *
       
   107         *   @see CCbsMessageClient::GetMessage
       
   108         */
       
   109         TInt GetMessage( TCbsTopicNumber aNumber, TInt aIndex,
       
   110             TCbsMessage& aMessage );
       
   111             
       
   112         /**
       
   113         *   Returns the message contents.
       
   114         *
       
   115         *   @see CCbsMessageClient::GetMessageContents
       
   116         */
       
   117         TInt GetMessageContents( 
       
   118             const TCbsMessageHandle& aHandle, 
       
   119             TDes& aBuffer );       
       
   120             
       
   121         /**
       
   122         *   Sets the message as read.
       
   123         *
       
   124         *   @see CCbsMessageClient::SetMessageAsRead
       
   125         */
       
   126         TInt SetMessageAsRead( const TCbsMessageHandle& aHandle );
       
   127                         
       
   128     private:
       
   129     
       
   130         /**
       
   131         *   Default constructor.
       
   132         */
       
   133         CCbsMessageClientImpl();
       
   134         
       
   135         /**
       
   136         *   2nd-phase constructor
       
   137         */
       
   138         void ConstructL();  
       
   139         
       
   140     private:    // Data
       
   141     
       
   142         // CBS Client API
       
   143         RCbs iCbsClient;        
       
   144     };
       
   145     
       
   146     
       
   147 
       
   148 #endif      //  CCBSMESSAGECLIENTIMPL_H   
       
   149             
       
   150 // End of File
       
   151 
       
   152