wvuing/wvuieng/EngSrc/CCAInvitation.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Used when inviting to chats.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CCAINVITATION_H
       
    20 #define CCAINVITATION_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "MCAInvitation.h"
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29 *  Describes one invitation.
       
    30 *  Used when inviting to chats.
       
    31 *
       
    32 *  @lib CAEngine.lib
       
    33 *  @since 1.2
       
    34 */
       
    35 class CCAInvitation : public CBase, public MCAInvitation
       
    36     {
       
    37     public:  // Constructors and destructor
       
    38 
       
    39         /**
       
    40         * Two-phased constructor.
       
    41         * @param aIviteID specifies one invitation.
       
    42         * @param aUserID is the WVID.
       
    43         * @param aGroupID specifies the wv group id.
       
    44         * @param aScreenName is the screen name in a particular group.
       
    45         * @param aGroupName specifies the group by name.
       
    46         * @param aMessage is the invitation message.
       
    47         * @param aValidityPeriod specifies the validity period of this
       
    48         *        invitation.
       
    49         */
       
    50         static CCAInvitation* NewL(
       
    51             const TDesC& aInviteID,
       
    52             const TDesC& aUserID,
       
    53             const TDesC& aGroupID,
       
    54             const TDesC& aScreenName,
       
    55             const TDesC& aGroupName,
       
    56             const TDesC& aMessage,
       
    57             TInt   aValidityPeriod = 0 );
       
    58 
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         virtual ~CCAInvitation();
       
    63 
       
    64     public: // New methods
       
    65 
       
    66         /**
       
    67          * Sets observer for invitation read.
       
    68          * @param aObserver Invitation read observer
       
    69          */
       
    70         void AddReadObserver( MCAInviteReadObserver* aObserver );
       
    71 
       
    72     private: // Methods from MCAInvitation
       
    73 
       
    74         /**
       
    75         * Gets the invitation ID.
       
    76         * @return Invite ID.
       
    77         */
       
    78         const TDesC& InviteID() const;
       
    79 
       
    80         /**
       
    81         * Gets the user ID.
       
    82         * @return User ID ( WV ID ).
       
    83         */
       
    84         const TDesC& UserID() const;
       
    85 
       
    86         /**
       
    87         * Gets the screen name.
       
    88         * @return Screen name.
       
    89         */
       
    90         const TDesC& ScreenName() const;
       
    91 
       
    92         /**
       
    93         * Gets the group name.
       
    94         * @return Group name.
       
    95         */
       
    96         const TDesC& GroupName() const;
       
    97 
       
    98         /**
       
    99         * Gets the group ID.
       
   100         * @return Group name.
       
   101         */
       
   102         const TDesC& GroupId() const;
       
   103 
       
   104         /**
       
   105         * Gets the invitation message.
       
   106         * @return Message.
       
   107         */
       
   108         const TDesC& Message() const;
       
   109 
       
   110         /**
       
   111         * Gets the timeout value.
       
   112         * @return Timeout value.
       
   113         */
       
   114         TInt Timeout() const;
       
   115 
       
   116         /**
       
   117          * Gets the time this invite was received (created)
       
   118          * @since 2.1
       
   119          * @return Time and date of creation
       
   120          */
       
   121         TTime ReceivedAt() const;
       
   122 
       
   123         /**
       
   124          * Set invitation as read.
       
   125          * @since 3.0
       
   126          */
       
   127         void SetInvitationAsReadL();
       
   128 
       
   129         /**
       
   130          * Set invitation as read.
       
   131          * @since 3.0
       
   132          */
       
   133         TBool IsRead() const;
       
   134 
       
   135     private: // New methods
       
   136 
       
   137         /**
       
   138         * C++ default constructor.
       
   139         * @param aValidityPeriod describes how long this invitation is valid.
       
   140         */
       
   141         CCAInvitation( TInt aValidityPeriod );
       
   142 
       
   143         /**
       
   144         * By default Symbian OS constructor is private.
       
   145         * @see CCAInvitation::NewL.
       
   146         */
       
   147         void ConstructL( const TDesC& aInviteID,
       
   148                          const TDesC& aUserID,
       
   149                          const TDesC& aGroupId,
       
   150                          const TDesC& aScreenName,
       
   151                          const TDesC& aGroupName,
       
   152                          const TDesC& aMessage );
       
   153 
       
   154     private:
       
   155 
       
   156         // Data
       
   157         TInt iTimeout;
       
   158         TTime iCreated;
       
   159 
       
   160         // Owns////////////////////////////////////////////////////////////////
       
   161         HBufC* iInviteID;
       
   162         HBufC* iUserID;
       
   163         HBufC* iGroupID;
       
   164         HBufC* iScreenName;
       
   165         HBufC* iGroupName;
       
   166         HBufC* iMessage;
       
   167         // ////////////////////////////////////////////////////////////////////
       
   168 
       
   169         TBool iRead;
       
   170 
       
   171         // Does not own
       
   172         MCAInviteReadObserver* iObserver;
       
   173     };
       
   174 
       
   175 #endif      // CCAINVITATION_H
       
   176 
       
   177 // End of File