20
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 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:
|
|
15 |
* Logs etel base class
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
// INCLUDE FILES
|
|
21 |
#include <e32svr.h>
|
|
22 |
#include <exterror.h>
|
|
23 |
#include <etel.h>
|
|
24 |
#include <etelmm.h>
|
|
25 |
#include <mmtsy_names.h>
|
|
26 |
#include <secui.h>
|
|
27 |
#include <secuisecurityhandler.h>
|
|
28 |
|
|
29 |
|
|
30 |
#include "CLogsEtelBase.h"
|
|
31 |
|
|
32 |
// CONSTANTS
|
|
33 |
|
|
34 |
// _LIT(KMissingImplementation,"ETEL functionality missing");
|
|
35 |
|
|
36 |
// ================= MEMBER FUNCTIONS =======================
|
|
37 |
|
|
38 |
|
|
39 |
// Default c++ constructor
|
|
40 |
CLogsEtelBase::CLogsEtelBase():
|
|
41 |
CActive(EPriorityStandard),
|
|
42 |
iConnectionOk(EFalse)
|
|
43 |
{
|
|
44 |
}
|
|
45 |
|
|
46 |
// Destructor
|
|
47 |
CLogsEtelBase::~CLogsEtelBase()
|
|
48 |
{
|
|
49 |
}
|
|
50 |
|
|
51 |
void CLogsEtelBase::CloseEtelConnection()
|
|
52 |
{
|
|
53 |
if( iConnectionOk )
|
|
54 |
{
|
|
55 |
iPhone.Close();
|
|
56 |
iServer.UnloadPhoneModule( KMmTsyModuleName );
|
|
57 |
iServer.Close();
|
|
58 |
iConnectionOk = EFalse;
|
|
59 |
}
|
|
60 |
}
|
|
61 |
|
|
62 |
TInt CLogsEtelBase::OpenEtelConnection()
|
|
63 |
{
|
|
64 |
if(iConnectionOk)
|
|
65 |
{
|
|
66 |
return KErrNone;
|
|
67 |
}
|
|
68 |
|
|
69 |
TInt ret( iServer.Connect() );
|
|
70 |
if( ret != KErrNone )
|
|
71 |
{
|
|
72 |
return ret;
|
|
73 |
}
|
|
74 |
|
|
75 |
// load phone module
|
|
76 |
ret = iServer.LoadPhoneModule( KMmTsyModuleName );
|
|
77 |
if( ret != KErrNone )
|
|
78 |
{
|
|
79 |
iServer.Close();
|
|
80 |
return ret;
|
|
81 |
}
|
|
82 |
iServer.SetExtendedErrorGranularity( RTelServer::EErrorExtended );
|
|
83 |
|
|
84 |
// get phone name
|
|
85 |
RTelServer::TPhoneInfo iInfo;
|
|
86 |
ret = iServer.GetPhoneInfo( 0, iInfo );
|
|
87 |
if( ret != KErrNone )
|
|
88 |
{
|
|
89 |
iServer.UnloadPhoneModule( KMmTsyModuleName );
|
|
90 |
iServer.Close();
|
|
91 |
return ret;
|
|
92 |
}
|
|
93 |
|
|
94 |
// open phone
|
|
95 |
ret = iPhone.Open( iServer, iInfo.iName );
|
|
96 |
if( ret != KErrNone )
|
|
97 |
{
|
|
98 |
iServer.UnloadPhoneModule( KMmTsyModuleName );
|
|
99 |
iServer.Close();
|
|
100 |
return ret;
|
|
101 |
}
|
|
102 |
|
|
103 |
iConnectionOk = ETrue;
|
|
104 |
return ret;
|
|
105 |
}
|
|
106 |
|
|
107 |
void CLogsEtelBase::ShowSecUiNoteLD( TInt aResourceId )
|
|
108 |
{
|
|
109 |
TSecUi::InitializeLibL();
|
|
110 |
TInt err;
|
|
111 |
TRAP(err, CAknNoteDialog* noteDlg = new ( ELeave )
|
|
112 |
CAknNoteDialog(
|
|
113 |
CAknNoteDialog::ENoTone,
|
|
114 |
CAknNoteDialog::ELongTimeout );
|
|
115 |
noteDlg->ExecuteLD( aResourceId );
|
|
116 |
);
|
|
117 |
TSecUi::UnInitializeLib();
|
|
118 |
}
|
|
119 |
|
|
120 |
|
|
121 |
// End of file
|