omaprovisioning/provisioning/ProvisioningHandler/Inc/CWPMessage.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Main class for handling provisioning message
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CWPMESSAGE_H
       
    21 #define CWPMESSAGE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <msvapi.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CWPPushMessage;
       
    29 class MWPPhone;
       
    30 class CPushMessage;
       
    31 class CDesC16Array;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * CWPMessage handles a provisioning message.
       
    37  * @library ProvisioningHandler.dll
       
    38  */ 
       
    39 class CWPMessage : public CBase,
       
    40     private MMsvSessionObserver
       
    41     {
       
    42     private:
       
    43         enum TAuthResult { EFailed, EMACSucceeded, EInitiatorSucceeded };
       
    44 
       
    45     public:  // Constructors and destructor
       
    46 
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         * @param aMessage The push message to use as base
       
    50         * @return The created CWPMessage object
       
    51         */
       
    52         static CWPMessage* NewL( CPushMessage& aMessage );
       
    53 
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         virtual ~CWPMessage();
       
    58 
       
    59     public:
       
    60         /**
       
    61         * Process the message.
       
    62         */
       
    63         void ProcessL();
       
    64 
       
    65     private: // From MMsvSessionObserver
       
    66 
       
    67         void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
       
    68 
       
    69     private:
       
    70         /**
       
    71         * C++ default constructor.
       
    72         */
       
    73         CWPMessage();
       
    74 
       
    75         /**
       
    76         * By default Symbian 2nd phase constructor is private.
       
    77         * @param aMessage The push message to use as base
       
    78         */
       
    79         void ConstructL( CPushMessage& aMessage );
       
    80 
       
    81     private:
       
    82 
       
    83         /**
       
    84         * Retrieves the UID of the BIO message type.
       
    85         * @param aMessage The message whose content type to look
       
    86         */
       
    87         void BioMessageTypeL( CPushMessage& aMessage );
       
    88 
       
    89         /**
       
    90         * Stores the message into Messaging Server.
       
    91         */
       
    92         void StoreMsgL();
       
    93 
       
    94         /**
       
    95         * Stores an SMS message into Messaging Server.
       
    96         * @param aResource The text to use
       
    97         */
       
    98         void StoreMsgL( TInt aResource );
       
    99 
       
   100         /**
       
   101         * Stores an SMS message into Messaging Server based on Class0.
       
   102         * @param aResource The text to use
       
   103         */
       
   104         void StoreMsgclass0L( TInt aResource );
       
   105         
       
   106         /**
       
   107         * Prepares a TMsvEntry for saving. Leaves a string
       
   108         * to CleanupStack.
       
   109         * @param aEntry Entry to prepare
       
   110         */
       
   111         void PrepareEntryLC( TMsvEntry& aEntry );
       
   112 
       
   113         /**
       
   114         * Completes processing a message entry.
       
   115         * @param aCEntry The CMsvEntry to change
       
   116         * @param aTEntry The corresponding TMsvEntry
       
   117         */
       
   118         void PostprocessEntryL( CMsvEntry& aCEntry, TMsvEntry& aTEntry );
       
   119 
       
   120         /**
       
   121         * Loads a string from resource file.
       
   122         * @param aResource The resource ID
       
   123         */
       
   124         HBufC* LoadStringLC( TInt aResourceId );
       
   125 
       
   126     private:  // Data
       
   127         /// ETel interface
       
   128         MWPPhone* iPhone;
       
   129 
       
   130         /// Session to Messaging Server. Owns.
       
   131         CMsvSession* iSession;
       
   132 
       
   133         /// Sender address. Owns.
       
   134         HBufC8* iSender;
       
   135 
       
   136         /// ETrue if the message contains bootstrap characteristic
       
   137         TBool iBootstrap;
       
   138 
       
   139         /// Push message header and contents. Refs.
       
   140         CWPPushMessage* iMessage;
       
   141 
       
   142         /// BIO uid
       
   143         TUid iBioUID;
       
   144     };
       
   145 
       
   146 #endif  // CWPMESSAGE_H
       
   147             
       
   148 // End of File