1 /* |
|
2 * Copyright (c) 2010 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: Controller for managing the camera startup logo state |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CAMSTARTUPLOGOCONTROLLER_H |
|
19 #define CAMSTARTUPLOGOCONTROLLER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 |
|
25 enum TStartupLogoState |
|
26 { |
|
27 EStartupLogoNotVisible, |
|
28 EStartupLogoVisible |
|
29 }; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Observer interface for listening to controller state change events |
|
35 * |
|
36 */ |
|
37 class MCamStartupLogoControllerObserver |
|
38 { |
|
39 public: |
|
40 virtual ~MCamStartupLogoControllerObserver() {} |
|
41 |
|
42 /** |
|
43 * Startup logo controller state changed. |
|
44 */ |
|
45 virtual void StartupLogoControllerStateChanged(TStartupLogoState aNewState) = 0; |
|
46 }; |
|
47 |
|
48 |
|
49 |
|
50 /** |
|
51 * Controller for managing the camera startup logo state |
|
52 * |
|
53 */ |
|
54 class CCamStartupLogoController : public CBase |
|
55 { |
|
56 |
|
57 public: |
|
58 // Constructors and destructor |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CCamStartupLogoController(); |
|
64 |
|
65 /** |
|
66 * Two-phased constructor. |
|
67 */ |
|
68 static CCamStartupLogoController* NewL(TStartupLogoState aInitialState); |
|
69 |
|
70 /** |
|
71 * Two-phased constructor. |
|
72 */ |
|
73 static CCamStartupLogoController* NewLC(TStartupLogoState aInitialState); |
|
74 |
|
75 public: |
|
76 /** |
|
77 * Add an observer. Returns an error code. |
|
78 */ |
|
79 TInt AddObserver(MCamStartupLogoControllerObserver* aObserver); |
|
80 |
|
81 /** |
|
82 * Removes an observer. |
|
83 */ |
|
84 void RemoveObserver(MCamStartupLogoControllerObserver* aObserver); |
|
85 |
|
86 /** |
|
87 * Get current state. |
|
88 */ |
|
89 TStartupLogoState State() const; |
|
90 |
|
91 /** |
|
92 * Show startup logo. |
|
93 */ |
|
94 void ShowLogo(); |
|
95 |
|
96 /** |
|
97 * Hide startup logo. |
|
98 */ |
|
99 void HideLogo(); |
|
100 |
|
101 private: |
|
102 |
|
103 /** |
|
104 * Constructor for performing 1st stage construction |
|
105 */ |
|
106 CCamStartupLogoController(TStartupLogoState aInitialState); |
|
107 |
|
108 /** |
|
109 * Symbian default constructor for performing 2nd stage construction |
|
110 */ |
|
111 void ConstructL(); |
|
112 |
|
113 static TInt FailSafeCallback(TAny* ptr); |
|
114 |
|
115 private: |
|
116 void SetState(TStartupLogoState aNewState); |
|
117 |
|
118 private: // data |
|
119 TStartupLogoState iState; |
|
120 RPointerArray<MCamStartupLogoControllerObserver> iObservers; |
|
121 CPeriodic* iFailSafeTimer; // own |
|
122 }; |
|
123 |
|
124 #endif // CAMSTARTUPLOGOCONTROLLER_H |
|