|
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 HSCODPLUGINBASE_H_ |
|
17 #define HSCODPLUGINBASE_H_ |
|
18 |
|
19 #include <ecom.h> |
|
20 #include <btdevice.h> |
|
21 #include <e32property.h> |
|
22 #include <bt_subscribe.h> |
|
23 #include <hsecompluginbase.h> |
|
24 |
|
25 /** |
|
26 * CoD plugin UID |
|
27 */ |
|
28 const TUid KHsCoDBaseInterfaceDefinitionUid = |
|
29 { |
|
30 0xE0009DC2 |
|
31 }; |
|
32 |
|
33 /** |
|
34 * @brief Abstract methods for CoD plugin |
|
35 */ |
|
36 class MHsCoDBase |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Destructor |
|
41 */ |
|
42 virtual ~MHsCoDBase() { }; |
|
43 |
|
44 /** |
|
45 * Sets new Class of Device in properties registry |
|
46 */ |
|
47 virtual void SetNewCodL() = 0; |
|
48 |
|
49 /** |
|
50 * Restores Class of Device |
|
51 * |
|
52 * @return error code value |
|
53 */ |
|
54 virtual TInt RestoreOldCod() = 0; |
|
55 |
|
56 /** |
|
57 * Saves old CoD |
|
58 * |
|
59 * @return error code value |
|
60 */ |
|
61 virtual TInt SaveOldCod() = 0; |
|
62 }; |
|
63 |
|
64 /** |
|
65 * @brief Class allows to set new CoD. Each CoD plugin should derive from this class. |
|
66 */ |
|
67 class CHsCoDBase : protected CHsEComPluginBase, public MHsCoDBase |
|
68 { |
|
69 public: |
|
70 |
|
71 /** |
|
72 * Two-phase constructor |
|
73 * @param aUid plugin's UID |
|
74 * @return instance of class |
|
75 */ |
|
76 static CHsCoDBase* NewL( const TUid aUid ); |
|
77 |
|
78 /** |
|
79 * Two-phase constructor |
|
80 * @param aData plugin's name |
|
81 * @return instance of class |
|
82 */ |
|
83 static CHsCoDBase* NewL( const TDesC8 &aData ); |
|
84 |
|
85 /** |
|
86 * Destructor. |
|
87 */ |
|
88 virtual ~CHsCoDBase(); |
|
89 |
|
90 public: |
|
91 //Methods inherited from MHsCoDBase |
|
92 |
|
93 virtual void SetNewCodL() = 0; |
|
94 |
|
95 virtual TInt RestoreOldCod(); |
|
96 |
|
97 virtual TInt SaveOldCod(); |
|
98 |
|
99 protected: |
|
100 /** |
|
101 * Restores Class of Device |
|
102 * |
|
103 * @return error code value |
|
104 */ |
|
105 TInt SetDefaultCod(); |
|
106 |
|
107 /** Default Class of Device */ |
|
108 TUint32 iDefaultDeviceClass; |
|
109 |
|
110 }; |
|
111 |
|
112 #include "hscodpluginbase.inl" |
|
113 |
|
114 #endif /* HSCODPLUGINBASE_H_ */ |