|
1 /* |
|
2 * Copyright (c) 2007-2008 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 event router for the slideshow engine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CSHWEVENTROUTER_H__ |
|
22 #define __CSHWEVENTROUTER_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <e32base.h> |
|
27 |
|
28 #include "shweventqueue.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MShwEventObserver; |
|
32 class MShwEventPublisher; |
|
33 class MShwEvent; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * CShwEventRouter |
|
39 * |
|
40 * @lib shwslideshowengine.lib |
|
41 */ |
|
42 NONSHARABLE_CLASS( CShwEventRouter ) : public CBase, public MShwEventQueue |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Constructor |
|
48 */ |
|
49 static CShwEventRouter* NewL(); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~CShwEventRouter(); |
|
55 |
|
56 private: |
|
57 |
|
58 /** |
|
59 * Constructor |
|
60 */ |
|
61 CShwEventRouter(); |
|
62 |
|
63 /** |
|
64 * 2nd stage constructor |
|
65 */ |
|
66 void ConstructL(); |
|
67 |
|
68 public: // the API |
|
69 |
|
70 /** |
|
71 * Add to the list of observers. Conveniency overload |
|
72 * @param aObservers, list containing the observers to add. |
|
73 */ |
|
74 void AddObserversL( TArray<MShwEventObserver*> aObservers ); |
|
75 |
|
76 /** |
|
77 * Add to the list of observers. |
|
78 * @param aObserver, the observer to add. |
|
79 */ |
|
80 void AddObserverL( MShwEventObserver* aObserver ); |
|
81 |
|
82 /** |
|
83 * Add a list of publisher to the system. Conveniency overload |
|
84 * @param aPublisher, list contanining the producers to add |
|
85 */ |
|
86 void AddProducers( TArray< MShwEventPublisher* > aPublishers ); |
|
87 |
|
88 /** |
|
89 * Add a publisher to the system. |
|
90 * @param aPublisher, the producer to add |
|
91 */ |
|
92 void AddProducer( MShwEventPublisher* aPublisher ); |
|
93 |
|
94 public: // From MShwEventQueue |
|
95 |
|
96 /** @ref MShwEventQueue::SendEvent */ |
|
97 void SendEventL( MShwEvent* aEvent ); |
|
98 |
|
99 private: |
|
100 |
|
101 /// Own: The container for the event observers |
|
102 RPointerArray< MShwEventObserver > iObservers; |
|
103 |
|
104 /// Own: The queue for the events |
|
105 RArray< MShwEvent* > iEvents; |
|
106 |
|
107 /// Own: Flag to tell when an event is beeing served |
|
108 TBool iInsideEventLoop; |
|
109 |
|
110 }; |
|
111 |
|
112 #endif // __CSHWEVENTROUTER_H__ |