|
1 /* |
|
2 * Copyright (c) 2009 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 #ifndef NMACTIONRESPONSE_H_ |
|
19 #define NMACTIONRESPONSE_H_ |
|
20 |
|
21 #include "nmactionobserver.h" |
|
22 #include "nmactionrequest.h" |
|
23 |
|
24 /*! |
|
25 \enum NmActionResponseCommand |
|
26 \brief This value indicates response command of the action |
|
27 \ Add more commands when use cases need those |
|
28 */ |
|
29 enum NmActionResponseCommand |
|
30 { |
|
31 NmActionResponseCommandNone = 0, |
|
32 NmActionResponseCommandOpen, |
|
33 NmActionResponseCommandNewMail, |
|
34 NmActionResponseCommandSendMail, |
|
35 NmActionResponseCommandPriorityHigh, |
|
36 NmActionResponseCommandPriorityLow, |
|
37 NmActionResponseCommandForward, |
|
38 NmActionResponseCommandAttach, |
|
39 NmActionResponseCommandReply, |
|
40 NmActionResponseCommandReplyAll, |
|
41 NmActionResponseCommandDeleteMail, |
|
42 NmActionResponseCommandUpdateMailboxName, |
|
43 NmActionResponseCommandMailboxDeleted, |
|
44 NmActionResponseCommandRemoveAttachment, |
|
45 NmActionResponseCommandOpenAttachment, |
|
46 NmActionResponseCommandSearch, |
|
47 NmActionResponseCommandSwitchFolder, |
|
48 NmActionResponseCommandSettings |
|
49 }; |
|
50 |
|
51 |
|
52 /*! |
|
53 \class NmActionResponse |
|
54 \brief Extension calls NmActionObserver to handle NmAction command. |
|
55 \Response should encapsulated using this class and relayed to observer. |
|
56 */ |
|
57 class NmActionResponse |
|
58 { |
|
59 public: |
|
60 inline NmActionResponse(NmActionResponseCommand responseCommand, |
|
61 NmActionContextMenuType menuType=NmActionOptionsMenu, |
|
62 NmActionContextView contextView=NmActionContextViewNone, |
|
63 NmId mailboxId=0, |
|
64 NmId folderId=0, |
|
65 NmId messageId=0 |
|
66 ) |
|
67 : mResponseCommand(responseCommand), |
|
68 mMenuType(menuType), |
|
69 mContextView(contextView), |
|
70 mMailboxId(mailboxId), |
|
71 mFolderId(folderId), |
|
72 mMessageId(messageId) { }; |
|
73 |
|
74 inline NmActionResponse(NmActionResponseCommand responseCommand, |
|
75 const NmActionRequest &actionRequest) |
|
76 : mResponseCommand(responseCommand), |
|
77 mMenuType(actionRequest.menuType()), |
|
78 mContextView(actionRequest.contextView()), |
|
79 mMailboxId(actionRequest.mailboxId()), |
|
80 mFolderId(actionRequest.folderId()), |
|
81 mMessageId(actionRequest.messageId()) { }; |
|
82 |
|
83 inline NmActionResponseCommand responseCommand() const {return mResponseCommand;} |
|
84 inline NmActionContextMenuType menuType() const {return mMenuType;} |
|
85 inline NmActionContextView contextView()const {return mContextView;} |
|
86 inline NmId mailboxId()const {return mMailboxId;} |
|
87 inline NmId folderId() const {return mFolderId;} |
|
88 inline NmId messageId() const {return mMessageId;} |
|
89 |
|
90 private: |
|
91 NmActionResponseCommand mResponseCommand; |
|
92 NmActionContextMenuType mMenuType; |
|
93 NmActionContextView mContextView; |
|
94 NmId mMailboxId; |
|
95 NmId mFolderId; |
|
96 NmId mMessageId; |
|
97 }; |
|
98 |
|
99 |
|
100 #endif /* NMMENURESPONSE_H_ */ |