1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef CMEDIASYNCOBSERVER_H |
|
23 #define CMEDIASYNCOBSERVER_H |
|
24 |
|
25 #include "cmediasyncserverdef.h" |
|
26 #include "cmediasyncdatabase.h" |
|
27 |
|
28 class CMediaSyncDatabase; |
|
29 |
|
30 class CMediaSyncObserver : public CBase, |
|
31 public MMdESessionObserver, |
|
32 public MMdEObjectObserver, |
|
33 public MMdEObjectPresentObserver |
|
34 { |
|
35 public: |
|
36 static CMediaSyncObserver* NewL(CMediaSyncDatabase* aDb); |
|
37 virtual ~CMediaSyncObserver(); |
|
38 |
|
39 void SubscribeForChangeNotificationL(); |
|
40 |
|
41 void UnsubscribeForChangeNotificationL(); |
|
42 |
|
43 public: |
|
44 // From MMdESessionObserver |
|
45 void HandleSessionOpened(CMdESession& aSession, TInt aError); |
|
46 void HandleSessionError(CMdESession& aSession, TInt aError); |
|
47 |
|
48 // From MMdEObjectObserver |
|
49 void HandleObjectNotification(CMdESession& aSession, |
|
50 TObserverNotificationType aType, |
|
51 const RArray<TItemId>& aObjectIdArray); |
|
52 |
|
53 // From MMdEObjectPresentObserver |
|
54 void HandleObjectPresentNotification(CMdESession& aSession, |
|
55 TBool aPresent, |
|
56 const RArray<TItemId>& aObjectIdArray); |
|
57 |
|
58 private: |
|
59 |
|
60 CMediaSyncObserver(CMediaSyncDatabase* aDb); |
|
61 void ConstructL(); |
|
62 |
|
63 void HandleSessionCallback(TInt aError); |
|
64 |
|
65 void HandleObjectNotificationL(CMdESession& aSession, |
|
66 TObserverNotificationType aType, |
|
67 const RArray<TItemId>& aObjectIdArray); |
|
68 |
|
69 void HandleObjectPresentNotificationL(CMdESession& aSession, |
|
70 TBool aPresent, |
|
71 const RArray<TItemId>& aObjectIdArray); |
|
72 |
|
73 private: //not has ownership |
|
74 /** |
|
75 FLOGGER debug trace member variable. |
|
76 */ |
|
77 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
78 |
|
79 CMdESession* iSession; |
|
80 CMediaSyncDatabase* iDb; |
|
81 CActiveSchedulerWait* iSessionWait; |
|
82 TInt iMdeSessionError; |
|
83 TBool iSubscribed; |
|
84 }; |
|
85 |
|
86 #endif /*CMEDIASYNCOBSERVER_H*/ |
|