author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:21:28 +0300 | |
branch | RCL_3 |
changeset 22 | bec11adf88f9 |
parent 21 | 10c6e6d6e4d9 |
permissions | -rw-r--r-- |
21 | 1 |
/* |
2 |
* Copyright (c) 2002 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: Declares container control for application. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef ABOUTCONTAINER_H |
|
20 |
#define ABOUTCONTAINER_H |
|
21 |
||
22 |
// INCLUDES |
|
23 |
#include <coecntrl.h> |
|
24 |
#include <gdi.h> |
|
25 |
#include <eiksbobs.h> |
|
22
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
26 |
#include <gulicon.h> |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
27 |
#include "MResourceLoaderObserver.h" |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
28 |
|
21 | 29 |
// FORWARD DECLARATIONS |
30 |
class CEikScrollBarFrame; |
|
31 |
class CAboutImage; |
|
32 |
class CFont; |
|
33 |
class TRect; |
|
34 |
class TBidiText; |
|
22
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
35 |
class CAknsBasicBackgroundControlContext; |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
36 |
class CAboutResourceLoader; |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
37 |
|
21 | 38 |
|
39 |
// CLASS DECLARATION |
|
40 |
||
41 |
/** |
|
42 |
* CAboutContainer container control class. |
|
22
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
43 |
* The container for About. It handle the system event. |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
44 |
* And it draws correct texts and images to screen base on the scroll bar. |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
45 |
* |
21 | 46 |
*/ |
22
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
47 |
|
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
48 |
class CAboutContainer : public CCoeControl, |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
49 |
public MEikScrollBarObserver, |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
50 |
public MResourceLoaderObserver |
21 | 51 |
{ |
52 |
public: // Constructors and destructor |
|
53 |
CAboutContainer(); |
|
54 |
void ConstructL( const TRect& aRect ); |
|
55 |
||
56 |
void CalculateL(const TRect& aRect); |
|
57 |
void HandleResourceChange(TInt aType); |
|
58 |
/** |
|
59 |
* From MEikScrollBarObserver |
|
60 |
*/ |
|
61 |
void HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType); |
|
62 |
||
63 |
~CAboutContainer(); |
|
64 |
||
65 |
private: // from CCoeControl |
|
66 |
||
67 |
/** |
|
68 |
* From CCoeControl : Control size is set. |
|
69 |
*/ |
|
70 |
void SizeChanged(); |
|
71 |
||
72 |
void Draw( const TRect& aRect ) const; |
|
73 |
void ActivateL(); |
|
74 |
TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
75 |
TEventCode aModifiers ); |
|
76 |
||
77 |
TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
78 |
private: // new functions |
|
79 |
||
80 |
void SetTextL( const TDesC& aText , const TInt aItem ); |
|
81 |
void SetImageL( const TDesC& aFileName, TInt aBitmapId ); |
|
82 |
void UpdateScrollIndicatorL(); |
|
83 |
||
22
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
84 |
private: //From MResourceLoaderObserver |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
85 |
void HandleItemsLoadedL( TInt aError ); |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
86 |
void HandleResourceLoadCompletedL( const TInt aResourceId, TInt aError ); |
21 | 87 |
// text wrapping |
88 |
||
89 |
private: // Data |
|
90 |
||
91 |
CArrayPtr<HBufC>* iText; |
|
92 |
CArrayPtr<CAboutImage>* iImages; |
|
93 |
CArrayFixFlat<TInt>* iScreenStarts; |
|
94 |
TInt iCurrentScreen; |
|
95 |
TBool iDoNotShowLastLineAgain; |
|
96 |
CGraphicsContext::TTextAlign iTextAlign; |
|
97 |
CEikScrollBarFrame* iSBFrame; |
|
98 |
const CFont* iFont; // not owned |
|
99 |
TInt iLineWidth; |
|
100 |
TInt iBaseLineDelta; |
|
101 |
TInt iTopBaseLineX; |
|
102 |
TInt iTopBaseLineY; |
|
103 |
TInt iLinesPerScreen; |
|
104 |
CAknsBasicBackgroundControlContext* iSkinContext; // skin data |
|
105 |
CGulIcon* iIcon; |
|
106 |
||
107 |
// Judge whether scroll bar is dragged. |
|
108 |
TBool iScrollBarDragged; |
|
22
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
109 |
|
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
110 |
//Owned: Resource loader. |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
111 |
CAboutResourceLoader* iLoader; |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
112 |
|
21 | 113 |
// Judge the break between "real" about box language and the full OSS texts |
114 |
TBool iBreakFlag; |
|
22
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
115 |
|
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
116 |
// Store the resource path for load the file |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
117 |
TFileName iResourcePath; |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
118 |
|
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
119 |
// Store the item count of the current loading resource. |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
120 |
TInt iCurrentCount; |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
121 |
|
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
122 |
// Store the the count of the loaded content's items |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
123 |
TInt iFinalCount; |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
124 |
|
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
125 |
// In order to carry out one operation only for getting iFinalCount |
bec11adf88f9
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
126 |
TBool iHandleFlag; |
21 | 127 |
}; |
128 |
||
129 |
#endif |
|
130 |
||
131 |
// End of File |