author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:44:03 +0100 | |
branch | GCC_SURGE |
changeset 63 | ef2686f7597e |
parent 25 | 8c311f9acc5e |
parent 38 | 218231f2b3b3 |
permissions | -rw-r--r-- |
35 | 1 |
/* |
2 |
* Copyright (c) 2005-2010 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: Methods for USB UI notifiers |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// INCLUDE FILES |
|
19 |
#include <ecom/ecom.h> |
|
20 |
#include <ecom/implementationproxy.h> |
|
21 |
#include <eiknotapi.h> |
|
22 |
||
23 |
#include "usbuincableconnectednotifier.h" |
|
38
218231f2b3b3
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
24 |
#include "usbuinqueriesnotifiermdrv.h" |
35 | 25 |
#include "usbuinotifdebug.h" |
26 |
#include "usbuinotifotgwarning.h" |
|
27 |
#include "usbuinotifotgerror.h" |
|
28 |
#include "usbuinotifmsmmerror.h" |
|
29 |
||
30 |
// CONSTANTS |
|
31 |
const TInt KUSBUINotifierArrayIncrement = 5; |
|
32 |
||
33 |
// ================= EXPORTED FUNCTIONS ======================================= |
|
34 |
// ---------------------------------------------------------------------------- |
|
35 |
// |
|
36 |
// Instantiate notifiers |
|
37 |
// |
|
38 |
// ---------------------------------------------------------------------------- |
|
39 |
||
40 |
void CreateUSBUINotifiersL(CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers) |
|
41 |
{ |
|
42 |
FLOG(_L("[USBUINOTIF]\t CreateUSBUINotifiersL")); |
|
43 |
||
44 |
CUSBUICableConnectedNotifier* cableConnectedNotifier = |
|
45 |
CUSBUICableConnectedNotifier::NewL(); |
|
46 |
CleanupStack::PushL( cableConnectedNotifier ); |
|
47 |
aNotifiers->AppendL( cableConnectedNotifier ); |
|
48 |
CleanupStack::Pop( cableConnectedNotifier ); |
|
49 |
||
50 |
CUSBUIQueriesNotifier* queriesNotifier = CUSBUIQueriesNotifier::NewL(); |
|
51 |
CleanupStack::PushL( queriesNotifier ); |
|
52 |
aNotifiers->AppendL( queriesNotifier ); |
|
53 |
CleanupStack::Pop( queriesNotifier ); |
|
54 |
||
55 |
CUsbUiNotifOtgWarning* generalNote = CUsbUiNotifOtgWarning::NewL(); |
|
56 |
CleanupStack::PushL( generalNote ); |
|
57 |
aNotifiers->AppendL( generalNote ); |
|
58 |
CleanupStack::Pop( generalNote ); |
|
59 |
||
60 |
CUsbUiNotifOtgError* generalQuery = CUsbUiNotifOtgError::NewL(); |
|
61 |
CleanupStack::PushL( generalQuery ); |
|
62 |
aNotifiers->AppendL( generalQuery ); |
|
63 |
CleanupStack::Pop( generalQuery ); |
|
64 |
||
65 |
CUsbUiNotifMSMMError* msmmerrorQuery = CUsbUiNotifMSMMError::NewL(); |
|
66 |
CleanupStack::PushL( msmmerrorQuery ); |
|
67 |
aNotifiers->AppendL( msmmerrorQuery ); |
|
68 |
CleanupStack::Pop( msmmerrorQuery ); |
|
69 |
||
70 |
FLOG(_L("[USBUINOTIF]\t CreateUSBUINotifiersL completed")); |
|
71 |
} |
|
72 |
||
73 |
// ---------------------------------------------------------------------------- |
|
74 |
// Creates a notifiers array. |
|
75 |
// ---------------------------------------------------------------------------- |
|
76 |
CArrayPtr<MEikSrvNotifierBase2>* NotifierArray() |
|
77 |
{ |
|
78 |
FLOG(_L("[USBUINOTIF]\t NotifierArray")); |
|
79 |
||
80 |
CArrayPtrFlat<MEikSrvNotifierBase2>* notifiers = NULL; |
|
81 |
TRAPD( err, notifiers = |
|
82 |
new (ELeave)CArrayPtrFlat<MEikSrvNotifierBase2>( |
|
83 |
KUSBUINotifierArrayIncrement )); |
|
84 |
||
85 |
if (err == KErrNone) |
|
86 |
{ |
|
87 |
if (notifiers) |
|
88 |
{ |
|
89 |
TRAPD( errCreate, CreateUSBUINotifiersL( notifiers )); |
|
90 |
if (errCreate) |
|
91 |
{ |
|
92 |
TInt count = notifiers->Count(); |
|
93 |
while (count--) |
|
94 |
{ |
|
95 |
(*notifiers)[count]->Release(); |
|
96 |
} |
|
97 |
delete notifiers; |
|
98 |
notifiers = NULL; |
|
99 |
} |
|
100 |
||
101 |
FLOG(_L("[USBUINOTIF]\t NotifierArray completed")); |
|
102 |
} |
|
103 |
} |
|
104 |
else |
|
105 |
{ |
|
106 |
FLOG(_L("[USBUINOTIF]\t NotifierArray Failed!!!")); |
|
107 |
} |
|
108 |
||
109 |
return notifiers; |
|
110 |
} |
|
111 |
||
112 |
// ---------------------------------------------------------------------------- |
|
113 |
// ECOM |
|
114 |
// ---------------------------------------------------------------------------- |
|
115 |
||
116 |
const TImplementationProxy ImplementationTable[] = |
|
38
218231f2b3b3
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
117 |
{ |
35 | 118 |
IMPLEMENTATION_PROXY_ENTRY( 0x10281F23, NotifierArray ) |
38
218231f2b3b3
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
119 |
}; |
35 | 120 |
|
121 |
EXPORT_C const TImplementationProxy* ImplementationGroupProxy( |
|
122 |
TInt& aTableCount) |
|
123 |
{ |
|
124 |
FLOG(_L("[USBUINOTIF]\t ImplementationGroupProxy")); |
|
125 |
aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); |
|
126 |
return ImplementationTable; |
|
127 |
} |
|
128 |
||
129 |
// End of File |