|
1 /* |
|
2 * Copyright (c) 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: This class is for showing the attendees in viewer mode. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CESMRVIEWERATTENDEESFIELD_H |
|
19 #define CESMRVIEWERATTENDEESFIELD_H |
|
20 |
|
21 #include <caluser.h> |
|
22 #include <eikedwob.h> |
|
23 #include "cesmrfield.h" |
|
24 #include "cesmrrichtextviewer.h" |
|
25 |
|
26 class CESMRRichTextLink; |
|
27 class CMRLabel; |
|
28 |
|
29 /** |
|
30 * This class shows the attendees in viewer mode. It's possible to |
|
31 * use contact action menu via a single attendee. |
|
32 */ |
|
33 NONSHARABLE_CLASS( CESMRViewerAttendeesField ) : public CESMRField, |
|
34 public MEikEdwinSizeObserver, public MESMRRichTextObserver |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Constructor for the attendee field. |
|
39 * |
|
40 * @param CCalAttendee::TCalRole - Information that tells is this |
|
41 * field for optional or for |
|
42 * required attendees. |
|
43 * @return New attendees field object. |
|
44 */ |
|
45 static CESMRViewerAttendeesField* NewL( CCalAttendee::TCalRole ); |
|
46 |
|
47 /** |
|
48 * C++ Destructor. |
|
49 */ |
|
50 ~CESMRViewerAttendeesField( ); |
|
51 |
|
52 public: // From CCoeControl |
|
53 TInt CountComponentControls( ) const; |
|
54 CCoeControl* ComponentControl( TInt aInd ) const; |
|
55 void SizeChanged( ); |
|
56 TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); |
|
57 void SetContainerWindowL(const CCoeControl& aContainer); |
|
58 TSize MinimumSize(); |
|
59 virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
60 |
|
61 public: // From CESMRField |
|
62 void InitializeL(); |
|
63 void SetOutlineFocusL( TBool aFocus ); |
|
64 void InternalizeL( MESMRCalEntry& aEntry ); |
|
65 void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); |
|
66 void ListObserverSet( ); |
|
67 void ExecuteGenericCommandL( TInt aCommand ); |
|
68 |
|
69 public: // From MEikEdwinSizeObserver |
|
70 TBool HandleEdwinSizeEventL(CEikEdwin* aEdwin, TEdwinSizeEvent aType, |
|
71 TSize aDesirableEdwinSize ); |
|
72 |
|
73 public: // From MESMRRichTextObserver |
|
74 TBool HandleRichTextLinkSelection(const CESMRRichTextLink* aLink ); |
|
75 |
|
76 private: // Implementation |
|
77 CESMRViewerAttendeesField( CCalAttendee::TCalRole aType ); |
|
78 void ConstructL( ); |
|
79 HBufC* ClipTextLC( const TDesC& aText, const CFont& aFont, TInt aWidth ); |
|
80 void UpdateAttendeesListL(); |
|
81 |
|
82 private: // data |
|
83 // Own: Title of this field |
|
84 CMRLabel* iTitle; |
|
85 // Own: Container for all the attendees |
|
86 CESMRRichTextViewer* iRichTextViewer; |
|
87 // Size of the field when after field has expanded. |
|
88 TSize iExpandedSize; |
|
89 // Size of the title |
|
90 TSize iTitleSize; |
|
91 // Inofrmation about attendee type |
|
92 CCalAttendee::TCalRole iRole; |
|
93 // Not owned. Attendee list. |
|
94 RPointerArray<CCalAttendee> iCalAttendees; |
|
95 // Show all attendees. |
|
96 TBool iShowAllAttendees; |
|
97 }; |
|
98 |
|
99 #endif // CESMRVIEWERATTENDEESFIELD_H |