|
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 }; |
|
45 |
|
46 |
|
47 /*! |
|
48 \class NmActionResponse |
|
49 \brief Extension calls NmActionObserver to handle NmAction command. |
|
50 \Response should encapsulated using this class and relayed to observer. |
|
51 */ |
|
52 class NmActionResponse |
|
53 { |
|
54 public: |
|
55 inline NmActionResponse(NmActionResponseCommand responseCommand, |
|
56 NmActionContextMenuType menuType=NmActionOptionsMenu, |
|
57 NmActionContextView contextView=NmActionContextViewNone, |
|
58 NmId mailboxId=0, |
|
59 NmId folderId=0, |
|
60 NmId messageId=0 |
|
61 ) |
|
62 : mResponseCommand(responseCommand), |
|
63 mMenuType(menuType), |
|
64 mContextView(contextView), |
|
65 mMailboxId(mailboxId), |
|
66 mFolderId(folderId), |
|
67 mMessageId(messageId) { }; |
|
68 |
|
69 inline NmActionResponse(NmActionResponseCommand responseCommand, |
|
70 const NmActionRequest &actionRequest) |
|
71 : mResponseCommand(responseCommand), |
|
72 mMenuType(actionRequest.menuType()), |
|
73 mContextView(actionRequest.contextView()), |
|
74 mMailboxId(actionRequest.mailboxId()), |
|
75 mFolderId(actionRequest.folderId()), |
|
76 mMessageId(actionRequest.messageId()) { }; |
|
77 |
|
78 inline NmActionResponseCommand responseCommand() const {return mResponseCommand;} |
|
79 inline NmActionContextMenuType menuType() const {return mMenuType;} |
|
80 inline NmActionContextView contextView()const {return mContextView;} |
|
81 inline NmId mailboxId()const {return mMailboxId;} |
|
82 inline NmId folderId() const {return mFolderId;} |
|
83 inline NmId messageId() const {return mMessageId;} |
|
84 |
|
85 private: |
|
86 NmActionResponseCommand mResponseCommand; |
|
87 NmActionContextMenuType mMenuType; |
|
88 NmActionContextView mContextView; |
|
89 NmId mMailboxId; |
|
90 NmId mFolderId; |
|
91 NmId mMessageId; |
|
92 }; |
|
93 |
|
94 |
|
95 #endif /* NMMENURESPONSE_H_ */ |