|
1 /* |
|
2 * Copyright (c) 2009 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: General active object offering asynchronous service |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BTRCCACTIVE_H |
|
20 #define BTRCCACTIVE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 class CBTRCCActive; |
|
26 |
|
27 class MBTRCCActiveObserver |
|
28 { |
|
29 public: |
|
30 virtual void RequestCompletedL(CBTRCCActive& aActive, TInt aErr) = 0; |
|
31 |
|
32 virtual void CancelRequest(TInt aServiceId) = 0; |
|
33 }; |
|
34 |
|
35 /** |
|
36 * CBTRCCActive listens to the Volume PS Key changes. |
|
37 */ |
|
38 NONSHARABLE_CLASS(CBTRCCActive) : public CActive |
|
39 { |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CBTRCCActive* NewL(MBTRCCActiveObserver& aObserver, TInt aServiceId = 0, |
|
46 CActive::TPriority aPriority = EPriorityStandard /*TPriority::EPriorityStandard*/); |
|
47 |
|
48 static CBTRCCActive* NewLC(MBTRCCActiveObserver& aObserver, TInt aServiceId = 0, |
|
49 CActive::TPriority aPriority = EPriorityStandard /*TPriority::EPriorityStandard*/); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~CBTRCCActive(); |
|
55 |
|
56 public: |
|
57 |
|
58 virtual void GoActive(); |
|
59 |
|
60 TInt ServiceId() const; |
|
61 |
|
62 void SetServiceId(TInt aServiceId); |
|
63 |
|
64 protected: |
|
65 |
|
66 /** |
|
67 * From CActive. Called when asynchronous request completes. |
|
68 * @since 3.0 |
|
69 * @param None |
|
70 * @return None |
|
71 */ |
|
72 virtual void RunL(); |
|
73 |
|
74 virtual void DoCancel(); |
|
75 |
|
76 protected: |
|
77 |
|
78 /** |
|
79 * C++ default constructor. |
|
80 */ |
|
81 CBTRCCActive(MBTRCCActiveObserver& aObserver, |
|
82 TInt aServiceId, CActive::TPriority aPriority); |
|
83 |
|
84 MBTRCCActiveObserver& Observer(); |
|
85 |
|
86 private: |
|
87 MBTRCCActiveObserver& iObserver; |
|
88 TInt iServiceId; |
|
89 }; |
|
90 |
|
91 #endif // BTRCCACTIVE_H |
|
92 |
|
93 // End of File |