|
1 /* |
|
2 * Copyright (c) 2006 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: Header of EffectControlBase class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CEFFECTCONTROLBASE_H |
|
20 #define C_CEFFECTCONTROLBASE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <mmfcontrollerframework.h> |
|
24 |
|
25 class MCustomCommand; |
|
26 |
|
27 namespace multimedia |
|
28 { |
|
29 class MStreamControl; |
|
30 class MControlObserver; |
|
31 class MEffectControl; |
|
32 class CEffectControlBaseImpl; |
|
33 |
|
34 class CEffectControlBase |
|
35 { |
|
36 protected: |
|
37 // Called by subclass |
|
38 CEffectControlBase(); |
|
39 // Has to be called by subclass |
|
40 void ConstructL( TUid aCIUid ); |
|
41 |
|
42 // Returns ETrue if connected to Message Handler else EFalse |
|
43 TBool IsConnected(); |
|
44 |
|
45 // Returns KErrNone if it is already connected to message handler |
|
46 // or connected to message handler successfully. |
|
47 TInt Connect(); |
|
48 |
|
49 // Used by sub-classes for sending custom commands to Message Handler |
|
50 // Returns KErrNotReady if not connected |
|
51 TInt CustomCommandSync( TInt aFunction, |
|
52 const TDesC8& aDataTo1, |
|
53 const TDesC8& aDataTo2, |
|
54 TDes8& aDataFrom); |
|
55 |
|
56 // Returns KErrNotReady if not connected |
|
57 TInt CustomCommandSync( TInt aFunction, |
|
58 const TDesC8& aDataTo1, |
|
59 const TDesC8& aDataTo2); |
|
60 |
|
61 // Client is signalled with KErrNotReady if not connected |
|
62 void CustomCommandAsync( TInt aFunction, |
|
63 const TDesC8& aDataTo1, |
|
64 const TDesC8& aDataTo2, |
|
65 TDes8& aDataFrom, |
|
66 TRequestStatus& aStatus); |
|
67 |
|
68 // Client is signalled with KErrNotReady if not connected |
|
69 void CustomCommandAsync( TInt aFunction, |
|
70 const TDesC8& aDataTo1, |
|
71 const TDesC8& aDataTo2, |
|
72 TRequestStatus& aStatus); |
|
73 |
|
74 // Used by sub-classes for sending custom commands to known destination |
|
75 // This is intended for objects implementing custom commands who |
|
76 // knows destination address |
|
77 TInt CustomCommandSync( const TMMFMessageDestinationPckg& aDestination, |
|
78 TInt aFunction, |
|
79 const TDesC8& aDataTo1, |
|
80 const TDesC8& aDataTo2, |
|
81 TDes8& aDataFrom ); |
|
82 TInt CustomCommandSync( const TMMFMessageDestinationPckg& aDestination, |
|
83 TInt aFunction, |
|
84 const TDesC8& aDataTo1, |
|
85 const TDesC8& aDataTo2 ); |
|
86 void CustomCommandAsync( const TMMFMessageDestinationPckg& aDestination, |
|
87 TInt aFunction, |
|
88 const TDesC8& aDataTo1, |
|
89 const TDesC8& aDataTo2, |
|
90 TDes8& aDataFrom, |
|
91 TRequestStatus& aStatus ); |
|
92 void CustomCommandAsync( const TMMFMessageDestinationPckg& aDestination, |
|
93 TInt aFunction, |
|
94 const TDesC8& aDataTo1, |
|
95 const TDesC8& aDataTo2, |
|
96 TRequestStatus& aStatus ); |
|
97 |
|
98 TInt GetMessageHandle(TMMFMessageDestinationPckg &aPckg); |
|
99 MCustomCommand* GetCustomCommand(); |
|
100 |
|
101 public: |
|
102 virtual ~CEffectControlBase(); |
|
103 // Called by Stream Control when Effect Control is added to it |
|
104 TInt GetControlObserver( MControlObserver*& aObserver ); |
|
105 // Called by Stream Control when Effect Control is added to it |
|
106 TInt AddedToStreamControl( MStreamControl& aStreamControl, |
|
107 MCustomCommand& aCustomCommand, |
|
108 MEffectControl& aEffect ); |
|
109 // Called by Stream Control when Effect Control is removed to it |
|
110 TInt RemovedFromStreamControl( MStreamControl& aStreamControl ); |
|
111 // Called by Stream Control when it is deleted before removing Effect Control |
|
112 void StreamControlDeleted( MStreamControl& aStreamControl ); |
|
113 // Returns KErrNone if it is not connected to message handler |
|
114 // or disconnected from Message Handler successfully. |
|
115 TInt Disconnect(); |
|
116 |
|
117 public: |
|
118 enum TEffectControlEvent |
|
119 { |
|
120 ECIBuilderCreated, |
|
121 EMessageHandlerDeleted |
|
122 }; |
|
123 public: |
|
124 // Handles effect control event. The derived class must implement to |
|
125 // handle the event. |
|
126 virtual void Event( TEffectControlEvent aEvent ); |
|
127 |
|
128 private: |
|
129 CEffectControlBaseImpl* iCEffectControlBaseImpl; |
|
130 }; |
|
131 } // namespace multimedia |
|
132 |
|
133 #endif // C_CEFFECTCONTROLBASE_H |
|
134 |
|
135 // End of file |