|
1 /* |
|
2 * Component Name: Headset Simulator |
|
3 * Author: Comarch S.A. |
|
4 * Version: 1.0 |
|
5 * Copyright (c) 2010 Comarch S.A. |
|
6 * |
|
7 * This Software is submitted by Comarch S.A. to Symbian Foundation Limited on |
|
8 * the basis of the Member Contribution Agreement entered between Comarch S.A. |
|
9 * and Symbian Foundation Limited on 5th June 2009 (“Agreement”) and may be |
|
10 * used only in accordance with the terms and conditions of the Agreement. |
|
11 * Any other usage, duplication or redistribution of this Software is not |
|
12 * allowed without written permission of Comarch S.A. |
|
13 * |
|
14 */ |
|
15 |
|
16 #ifndef HSPROFILEBASE_H_ |
|
17 #define HSPROFILEBASE_H_ |
|
18 |
|
19 #include <e32cmn.h> |
|
20 #include <badesca.h> |
|
21 #include <ecom.h> |
|
22 #include <hsecompluginbase.h> |
|
23 |
|
24 /** |
|
25 * Profile plugin's UID |
|
26 */ |
|
27 const TUid KHsProfileBaseInterfaceDefinitionUid = |
|
28 { |
|
29 0xE0009DC1 |
|
30 }; |
|
31 |
|
32 /** |
|
33 * @brief Abstract methods for profile plugin |
|
34 */ |
|
35 class MHsProfileBase |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * Destructor |
|
40 */ |
|
41 virtual ~MHsProfileBase() { }; |
|
42 |
|
43 /** |
|
44 * Profile's method for handling AT Commands |
|
45 * |
|
46 * @param aCommandsIn AT command received by HS |
|
47 * @param aCommandsOut response |
|
48 * @param aFromAG denotes if AT command was sent from AG |
|
49 */ |
|
50 virtual void HandleCommandL( const TDesC8& aCommandsIn, TDes8& aCommandsOut, |
|
51 const TBool aFromAG = ETrue ) = 0; |
|
52 |
|
53 /** |
|
54 * Profile's method for handling AG client disconnection |
|
55 * |
|
56 * @param aErr disconnection reason |
|
57 */ |
|
58 virtual void HandleClientDisconnected( TInt aErr ) = 0; |
|
59 |
|
60 /** |
|
61 * Profile's method for handling AG client connection |
|
62 * |
|
63 * @param aCommandOut response |
|
64 */ |
|
65 virtual void HandleClientConnected( TDes8& aCommandOut ) = 0; |
|
66 |
|
67 /** |
|
68 * Profile's method for accepting incoming call |
|
69 * |
|
70 * @param aCommandOut response |
|
71 */ |
|
72 virtual void HandleAcceptCallL( TDes8& aCommandOut ) = 0; |
|
73 |
|
74 /** |
|
75 * Profile's method for releasing ongoing call |
|
76 * |
|
77 * @param aCommandOut response |
|
78 */ |
|
79 virtual void HandleReleaseCallL( TDes8& aCommandOut ) = 0; |
|
80 |
|
81 }; |
|
82 |
|
83 /** |
|
84 * @brief Base class for profile plugins |
|
85 */ |
|
86 class CHsProfileBase : public CHsEComPluginBase, public MHsProfileBase |
|
87 { |
|
88 public: |
|
89 /** |
|
90 * Two-phase constructor |
|
91 * @param aUid plugin's UID |
|
92 * @return instance of class |
|
93 */ |
|
94 static CHsProfileBase* NewL( const TUid aUid ); |
|
95 |
|
96 /** |
|
97 * Two-phase constructor |
|
98 * @param aProfileName plugin's name |
|
99 * @return instance of class |
|
100 */ |
|
101 static CHsProfileBase* NewL( const TDesC8 &aProfileName ); |
|
102 |
|
103 public: |
|
104 /** |
|
105 * Destructor |
|
106 */ |
|
107 virtual ~CHsProfileBase(); |
|
108 |
|
109 public: |
|
110 //Methods inherited from MHsProfileBase |
|
111 |
|
112 virtual void HandleCommandL( const TDesC8 &aCommandsIn, TDes8 &aCommandsOut, |
|
113 const TBool aFromAG = ETrue ) = 0; |
|
114 |
|
115 virtual void HandleClientDisconnected( TInt aErr ) = 0; |
|
116 |
|
117 virtual void HandleClientConnected( TDes8& aCommandOut ) = 0; |
|
118 |
|
119 virtual void HandleAcceptCallL( TDes8& aCommandOut ) = 0; |
|
120 |
|
121 virtual void HandleReleaseCallL( TDes8& aCommandOut ) = 0; |
|
122 }; |
|
123 |
|
124 #include "hsprofilepluginbase.inl" |
|
125 |
|
126 #endif /* HSPROFILEBASE_H_ */ |