54
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 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: Class for rendering text based indicators on top of viewfinder
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CAMTEXTITEM_H
|
|
20 |
#define CAMTEXTITEM_H
|
|
21 |
|
|
22 |
#include <e32std.h>
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <AknUtils.h>
|
|
25 |
|
|
26 |
class CFbsBitmap;
|
|
27 |
class TAknTextComponentLayout;
|
|
28 |
class CBitmapContext;
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Class for rendering text based indicators on top of viewfinder.
|
|
32 |
*
|
|
33 |
* CCamTextItem can be used to render text on the screen in a way
|
|
34 |
* that is compatible with S60 Posting based overlays. The text mask
|
|
35 |
* is also written in the alpha channel of the screen buffer to allow
|
|
36 |
* it to be overlaid on top of the viewfinder.
|
|
37 |
*
|
|
38 |
* @since S60 v5.0
|
|
39 |
*/
|
|
40 |
class CCamTextItem : public CBase
|
|
41 |
{
|
|
42 |
public:
|
|
43 |
/**
|
|
44 |
* Two-phased constructor.
|
|
45 |
*/
|
|
46 |
static CCamTextItem* NewL();
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Destructor.
|
|
50 |
*/
|
|
51 |
virtual ~CCamTextItem();
|
|
52 |
|
|
53 |
public:
|
|
54 |
/**
|
|
55 |
* Set the layout for the text item.
|
|
56 |
*
|
|
57 |
* @since S60 v5.0
|
|
58 |
* @param aParentRect Rectangle for the parent layout item
|
|
59 |
* @param aLayout A TAknTextComponentLayout containing the layout
|
|
60 |
* details for this item. Usually this can be retrieved
|
|
61 |
* using the AknLayout2 API.
|
|
62 |
*/
|
|
63 |
void SetLayoutL( const TRect& aParentRect, const TAknTextComponentLayout& aLayout );
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Set the text content for the text item.
|
|
67 |
*
|
|
68 |
* @since S60 v5.0
|
|
69 |
* @param aText New text for this item. There are no size limitations. A
|
|
70 |
* local copy if the text is created
|
|
71 |
*/
|
|
72 |
void SetTextL( const TDesC& aText );
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Render this text in a bitmap based graphics context.
|
|
76 |
*
|
|
77 |
* @since S60 v5.0
|
|
78 |
* @param aBitmapContext Graphics context to draw into.
|
|
79 |
*/
|
|
80 |
void Draw( CBitmapContext& aBitmapContext ) const;
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Return the rect of the textitem
|
|
84 |
*
|
|
85 |
*/
|
|
86 |
TRect Rect();
|
|
87 |
|
|
88 |
private:
|
|
89 |
|
|
90 |
CCamTextItem();
|
|
91 |
|
|
92 |
void ConstructL();
|
|
93 |
|
|
94 |
private: // data
|
|
95 |
|
|
96 |
TAknLayoutText iLayout;
|
|
97 |
|
|
98 |
// own
|
|
99 |
HBufC* iText;
|
|
100 |
|
|
101 |
};
|
|
102 |
|
|
103 |
#endif // CAMTEXTITEM_H
|