5
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-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 the License "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: describes system information notifiers.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef __SYSACCESSORYREQUEST_H__
|
|
20 |
#define __SYSACCESSORYREQUEST_H__
|
|
21 |
|
|
22 |
//INCLUDES
|
|
23 |
#include <AccessoryServer.h>
|
|
24 |
#include <AccessoryConnection.h>
|
|
25 |
|
|
26 |
#include "sysinfo.h"
|
|
27 |
#include "activerequests.h"
|
|
28 |
|
|
29 |
// CONSTANT DECLARATIONS
|
|
30 |
|
|
31 |
// FORWARD DECLARATIONS
|
|
32 |
|
|
33 |
/**
|
|
34 |
* @ref CAccessory active object class to handle accessory notifications
|
|
35 |
*
|
|
36 |
* @lib sysinfoservice.lib
|
|
37 |
* @since 3.2
|
|
38 |
*/
|
|
39 |
NONSHARABLE_CLASS(CAccessory): public CActiveRequest
|
|
40 |
{
|
|
41 |
public:
|
|
42 |
/**
|
|
43 |
* Two-phased constructor.
|
|
44 |
*
|
|
45 |
* @return A new instance of this class.
|
|
46 |
*/
|
|
47 |
static CAccessory* NewL( const TSysRequest& aRequest );
|
|
48 |
/**
|
|
49 |
* Destructor.
|
|
50 |
*/
|
|
51 |
~CAccessory();
|
|
52 |
|
|
53 |
private:
|
|
54 |
/**
|
|
55 |
* C++ default constructor.
|
|
56 |
*/
|
|
57 |
CAccessory( TSysRequest::TRequestType aReqType, TInt32 aTransID,
|
|
58 |
ISystemObserver* aObsrvr );
|
|
59 |
|
|
60 |
/**
|
|
61 |
* By default Symbian 2nd phase constructor is private.
|
|
62 |
*/
|
|
63 |
void ConstructL();
|
|
64 |
|
|
65 |
private:
|
|
66 |
/**
|
|
67 |
* On return aGenId consists of disconnected accessory.
|
|
68 |
*/
|
|
69 |
void DisConnectedAccessoryL(TAccPolGenericID& aGenId);
|
|
70 |
|
|
71 |
public:
|
|
72 |
/**
|
|
73 |
* Issues accesssory request.
|
|
74 |
*/
|
|
75 |
TInt Request();
|
|
76 |
|
|
77 |
protected: // from CActive
|
|
78 |
void RunL();
|
|
79 |
void DoCancel();
|
|
80 |
|
|
81 |
private: // DATA
|
|
82 |
|
|
83 |
//Handle to accessory server
|
|
84 |
RAccessoryServer iAccSrv;
|
|
85 |
RAccessoryConnection iAccessoryConnection;
|
|
86 |
// current and old accssory ID list.
|
|
87 |
TAccPolGenericIDArray iGenIdArrayOld;
|
|
88 |
TAccPolGenericIDArray iGenIdArrayCur;
|
|
89 |
// current and old accssory count.
|
|
90 |
TInt iAccCountOld;
|
|
91 |
TInt iAccCountCur;
|
|
92 |
|
|
93 |
CAccessoryInfo::TAccessoryType iAccType;
|
|
94 |
CAccessoryInfo::TAccessoryState iAccState;
|
|
95 |
};
|
|
96 |
|
|
97 |
#endif __SYSACCESSORYREQUEST_H__ |