|
1 /* |
|
2 * Copyright (c) 2006-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: The pause handling control for the slideshow |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CSHWSLIDESHOWPAUSEHANDLER_H__ |
|
22 #define __CSHWSLIDESHOWPAUSEHANDLER_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <coecntrl.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CShwSlideshowEngine; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * CShwSlideShowPauseHandler |
|
34 * This class handles the different pause related requirements of |
|
35 * slide show: User pause, Phone call pause, Task away pausing. |
|
36 * User pause/resume has the highest precedence, phone call is next |
|
37 * and then task away (switch to background) |
|
38 * So if the user pauses slideshow and then a phone call starts and |
|
39 * ends, slide show stays paused. Similarly if slideshow is running |
|
40 * and gets switched to background and a phone call starts, slide show |
|
41 * does not continue when switched to foreground unless the phone call |
|
42 * ends before that. |
|
43 */ |
|
44 NONSHARABLE_CLASS( CShwSlideShowPauseHandler ) |
|
45 : public CBase |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Constructor. |
|
51 * @param reference to the slide show engine |
|
52 */ |
|
53 static CShwSlideShowPauseHandler* NewL( CShwSlideshowEngine& aEngine ); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~CShwSlideShowPauseHandler(); |
|
59 |
|
60 private: |
|
61 |
|
62 /** |
|
63 * Constructor |
|
64 * @param reference to the slide show engine |
|
65 */ |
|
66 CShwSlideShowPauseHandler( CShwSlideshowEngine& aEngine ); |
|
67 |
|
68 public: // The API |
|
69 |
|
70 /** |
|
71 * Informs the pause handler that user paused slide show |
|
72 * Engine will always be paused if it was running and |
|
73 * vice versa, |
|
74 */ |
|
75 void UserToggledPauseL(); |
|
76 |
|
77 /** |
|
78 * Informs the pause handler that a phone call has started. |
|
79 * If engine is running when call starts, if will be paused |
|
80 */ |
|
81 void PhoneCallStartedL(); |
|
82 |
|
83 /** |
|
84 * Informs the pause handler that a phone call has ended |
|
85 * If engine was paused by telephone call we resume slide show |
|
86 * when call ends |
|
87 */ |
|
88 void PhoneCallEndedL(); |
|
89 |
|
90 /** |
|
91 * Informs the pause handler that slide show was switched to background. |
|
92 * If engine is running when switch occurs, if will be paused |
|
93 */ |
|
94 void SwitchToBackgroundL(); |
|
95 |
|
96 /** |
|
97 * Informs the pause handler that slide show was switched to foreground. |
|
98 * If engine was paused when switch to background occurred, if will be resumed |
|
99 * unless a phone call is ongoing. |
|
100 */ |
|
101 void SwitchToForegroundL(); |
|
102 |
|
103 /** |
|
104 * Informs the pause handler that MSK Preesed when slide show is running. |
|
105 */ |
|
106 void ToggleUiControlsVisibiltyL(); |
|
107 |
|
108 private: // Implementation |
|
109 |
|
110 /// Ref: The slideshow engine |
|
111 CShwSlideshowEngine& iEngine; |
|
112 |
|
113 /// Own: state flag to know if we are in a call |
|
114 TBool iInCall; |
|
115 |
|
116 /// Own: state flag to know when user paused us |
|
117 TBool iUserPaused; |
|
118 |
|
119 /// Own: state flag to know when we are on foreground |
|
120 TBool iOnForeground; |
|
121 |
|
122 }; |
|
123 |
|
124 #endif // __CSHWSLIDESHOWPAUSEHANDLER_H__ |
|
125 |