|
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: Utility class to rotate bitmaps* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CAMBMPROTATORAO_H |
|
22 #define __CAMBMPROTATORAO_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <bitmaptransforms.h> |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Utility class to help in the rotating of bitmaps (for Zoom Pane) |
|
41 * |
|
42 * @since 3.0 |
|
43 */ |
|
44 class CCamBmpRotatorAo : public CActive |
|
45 { |
|
46 private: |
|
47 // This structure stores the details of a rotation task. |
|
48 // Used only internally, the bitmap is *not* owned by this |
|
49 // class, and will be overwritten by the rotation operation. |
|
50 class CRotateTask : public CBase |
|
51 { |
|
52 public: |
|
53 // The source bitmap to be rotated (and overwritten) |
|
54 CFbsBitmap* iBitmap; |
|
55 |
|
56 // The angle to rotate the bitmap by |
|
57 CBitmapRotator::TRotationAngle iAngle; |
|
58 }; |
|
59 |
|
60 public: // Constructors and destructor |
|
61 |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 */ |
|
65 static CCamBmpRotatorAo* NewL(); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 virtual ~CCamBmpRotatorAo(); |
|
71 |
|
72 public: // New functions |
|
73 /** |
|
74 * Rotates the specified bitmap by the supplied angle. |
|
75 * Note that the original bitmap will be overwritten |
|
76 * @since 3.0 |
|
77 * @param aBitmap The bitmap to rotate |
|
78 * @param aRotation The angle to rotate the bitmap |
|
79 */ |
|
80 void AddToQueueL( CFbsBitmap* aBitmap, CBitmapRotator::TRotationAngle aRotation ); |
|
81 |
|
82 /** |
|
83 * Starts the next rotation task in the queue (if there is one) |
|
84 * @since 3.0 |
|
85 */ |
|
86 void StartNextRotate(); |
|
87 |
|
88 public: // Functions from base classes |
|
89 /** |
|
90 * Called when a rotate operation has completed |
|
91 * @since 3.0 |
|
92 */ |
|
93 void RunL(); |
|
94 |
|
95 /** |
|
96 * Called to cancel an outstanding operation (eg when class is being destroyed) |
|
97 * @since 3.0 |
|
98 */ |
|
99 void DoCancel(); |
|
100 |
|
101 private: |
|
102 |
|
103 /** |
|
104 * C++ default constructor. |
|
105 * @since 3.0 |
|
106 */ |
|
107 CCamBmpRotatorAo(); |
|
108 |
|
109 /** |
|
110 * By default Symbian 2nd phase constructor is private. |
|
111 * @since 3.0 |
|
112 */ |
|
113 void ConstructL(); |
|
114 |
|
115 private: // Data |
|
116 // List of outstanding rotation tasks to perform |
|
117 RPointerArray <CRotateTask> iQueue; |
|
118 |
|
119 // ICL utility class that actually does the bitmap rotation |
|
120 CBitmapRotator* iRotator; |
|
121 }; |
|
122 |
|
123 #endif // __CAMBMPROTATORAO_H |
|
124 |
|
125 // End of File |