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