|
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 * Declares widget details dialog for WidgetManager |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef ___WMDETAILSDLG_H__ |
|
20 #define ___WMDETAILSDLG_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <AknDialog.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CEikRichTextEditor; |
|
28 class CAknsBasicBackgroundControlContext; |
|
29 |
|
30 // CLASS DECLARATIONS |
|
31 /** |
|
32 * CWmDetailsDlg |
|
33 */ |
|
34 NONSHARABLE_CLASS( CWmDetailsDlg ): public CAknDialog |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CWmDetailsDlg* NewL( |
|
42 const TDesC& aName, |
|
43 const TDesC& aDescription, |
|
44 TBool aCanBeAdded, |
|
45 const CFbsBitmap* aLogoBmp, |
|
46 const CFbsBitmap* aLogoMask, |
|
47 CAknsBasicBackgroundControlContext* aBgContext ); |
|
48 |
|
49 /** Destructor. */ |
|
50 ~CWmDetailsDlg(); |
|
51 |
|
52 public: // New functions |
|
53 /** From CAknDialog Initializes the dialog and calls |
|
54 CAknDialog's ExecuteLD() */ |
|
55 TInt ExecuteLD(); |
|
56 |
|
57 private: // Functions from base classes |
|
58 |
|
59 |
|
60 /** From CEikDialog Initializes dialog before layout*/ |
|
61 void PreLayoutDynInitL(); |
|
62 |
|
63 /** From CEikDialog Handles button events and looks |
|
64 if the dialog can be closed */ |
|
65 TBool OkToExitL(TInt aButtonId); |
|
66 |
|
67 /** From CCoeControl Handles key events */ |
|
68 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType ); |
|
69 |
|
70 /** From CEikDialog Called by framework when dialog is activated */ |
|
71 void ActivateL(); |
|
72 |
|
73 /** From CAknDialog called to provide access to the contorols */ |
|
74 TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
75 |
|
76 /** From CAknDialog */ |
|
77 void SetSizeAndPosition( const TSize& aSize ); |
|
78 |
|
79 /** From CCoeControl */ |
|
80 void SizeChanged(); |
|
81 |
|
82 /** From CCoeControl */ |
|
83 TInt CountComponentControls() const; |
|
84 CCoeControl* ComponentControl(TInt aIndex) const; |
|
85 void Draw( const TRect& aRect ) const; |
|
86 |
|
87 /** Desired rect for dialog */ |
|
88 TRect WmDetailsDialogRect(); |
|
89 |
|
90 /** Insert and format content */ |
|
91 void InsertAndFormatContentL(); |
|
92 |
|
93 private: |
|
94 |
|
95 /** Constructor for performing 1st stage construction */ |
|
96 CWmDetailsDlg( TBool aCanBeAdded ); |
|
97 |
|
98 /** 2nd phase constructor */ |
|
99 void ConstructL( |
|
100 const TDesC& aName, |
|
101 const TDesC& aDescription, |
|
102 const CFbsBitmap* aLogoBmp, |
|
103 const CFbsBitmap* aLogoMask, |
|
104 CAknsBasicBackgroundControlContext* aBgContext ); |
|
105 |
|
106 private: |
|
107 |
|
108 /** |
|
109 * Background context (not owned) |
|
110 */ |
|
111 CAknsBasicBackgroundControlContext* iBgContext; |
|
112 |
|
113 /** |
|
114 * Richtext editor |
|
115 */ |
|
116 CEikRichTextEditor* iRtEditor; |
|
117 |
|
118 /** |
|
119 * Name of widget |
|
120 */ |
|
121 HBufC* iName; |
|
122 |
|
123 /** |
|
124 * Description of widget |
|
125 */ |
|
126 HBufC* iDescription; |
|
127 |
|
128 /** |
|
129 * Logo image |
|
130 */ |
|
131 CFbsBitmap* iLogoBmp; |
|
132 |
|
133 /** |
|
134 * Logo mask |
|
135 */ |
|
136 CFbsBitmap* iLogoMask; |
|
137 |
|
138 /** |
|
139 * ETrue if widget can be added to HS |
|
140 */ |
|
141 TBool iCanBeAdded; |
|
142 |
|
143 }; |
|
144 |
|
145 #endif ___WMDETAILSDLG_H__ |
|
146 |
|
147 // End of File |