|
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: Message Preview Plugin main class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // SYSTEM INCLUDES |
|
20 #include <mcsplugineventobserver.h> |
|
21 |
|
22 // USER INCLUDES |
|
23 #include "ccspreviewplugin.h" |
|
24 #include "ccspreviewpluginhandler.h" |
|
25 |
|
26 // ============================== MEMBER FUNCTIONS ============================ |
|
27 // ---------------------------------------------------------------------------- |
|
28 // CCsPreviewPlugin::NewL |
|
29 // Two Phase Construction |
|
30 // ---------------------------------------------------------------------------- |
|
31 // |
|
32 CCsPreviewPlugin* CCsPreviewPlugin::NewL(MCsPluginEventObserver* aObserver) |
|
33 { |
|
34 PRINT ( _L("Enter CCsPreviewPlugin::NewL") ); |
|
35 |
|
36 CCsPreviewPlugin* self = new ( ELeave ) CCsPreviewPlugin(aObserver); |
|
37 CleanupStack::PushL( self ); |
|
38 self->ConstructL(); |
|
39 CleanupStack::Pop( self ); |
|
40 |
|
41 PRINT ( _L("End CCsPreviewPlugin::NewL") ); |
|
42 |
|
43 return self; |
|
44 } |
|
45 |
|
46 // ---------------------------------------------------------------------------- |
|
47 // CCsPreviewPlugin::CCsPreviewPlugin |
|
48 // Two Phase Construction |
|
49 // ---------------------------------------------------------------------------- |
|
50 // |
|
51 CCsPreviewPlugin::CCsPreviewPlugin(MCsPluginEventObserver* aObserver):iPluginEventObserver (aObserver) |
|
52 { |
|
53 } |
|
54 |
|
55 // ---------------------------------------------------------------------------- |
|
56 // CCsPreviewPlugin::ConstructL |
|
57 // Two Phase Construction |
|
58 // ---------------------------------------------------------------------------- |
|
59 // |
|
60 void CCsPreviewPlugin::ConstructL() |
|
61 { |
|
62 PRINT ( _L("Enter CCsPreviewPlugin::ConstructL") ); |
|
63 iPreviewPluginHandler=CCsPreviewPluginHandler::NewL(this); |
|
64 PRINT ( _L("Exit CCsPreviewPlugin::ConstructL") ); |
|
65 } |
|
66 // ---------------------------------------------------------------------------- |
|
67 // CCsPreviewPlugin::~CCsPreviewPlugin |
|
68 // Destructor |
|
69 // ---------------------------------------------------------------------------- |
|
70 // |
|
71 CCsPreviewPlugin::~CCsPreviewPlugin() |
|
72 { |
|
73 PRINT ( _L("Enter CCsPreviewPlugin::~CCsPreviewPlugin") ); |
|
74 |
|
75 if(iPreviewPluginHandler) |
|
76 delete iPreviewPluginHandler; |
|
77 iPreviewPluginHandler = NULL; |
|
78 |
|
79 PRINT ( _L("End CCsPreviewPlugin::~CCsPreviewPlugin") ); |
|
80 } |
|
81 |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CCsPreviewPlugin::HandleCachingCompleted |
|
85 // Sends the cache completed status to server |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 void CCsPreviewPlugin::HandleCachingCompleted() |
|
89 { |
|
90 iPluginEventObserver->CachingCompleted(); |
|
91 } |
|
92 |
|
93 // ----------------------------------------------------------------------------- |
|
94 // CCsPreviewPlugin::HandleCachingError |
|
95 // Sends the error occured during the caching to server |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 void CCsPreviewPlugin::HandleCachingError(const TInt aError) |
|
99 { |
|
100 iPluginEventObserver->CachingError(aError); |
|
101 } |
|
102 |
|
103 // ----------------------------------------------------------------------------- |
|
104 // CCsPreviewPlugin::GetConversationsL() |
|
105 // This function starts the state machine to fetch msg data from msvserver |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 void CCsPreviewPlugin::GetConversationsL() |
|
109 { |
|
110 PRINT ( _L("Enter CCsPreviewPlugin::GetConversationsL") ); |
|
111 //THE initial caching is yet to be handled |
|
112 HandleCachingCompleted(); |
|
113 } |
|
114 |
|
115 |
|
116 // End of file |