|
1 /* |
|
2 * Copyright (c) 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: CAccSrvWiredConnectionPublisher declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef ACCSRVWIREDCONNECTIONPUBLISHER_H |
|
20 #define ACCSRVWIREDCONNECTIONPUBLISHER_H |
|
21 |
|
22 #include <e32property.h> |
|
23 #include <AccPolGenericID.h> |
|
24 |
|
25 /** |
|
26 * Wired accessory connection status publisher. |
|
27 * CAccSrvWiredConnectionPublisher updates the P&S key holding the status of |
|
28 * wired accessory (other than USB) connections regardless of the actual accessory modes. |
|
29 * |
|
30 * @lib None. |
|
31 * @since S60 3.2 |
|
32 */ |
|
33 NONSHARABLE_CLASS( CAccSrvWiredConnectionPublisher ) : public CBase |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CAccSrvWiredConnectionPublisher* NewL(); |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CAccSrvWiredConnectionPublisher* NewLC(); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CAccSrvWiredConnectionPublisher(); |
|
52 |
|
53 /** |
|
54 * Handle accessory connection according to given Generic ID. |
|
55 * Only the first wired connection is updated to the P&S key, subsequent |
|
56 * connects only update the reference counter. |
|
57 * |
|
58 * @since S60 3.2 |
|
59 * @param aGenericId Generic ID of the connected accessory. |
|
60 */ |
|
61 void HandleConnectL( const TAccPolGenericID& aGenericID ); |
|
62 |
|
63 /** |
|
64 * Start to handle accessory disconnection according to given Generic ID. |
|
65 * Decreases the reference counter when a wired accessory is disconnected. |
|
66 * Once the reference counter is decreased to 0 the P&S key status is set to 'disconnected'. |
|
67 * |
|
68 * @since S60 3.2 |
|
69 * @param aGenericID Generic ID of the disconnected accessory |
|
70 */ |
|
71 void HandleDisconnectL( const TAccPolGenericID& aGenericID ); |
|
72 |
|
73 private: |
|
74 |
|
75 /* |
|
76 * C++ default constructor. |
|
77 */ |
|
78 CAccSrvWiredConnectionPublisher(); |
|
79 |
|
80 /* |
|
81 * Symbian 2nd-phase constructor. |
|
82 */ |
|
83 void ConstructL(); |
|
84 |
|
85 |
|
86 private: // data |
|
87 |
|
88 /** |
|
89 * Count of wired connections. |
|
90 */ |
|
91 TInt iConnectionCount; |
|
92 |
|
93 /** |
|
94 * Publish&Subscribe key session used for publishing wired accessory state. |
|
95 */ |
|
96 RProperty iProperty; |
|
97 }; |
|
98 |
|
99 #endif // ACCSRVWIREDCONNECTIONPUBLISHER_H |