|
1 /* |
|
2 * Copyright (c) 2002-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: AVKON smiley utils. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef AKNSMILEYUTILS_H |
|
22 #define AKNSMILEYUTILS_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <AknUtils.h> |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 |
|
30 //////////////////////////////////////////////////////////////////// |
|
31 |
|
32 class CAknSmileyIcon : public CBase |
|
33 { |
|
34 protected: |
|
35 CAknSmileyIcon(); |
|
36 |
|
37 protected: |
|
38 virtual ~CAknSmileyIcon(); |
|
39 |
|
40 public: |
|
41 virtual const CFbsBitmap* Image() const; |
|
42 virtual const CFbsBitmap* Mask() const; |
|
43 virtual TBool ReadyToDraw() const; |
|
44 virtual const TSize& Size() const; |
|
45 virtual void PlayAnimationL(TInt aRepeat=0, TInt aDelay=0); |
|
46 virtual void StopAnimation(); |
|
47 }; |
|
48 |
|
49 //////////////////////////////////////////////////////////////////// |
|
50 |
|
51 class MAknSmileyObserver |
|
52 { |
|
53 public: |
|
54 virtual void SmileyStillImageLoaded(CAknSmileyIcon* aSmileyIcon)=0; |
|
55 virtual void SmileyAnimationChanged(CAknSmileyIcon* aSmileyIcon)=0; |
|
56 }; |
|
57 |
|
58 //////////////////////////////////////////////////////////////////// |
|
59 |
|
60 class CAknSmileyManager : public CBase |
|
61 { |
|
62 public: |
|
63 IMPORT_C static CAknSmileyManager* NewL(MAknSmileyObserver* aObserver); |
|
64 IMPORT_C ~CAknSmileyManager(); |
|
65 |
|
66 private: |
|
67 CAknSmileyManager(); |
|
68 void ConstructL(MAknSmileyObserver* aObserver); |
|
69 |
|
70 public: |
|
71 IMPORT_C TInt ConvertCodesToTextL(TDes& aText); |
|
72 IMPORT_C TInt ConvertTextToCodesL(TDes& aText); |
|
73 IMPORT_C const TDesC& Text(TChar aCode) const; |
|
74 IMPORT_C TBool IsSmiley(TChar aCode) const; |
|
75 |
|
76 public: |
|
77 IMPORT_C void SetSize(const TSize& aSize); |
|
78 IMPORT_C void SetSizeByFont(const CFont* aFont); |
|
79 |
|
80 public: |
|
81 IMPORT_C void DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TPoint& aPosition) const; |
|
82 IMPORT_C void DrawText(CWindowGc& aGc, const TDesC& aText, const TAknLayoutText& aLayout, TBool aUseLogicalToVisualConversion=EFalse) const; |
|
83 IMPORT_C void DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TRect& aBox, TInt aBaselineOffset, |
|
84 CGraphicsContext::TTextAlign aAlignment=CGraphicsContext::ELeft, TInt aLeftMargin=0) const; |
|
85 |
|
86 public: |
|
87 IMPORT_C TInt Count() const; |
|
88 IMPORT_C CAknSmileyIcon* Smiley(TChar aCode) const; |
|
89 IMPORT_C CAknSmileyIcon* operator[](TInt aIndex) const; |
|
90 |
|
91 public: |
|
92 class CExtension; |
|
93 CExtension* iExtension; |
|
94 |
|
95 }; |
|
96 |
|
97 #endif // AKNSMILEYUTILS_H |