|
1 /* |
|
2 * Copyright (c) 2006 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: Mail viewer contact caller. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CMSGMAILVIEWERCONTACTCALLER_H |
|
19 #define C_CMSGMAILVIEWERCONTACTCALLER_H |
|
20 |
|
21 #include <e32base.h> // CBase |
|
22 |
|
23 // FORWARD DECLARATIONS |
|
24 class CEikMenuPane; |
|
25 class CAiwServiceHandler; |
|
26 class CMsgMailViewerContactMatcher; |
|
27 |
|
28 /** |
|
29 * Mail Viewer contact caller. |
|
30 * |
|
31 * @lib none |
|
32 * @since S60 v3.2 |
|
33 */ |
|
34 NONSHARABLE_CLASS(CMsgMailViewerContactCaller) |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * NewL |
|
40 * |
|
41 * @since S60 v3.2 |
|
42 * @param service handler for attaching Call interest |
|
43 * @param contact matcher reference |
|
44 * @return self |
|
45 */ |
|
46 static CMsgMailViewerContactCaller* NewL( |
|
47 CAiwServiceHandler& aServiceHandler, |
|
48 CMsgMailViewerContactMatcher& aContactMatcher ); |
|
49 |
|
50 ~CMsgMailViewerContactCaller(); |
|
51 |
|
52 public: |
|
53 |
|
54 /** |
|
55 * To be called from owner's DynInitMenuPaneL. |
|
56 * @param aResourceId resource id from caller |
|
57 * @param aMenuPane menu pane from caller |
|
58 * @param aAddress address |
|
59 * @param aShowCallOption ETrue if option can be shown in menu |
|
60 */ |
|
61 void DynInitMenuPaneL( TInt aResourceId, |
|
62 CEikMenuPane* aMenuPane, |
|
63 TBool aShowCallOption ); |
|
64 |
|
65 /** |
|
66 * Method to test if given command is applicable for this class |
|
67 * and at this very moment. |
|
68 * @param aCommand command id |
|
69 * @return ETrue if command can be handled |
|
70 */ |
|
71 TBool CanHandleCommand( TInt aCommand ) const; |
|
72 |
|
73 /** |
|
74 * Command handler. Use CanHandleCommand first to test if |
|
75 * command is applicable. |
|
76 * @param aCommand command id |
|
77 * @param aEmailAddress address |
|
78 */ |
|
79 void CallToContactL( TInt aCommand, const TDesC& aEmailAddress ); |
|
80 |
|
81 private: // implementation |
|
82 |
|
83 static TInt MatchDoneL( TAny* aCaller ); |
|
84 |
|
85 void DoCallToContactL(); |
|
86 |
|
87 private: |
|
88 |
|
89 CMsgMailViewerContactCaller( |
|
90 CAiwServiceHandler& aServiceHandler, |
|
91 CMsgMailViewerContactMatcher& aContactMatcher ); |
|
92 |
|
93 void ConstructL(); |
|
94 |
|
95 private: // data |
|
96 |
|
97 TInt iCommand; |
|
98 |
|
99 /// AIW service handler reference |
|
100 CAiwServiceHandler& iServiceHandler; |
|
101 |
|
102 /// contact matcher reference |
|
103 CMsgMailViewerContactMatcher& iContactMatcher; |
|
104 }; |
|
105 |
|
106 #endif // C_CMSGMAILVIEWERCONTACTCALLER_H |