|
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 "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: Static factory class used to create publishers. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "aipublisherfactory.h" |
|
20 |
|
21 // Publishers |
|
22 #include "aiprofilepublisher.h" |
|
23 #include "aidatepublisher.h" |
|
24 #include "aioperatorlogopublisher.h" |
|
25 #include "aioperatornamepublisher.h" |
|
26 #include "aibtsappublisher.h" |
|
27 #include "aimcnpublisher.h" |
|
28 #include "aicugpublisher.h" |
|
29 #include "aivhzpublisher.h" |
|
30 #include "ainwspublisher.h" |
|
31 #include "aisimregpublisher.h" |
|
32 #include "aicugmcnpublisher.h" |
|
33 |
|
34 template<class T> |
|
35 class TPublisherFactory |
|
36 { |
|
37 public: |
|
38 MAiDeviceStatusPublisher* CreatePublisherL() |
|
39 { |
|
40 //Create publisher.. |
|
41 MAiDeviceStatusPublisher* publisher = NULL; |
|
42 TRAPD( err, publisher = T::NewL() ); |
|
43 |
|
44 //If publisher creation fails with error code KErrNotSupported, |
|
45 //return NULL. |
|
46 if( err == KErrNotSupported ) |
|
47 { |
|
48 err = KErrNone; |
|
49 } |
|
50 |
|
51 User::LeaveIfError( err ); |
|
52 |
|
53 return publisher; |
|
54 } |
|
55 }; |
|
56 |
|
57 |
|
58 MAiDeviceStatusPublisher* AiPublisherFactory::CreateProfilePublisherL() |
|
59 { |
|
60 TPublisherFactory<CAiProfilePublisher> factory; |
|
61 return factory.CreatePublisherL(); |
|
62 } |
|
63 |
|
64 |
|
65 MAiDeviceStatusPublisher* AiPublisherFactory::CreateDatePublisherL() |
|
66 { |
|
67 TPublisherFactory<CAiDatePublisher> factory; |
|
68 return factory.CreatePublisherL(); |
|
69 } |
|
70 |
|
71 |
|
72 MAiDeviceStatusPublisher* AiPublisherFactory::CreateOperatorLogoPublisherL() |
|
73 { |
|
74 TPublisherFactory<CAiOperatorLogoPublisher> factory; |
|
75 return factory.CreatePublisherL(); |
|
76 } |
|
77 |
|
78 |
|
79 MAiDeviceStatusPublisher* AiPublisherFactory::CreateOperatorNamePublisherL() |
|
80 { |
|
81 TPublisherFactory<CAiOperatorNamePublisher> factory; |
|
82 return factory.CreatePublisherL(); |
|
83 } |
|
84 |
|
85 |
|
86 MAiDeviceStatusPublisher* AiPublisherFactory::CreateBTSAPPublisherL() |
|
87 { |
|
88 TPublisherFactory<CAiBTSAPPublisher> factory; |
|
89 return factory.CreatePublisherL(); |
|
90 } |
|
91 |
|
92 |
|
93 MAiDeviceStatusPublisher* AiPublisherFactory::CreateMCNPublisherL() |
|
94 { |
|
95 TPublisherFactory<CAiMCNPublisher> factory; |
|
96 return factory.CreatePublisherL(); |
|
97 } |
|
98 |
|
99 |
|
100 MAiDeviceStatusPublisher* AiPublisherFactory::CreateCUGPublisherL() |
|
101 { |
|
102 TPublisherFactory<CAiCUGPublisher> factory; |
|
103 return factory.CreatePublisherL(); |
|
104 } |
|
105 |
|
106 |
|
107 MAiDeviceStatusPublisher* AiPublisherFactory::CreateSimRegPublisherL() |
|
108 { |
|
109 TPublisherFactory<CAiSimRegPublisher> factory; |
|
110 return factory.CreatePublisherL(); |
|
111 } |
|
112 |
|
113 |
|
114 MAiDeviceStatusPublisher* AiPublisherFactory::CreateNWSPublisherL() |
|
115 { |
|
116 TPublisherFactory<CAiNwsPublisher> factory; |
|
117 return factory.CreatePublisherL(); |
|
118 } |
|
119 |
|
120 |
|
121 MAiDeviceStatusPublisher* AiPublisherFactory::CreateVHZPublisherL() |
|
122 { |
|
123 TPublisherFactory<CAiVHZPublisher> factory; |
|
124 return factory.CreatePublisherL(); |
|
125 } |
|
126 |
|
127 MAiDeviceStatusPublisher* AiPublisherFactory::CreateCUGMCNPublisherL() |
|
128 { |
|
129 TPublisherFactory<CAiCUGMCNPublisher> factory; |
|
130 return factory.CreatePublisherL(); |
|
131 } |