|
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 NMACTIONREQUEST_H_ |
|
19 #define NMACTIONREQUEST_H_ |
|
20 |
|
21 #include "nmcommon.h" |
|
22 |
|
23 /*! |
|
24 \enum NmActionContextMenuType |
|
25 \brief This value indicates action type that is requested using |
|
26 \action request class NmActionRequest and responded with NmActionResponse |
|
27 */ |
|
28 enum NmActionContextMenuType |
|
29 { |
|
30 NmActionOptionsMenu=0, |
|
31 NmActionContextMenu, |
|
32 NmActionToolbar, |
|
33 NmActionVKB |
|
34 }; |
|
35 |
|
36 /*! |
|
37 \enum NmActionContextView |
|
38 \brief This value defines context menu selection type |
|
39 */ |
|
40 enum NmActionContextView |
|
41 { |
|
42 NmActionContextViewNone=0, |
|
43 NmActionContextViewMailboxList, |
|
44 NmActionContextViewMessageList, |
|
45 NmActionContextViewMessageSearchList, |
|
46 NmActionContextViewViewer, |
|
47 NmActionContextViewEditor |
|
48 }; |
|
49 |
|
50 /*! |
|
51 \enum NmActionContextDataType |
|
52 \brief This value defines data of context item |
|
53 */ |
|
54 enum NmActionContextDataType |
|
55 { |
|
56 NmActionContextDataNone=0, |
|
57 NmActionContextDataMailbox, |
|
58 NmActionContextDataFolder, |
|
59 NmActionContextDataMessage |
|
60 }; |
|
61 |
|
62 |
|
63 |
|
64 class NmActionObserver; |
|
65 |
|
66 /*! |
|
67 \class NmActionRequest |
|
68 \brief NmUi calls extension manager to invoke menu. Context |
|
69 \information should be encapsulated using this class. |
|
70 \QVariant requestData can be used to relay NmActionContextDataType based |
|
71 \info such as message envelope, etc |
|
72 */ |
|
73 class NmActionRequest |
|
74 { |
|
75 public: |
|
76 inline NmActionRequest(NmActionObserver *observer, |
|
77 NmActionContextMenuType menuType=NmActionOptionsMenu, |
|
78 NmActionContextView contextView=NmActionContextViewNone, |
|
79 NmActionContextDataType contextDataType=NmActionContextDataNone, |
|
80 NmId mailboxId=0, |
|
81 NmId folderId=0, |
|
82 NmId messageId=0, |
|
83 QVariant requestData=0 |
|
84 ) |
|
85 : mObserver(observer), |
|
86 mMenuType(menuType), |
|
87 mContextView(contextView), |
|
88 mContextDataType(contextDataType), |
|
89 mMailboxId(mailboxId), |
|
90 mFolderId(folderId), |
|
91 mMessageId(messageId), |
|
92 mRequestData(requestData){}; |
|
93 |
|
94 inline NmActionObserver *observer() const {return mObserver;} |
|
95 inline NmActionContextMenuType menuType() const {return mMenuType;} |
|
96 inline NmActionContextView contextView() const {return mContextView;} |
|
97 inline NmActionContextDataType contextDataType() const {return mContextDataType;} |
|
98 inline NmId mailboxId() const {return mMailboxId;} |
|
99 inline NmId folderId() const {return mFolderId;} |
|
100 inline NmId messageId() const {return mMessageId;} |
|
101 inline QVariant requestData() const {return mRequestData;} |
|
102 |
|
103 private: |
|
104 NmActionObserver *mObserver; |
|
105 NmActionContextMenuType mMenuType; |
|
106 NmActionContextView mContextView; |
|
107 NmActionContextDataType mContextDataType; |
|
108 NmId mMailboxId; |
|
109 NmId mFolderId; |
|
110 NmId mMessageId; |
|
111 QVariant mRequestData; |
|
112 }; |
|
113 |
|
114 #endif /* NMACTIONREQUEST_H_ */ |