|
1 /* |
|
2 * Copyright (c) 2007 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: Im Service Connection operation factory |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "imoperationfactoryimp.h" |
|
20 #include "imoperationdefs.h" |
|
21 #include "operationlaunchcleaner.h" |
|
22 //#include "ximpoperationbase.h" |
|
23 //#include "ximppanics.h" |
|
24 #include "imlogutils.h" |
|
25 #include "operationsendmessage.h" |
|
26 #include "operationreceivemessage.h" |
|
27 using namespace NImOps; |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CXIMPOperationFactory::NewL() |
|
33 // Singleton access method. |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 EXPORT_C CImOperationFactory* CImOperationFactory::NewL() |
|
37 { |
|
38 XImLogger::Log(_L("CImOperationFactory::NewL Started")); |
|
39 CImOperationFactory* self = new ( ELeave ) CImOperationFactory(); |
|
40 CleanupStack::PushL( self ); |
|
41 self->ConstructL(); |
|
42 CleanupStack::Pop( self ); |
|
43 XImLogger::Log(_L("CImOperationFactory::NewL Completed")); |
|
44 return self; |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CXIMPOperationFactory::CXIMPOperationFactory() |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 CImOperationFactory::CImOperationFactory() |
|
52 { |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CXIMPOperationFactory::~CXIMPOperationFactory() |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 CImOperationFactory::~CImOperationFactory() |
|
60 { |
|
61 XImLogger::Log(_L("CImOperationFactory::~CImOperationFactory Started")); |
|
62 XImLogger::Log(_L("CImOperationFactory::~CImOperationFactory Completed")); |
|
63 } |
|
64 |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // CXIMPOperationFactory::ConstructL() |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 void CImOperationFactory::ConstructL() |
|
71 { |
|
72 XImLogger::Log(_L("CImOperationFactory::ConstructL Started")); |
|
73 XImLogger::Log(_L("CImOperationFactory::ConstructL Completed")); |
|
74 } |
|
75 |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CXIMPOperationFactory::CreateOperationL() |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 CXIMPOperationBase* CImOperationFactory::CreateOperationL( TInt aOperation ) |
|
82 { |
|
83 XImLogger::Log(_L("CImOperationFactory::CreateOperationL Started")); |
|
84 CXIMPOperationBase* op = NULL; |
|
85 NImOps::TImOpTypes operation = ( NImOps::TImOpTypes ) aOperation; |
|
86 switch( operation ) |
|
87 { |
|
88 case ESendImMessage: |
|
89 { |
|
90 XImLogger::Log(_L("CImOperationFactory::CreateOperationL = ESendImMessage")); |
|
91 op = new ( ELeave ) COperationSendMessage(); |
|
92 break; |
|
93 } |
|
94 case EIMCleaner: |
|
95 { |
|
96 XImLogger::Log(_L("CImOperationFactory::CreateOperationL = EIMCleaner")); |
|
97 op = new ( ELeave ) COperationLaunchCleaner(); |
|
98 break; |
|
99 } |
|
100 case EHandleReceiveMessage: |
|
101 { |
|
102 XImLogger::Log(_L("CImOperationFactory::CreateOperationL = EHandleReceiveMessage")); |
|
103 op = new ( ELeave ) COperationReceiveMessage(); |
|
104 break; |
|
105 } |
|
106 default: |
|
107 { |
|
108 break; |
|
109 } |
|
110 } |
|
111 XImLogger::Log(_L("CImOperationFactory::CreateOperationL Completed")); |
|
112 return op; |
|
113 } |
|
114 // End of file |
|
115 |
|
116 |