creator/engine/inc/creator_messageelement.h
changeset 55 2d9cac8919d3
parent 53 819e59dfc032
child 56 392f7045e621
equal deleted inserted replaced
53:819e59dfc032 55:2d9cac8919d3
     1 /*
       
     2 * Copyright (c) 2010 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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CREATORMESSAGEELEMENT_H_
       
    21 #define CREATORMESSAGEELEMENT_H_
       
    22 
       
    23 #include "creator_scriptelement.h"
       
    24 #include "creator_message.h"
       
    25 
       
    26 namespace creatormsg
       
    27 {
       
    28     _LIT(KMessage, "message");
       
    29     _LIT(KType, "type");
       
    30     _LIT(KTo, "to");
       
    31     _LIT(KFrom, "from");
       
    32     _LIT(KFolder, "folder");
       
    33     _LIT(KSubject, "subject");
       
    34     _LIT(KText, "text");
       
    35     _LIT(KAttachmentPath, "attachmentpath");
       
    36     _LIT(KAttachmentId, "attachmentid");
       
    37     _LIT(KStatus, "status");
       
    38     _LIT(KSms, "sms");
       
    39     _LIT(KMms, "mms");
       
    40     _LIT(KAms, "ams");
       
    41     _LIT(KEmail, "email");
       
    42     _LIT(KSmart, "smart");
       
    43     _LIT(KBt, "bt");
       
    44     _LIT(KIr, "ir");
       
    45     _LIT(KSent, "sent");
       
    46     _LIT(KInbox, "inbox");
       
    47     _LIT(KDraft, "draft");
       
    48     _LIT(KOutbox, "outbox");
       
    49     _LIT(KMailbox, "mailbox");
       
    50     _LIT(KRead, "read");
       
    51     _LIT(KNew, "new");
       
    52 }
       
    53 
       
    54 /*
       
    55  * Builds message parameters from the parsed script and adds a command to the engine 
       
    56  */
       
    57 class CCreatorMessageElement : public CCreatorScriptElement
       
    58 {
       
    59 public:
       
    60     static CCreatorMessageElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
       
    61     void ExecuteCommandL();
       
    62 protected:    
       
    63     CCreatorMessageElement(CCreatorEngine* aEngine);
       
    64     /*
       
    65      * Creates message address. The address type is based on the message type.
       
    66      * @return Phone number string for SMS, MMS, AMS and Smart messages. Email address for other types.
       
    67      * @param msgType Message type.
       
    68      */
       
    69     HBufC* CreateMessageAddressLC(const TDesC& msgType);
       
    70     /*
       
    71      * Sets message type to parameters
       
    72      * @param aParameters Message parameters
       
    73      * @param aMsgTypeStr Message type string
       
    74      */
       
    75     void SetMessageTypeL(CMessagesParameters& aParameters, const TDesC& aMsgTypeStr ) const;
       
    76     /*
       
    77      * Gets length of the random data
       
    78      * @return Length of the random data
       
    79      * @param aRandomLenStr String defining the random length (from the script)
       
    80      * @param aMsgType Message type string
       
    81      */
       
    82     TInt GetRandomBodyLengthL(const TDesC& aRandomLenStr, const TDesC& aMsgType ) const;
       
    83     /*
       
    84      * Gets maximum length of the body text
       
    85      * @return Maximum length of the body text
       
    86      * @param aMsgType Message type string
       
    87      */
       
    88     TInt GetMaxBodyLength( const TDesC& aMsgType ) const;
       
    89 
       
    90 };
       
    91     
       
    92 
       
    93 #endif /*CREATORMESSAGEELEMENT_H_*/