|
1 /* |
|
2 * Copyright (c) 2002-2008 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 * |
|
16 */ |
|
17 |
|
18 #include <e32base.h> |
|
19 #include <AknNotifyStd.h> |
|
20 #include "AknNotify.h" |
|
21 #include "AknNotifyDebug.h" |
|
22 #include <aknSDData.h> |
|
23 #include <AknCapServerDefs.h> |
|
24 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
25 #include <uikon.hrh> |
|
26 #else |
|
27 #include <uikon.hrh> |
|
28 #include <uiklaf/private/pluginuid.hrh> |
|
29 #endif |
|
30 #include <apaserverapp.h> |
|
31 #include <eikserverapp.h> |
|
32 #include <AknNotifierWrapper.h> |
|
33 |
|
34 TInt RNotifier2::Connect() |
|
35 { |
|
36 TInt ret = KErrNone; |
|
37 if (Handle() == NULL) |
|
38 { |
|
39 _LIT(KServerNameFormat, "%08x_%08x_AppServer"); |
|
40 TFullName serverName; |
|
41 TUid serviceUid = KAknNotifierServiceUid; |
|
42 serverName.Format(KServerNameFormat, KUikonUidPluginInterfaceNotifiers, KAknCapServerUid); |
|
43 ret = CreateSession(serverName,*reinterpret_cast<TVersion*>(&serviceUid)); |
|
44 } |
|
45 return ret; |
|
46 } |
|
47 |
|
48 EXPORT_C CAknNotifyBase::~CAknNotifyBase() |
|
49 { |
|
50 if (iStarted) |
|
51 { |
|
52 iNotify.CancelNotifier(iUid); |
|
53 } |
|
54 |
|
55 delete iSecondaryDisplayData; |
|
56 iNotify.Close(); |
|
57 } |
|
58 |
|
59 CAknNotifyBase::CAknNotifyBase(TUid aUid) : iUid(aUid) |
|
60 { |
|
61 } |
|
62 |
|
63 void CAknNotifyBase::ConstructL() |
|
64 { |
|
65 } |
|
66 |
|
67 void CAknNotifyBase::StartOrUpdateL(const TDesC8& aBuffer,TDes8& aResponse) |
|
68 { |
|
69 TInt err = iNotify.Connect(); |
|
70 User::LeaveIfError(err); |
|
71 |
|
72 if (!iStarted) |
|
73 { |
|
74 err = iNotify.StartNotifier(iUid, aBuffer, aResponse); |
|
75 if (err == KErrNone) |
|
76 { |
|
77 iStarted = ETrue; |
|
78 } |
|
79 } |
|
80 else |
|
81 { |
|
82 err = iNotify.UpdateNotifier(iUid, aBuffer, aResponse); |
|
83 } |
|
84 |
|
85 #ifdef AKNNOTIFY_RDEBUG_INFO |
|
86 RDebug::Print(_L("CAknNotifyBase::StartOrUpdateL: err %d"),err); |
|
87 #endif |
|
88 |
|
89 User::LeaveIfError(err); |
|
90 } |
|
91 |
|
92 void CAknNotifyBase::StartOrUpdateAndGetResponseL( |
|
93 TRequestStatus& aStatus, |
|
94 const TDesC8& aBuffer, |
|
95 TDes8& aResponse) |
|
96 { |
|
97 TInt err = iNotify.Connect(); |
|
98 User::LeaveIfError(err); |
|
99 |
|
100 iStarted = ETrue; |
|
101 iNotify.StartNotifierAndGetResponse(aStatus, iUid, aBuffer, aResponse); |
|
102 } |
|
103 |
|
104 EXPORT_C void CAknNotifyBase::CAknNotifyBase_Reserved() |
|
105 { |
|
106 } |
|
107 |
|
108 EXPORT_C void CAknNotifyBase::SetSecondaryDisplayData(CAknSDData* aData) |
|
109 { |
|
110 delete iSecondaryDisplayData; |
|
111 iSecondaryDisplayData = aData; |
|
112 } |
|
113 |
|
114 CAknSDData* CAknNotifyBase::SecondaryDisplayData() |
|
115 { |
|
116 return iSecondaryDisplayData; |
|
117 } |
|
118 |
|
119 // End of File |