24
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "cmmmessagemanagerbase.h"
|
|
20 |
#include <ctsy/tflogger.h>
|
|
21 |
#include "ctsydelegates.h"
|
|
22 |
|
|
23 |
// ======== MEMBER FUNCTIONS ========
|
|
24 |
|
|
25 |
EXPORT_C CMmMessageManagerBase* CMmMessageManagerBase::NewL()
|
|
26 |
{
|
|
27 |
CMmMessageManagerBase* messageManager = NULL;
|
|
28 |
messageManager = new ( ELeave ) CMmMessageManagerBase();
|
|
29 |
CleanupStack::PushL( messageManager );
|
|
30 |
messageManager->ConstructL();
|
|
31 |
CleanupStack::Pop();
|
|
32 |
return messageManager;
|
|
33 |
}
|
|
34 |
|
|
35 |
CMmMessageManagerBase::~CMmMessageManagerBase()
|
|
36 |
{
|
|
37 |
// instance was created in this object, so we delete it here
|
|
38 |
if ( iTsyDelgates )
|
|
39 |
{
|
|
40 |
delete iTsyDelgates;
|
|
41 |
}
|
|
42 |
iTsyDelgates = NULL;
|
|
43 |
|
|
44 |
if ( iMessageRouterProxy )
|
|
45 |
{
|
|
46 |
delete iMessageRouterProxy;
|
|
47 |
}
|
|
48 |
iMessageRouterProxy = NULL;
|
|
49 |
}
|
|
50 |
|
|
51 |
CMmMessageManagerBase::CMmMessageManagerBase()
|
|
52 |
{
|
|
53 |
}
|
|
54 |
|
|
55 |
void CMmMessageManagerBase::ConstructL()
|
|
56 |
{
|
|
57 |
//Create instances
|
|
58 |
iTsyDelgates = CTsyDelegates::NewL();
|
|
59 |
iMessageRouterProxy = CMmMessageRouterProxy::NewL( *iTsyDelgates );
|
|
60 |
}
|
|
61 |
|
|
62 |
// ---------------------------------------------------------------------------
|
|
63 |
// CMmMessageManagerBase::SetPhoneTsy
|
|
64 |
// Set phone Tsy object
|
|
65 |
// (other items were commented in a header).
|
|
66 |
// ---------------------------------------------------------------------------
|
|
67 |
EXPORT_C void CMmMessageManagerBase::SetPhoneTsy( CMmPhoneTsy* aMmPhone )
|
|
68 |
{
|
|
69 |
TFLOGSTRING2("TSY: CMmMessageManagerBase::SetPhoneTsy : Phone=0x%x", aMmPhone );
|
|
70 |
iMmPhone = aMmPhone;
|
|
71 |
|
|
72 |
if( iMessageRouterProxy )
|
|
73 |
{
|
|
74 |
iMessageRouterProxy->SetPhoneTsy( iMmPhone );
|
|
75 |
}
|
|
76 |
}
|
|
77 |
// ---------------------------------------------------------------------------
|
|
78 |
// CMmMessageManagerBase::HandleRequestL
|
|
79 |
// Forwards a request to DOS layer
|
|
80 |
// (other items were commented in a header).
|
|
81 |
// ---------------------------------------------------------------------------
|
|
82 |
//
|
|
83 |
TInt CMmMessageManagerBase::HandleRequestL(
|
|
84 |
const TInt aIpc )
|
|
85 |
{
|
|
86 |
TFLOGSTRING2("TSY: CMmMessageManagerBase::HandleRequestL. IPC = %d", aIpc );
|
|
87 |
return HandleRequestL(
|
|
88 |
aIpc, REINTERPRET_CAST( const CMmDataPackage*, NULL ) );
|
|
89 |
}
|
|
90 |
|
|
91 |
// ---------------------------------------------------------------------------
|
|
92 |
// CMmMessageManagerBase::HandleRequestL
|
|
93 |
// Forwards a request to DOS layer
|
|
94 |
// (other items were commented in a header).
|
|
95 |
// ---------------------------------------------------------------------------
|
|
96 |
//
|
|
97 |
TInt CMmMessageManagerBase::HandleRequestL(
|
|
98 |
const TInt aIpc,
|
|
99 |
const CMmDataPackage* aDataPackage )
|
|
100 |
{
|
|
101 |
TFLOGSTRING2("TSY: CMmMessageManagerBase::HandleRequestL. IPC = %d", aIpc );
|
|
102 |
|
|
103 |
return iMessageRouter->ExtFuncL( aIpc, aDataPackage );
|
|
104 |
}
|
|
105 |
|
|
106 |
// ---------------------------------------------------------------------------
|
|
107 |
// CMmMessageManagerBase::HandleRequestL
|
|
108 |
// Forwards a request to DOS layer
|
|
109 |
// (other items were commented in a header).
|
|
110 |
// ---------------------------------------------------------------------------
|
|
111 |
//
|
|
112 |
TInt CMmMessageManagerBase::HandleRequestL(
|
|
113 |
const TInt aIpc,
|
|
114 |
const TDataPackage* aDataPackage )
|
|
115 |
{
|
|
116 |
TFLOGSTRING2("TSY: CMmMessageManagerBase::HandleRequestL. IPC = %d", aIpc );
|
|
117 |
|
|
118 |
// map the TDataPackage into a CMmDataPackage
|
|
119 |
// Non-core Methods from the SOS layer using the DOS layer will perforn
|
|
120 |
// always this mapping.
|
|
121 |
// TSY core methods will call directly the overloaded HandleRequest method
|
|
122 |
// which uses a CMmDataPackage in the method's signature.
|
|
123 |
iDataPackage.SetPacketData ( aDataPackage );
|
|
124 |
|
|
125 |
//call the overloaded HandleRequest of CMmMessageManagerBase
|
|
126 |
return HandleRequestL( aIpc, &iDataPackage );
|
|
127 |
}
|
|
128 |
|
|
129 |
// ---------------------------------------------------------------------------
|
|
130 |
// CMmMessageManagerBase::RegisterTsyObject
|
|
131 |
// Registers a Tsy object for request and notification completions
|
|
132 |
// Stored in Tsy Delegates
|
|
133 |
// (other items were commented in a header).
|
|
134 |
// ---------------------------------------------------------------------------
|
|
135 |
//
|
|
136 |
void CMmMessageManagerBase::RegisterTsyObject(
|
|
137 |
TTsyObjects aTsyObjectType,
|
|
138 |
CBase* aTsyObject )
|
|
139 |
{
|
|
140 |
iTsyDelgates->RegisterTsyObject( aTsyObjectType, aTsyObject );
|
|
141 |
}
|
|
142 |
|
|
143 |
// ---------------------------------------------------------------------------
|
|
144 |
// CMmMessageManagerBase::DeregisterTsyObject
|
|
145 |
// Remove registered Tsy object stored in Tsy Delegates
|
|
146 |
// (other items were commented in a header).
|
|
147 |
// ---------------------------------------------------------------------------
|
|
148 |
//
|
|
149 |
void CMmMessageManagerBase::DeregisterTsyObject(
|
|
150 |
CBase* aTsyObject )
|
|
151 |
{
|
|
152 |
iTsyDelgates->DeregisterTsyObject( aTsyObject );
|
|
153 |
}
|
|
154 |
|
|
155 |
// ---------------------------------------------------------------------------
|
|
156 |
// CMmMessageManagerBase::GetMessageManagerCallback
|
|
157 |
// Return pointer to MessageManagerCallback object
|
|
158 |
// (other items were commented in a header).
|
|
159 |
// ---------------------------------------------------------------------------
|
|
160 |
//
|
|
161 |
EXPORT_C MmMessageManagerCallback*
|
|
162 |
CMmMessageManagerBase::GetMessageManagerCallback()
|
|
163 |
{
|
|
164 |
return iMessageRouterProxy;
|
|
165 |
}
|
|
166 |
|
|
167 |
|
|
168 |
// ======== OTHER EXPORTED FUNCTIONS ========
|
|
169 |
|
|
170 |
// ---------------------------------------------------------------------------
|
|
171 |
// CMmMessageManagerBase::SetMessageRouter
|
|
172 |
// Sets message router ptr.
|
|
173 |
// (other items were commented in a header)
|
|
174 |
// ---------------------------------------------------------------------------
|
|
175 |
//
|
|
176 |
EXPORT_C void CMmMessageManagerBase::SetMessageRouter(
|
|
177 |
MMessageRouter* aMessageRouter )
|
|
178 |
{
|
|
179 |
TFLOGSTRING2("TSY: CMmMessageManagerBase::SetMessageRouter : MessageRouter=0x%x", aMessageRouter );
|
|
180 |
iMessageRouter = aMessageRouter;
|
|
181 |
}
|
|
182 |
|
|
183 |
|
|
184 |
// End of File
|
|
185 |
|