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: CSConSyncService header file. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _SCONSYNCSERVICE_H_ |
|
20 #define _SCONSYNCSERVICE_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <apgcli.h> // RApaLsSession |
|
24 #include <SyncMLClientDS.h> |
|
25 |
|
26 |
|
27 class TApaAppInfo; |
|
28 class RApaLsSession; |
|
29 class CRepository; |
|
30 |
|
31 |
|
32 class TSConSolutionInfo |
|
33 { |
|
34 public: |
|
35 TSConSolutionInfo():iTime(0){} |
|
36 public: |
|
37 TFileName iSolutionName; |
|
38 TUint iUid; |
|
39 TTime iTime; |
|
40 }; |
|
41 |
|
42 /** |
|
43 * This class provides information about active sync solutions. |
|
44 * |
|
45 * @code |
|
46 * CSConSyncService *syncService = CSConSyncService::NewLC(); |
|
47 * SConSolutionInfo solutionInfo; |
|
48 * syncService->GetSolutionL( KSeconCalendarUid, solutionInfo ); |
|
49 * CleanupStack::PopAndDestroy( syncService ); |
|
50 * @endcode |
|
51 * |
|
52 * @since S60 v5.0 |
|
53 */ |
|
54 NONSHARABLE_CLASS( CSConSyncService ) : public CBase |
|
55 { |
|
56 public: |
|
57 static CSConSyncService* NewLC(); |
|
58 ~CSConSyncService(); |
|
59 |
|
60 /** |
|
61 * Populate SolutionInfo according to content type. |
|
62 * |
|
63 * @since S60 v5.0 |
|
64 * @param aSeconContentType Contenttype to be readed |
|
65 * @param aSolutionInfo contains founded solution info, |
|
66 * solution info is empty if not found |
|
67 * @return none |
|
68 */ |
|
69 void GetSolutionL( const TUint aSeconContentType, TSConSolutionInfo& aSolutionInfo ); |
|
70 |
|
71 private: |
|
72 |
|
73 CSConSyncService(); |
|
74 void ConstructL(); |
|
75 |
|
76 // Return correct providerId according to content type. |
|
77 TSmlDataProviderId ProviderId( const TUint32 aSeconContentType ) const; |
|
78 |
|
79 // Parse time from text |
|
80 TInt ParseTimestamp( TTime& aTime, const TDesC& aTimestamp ) const; |
|
81 |
|
82 // Get application caption. |
|
83 void GetApplicationCaptionL( TDes& aCaption, const TUid aAppUid ); |
|
84 |
|
85 // Search UID from installed applications, return app caption |
|
86 void GetInstPackageCaptionL( TDes& aCaption, const TUid aPackageUid ); |
|
87 |
|
88 // Gets last used profile for selected provider |
|
89 void GetLastUsedProfileNameL( TDes& aProfileName, TTime& aTime, |
|
90 const TSmlDataProviderId& aDataProviderId ); |
|
91 |
|
92 // Gets last sync time for certain profile and provider. |
|
93 void GetLastSyncTimeL( TTime& aTime, const TSmlProfileId aSyncProfileId, |
|
94 const TSmlDataProviderId aDataProviderId ); |
|
95 |
|
96 // Gets provider task id from profile |
|
97 void GetProviderTaskL( TSmlTaskId& aProviderTask, |
|
98 RSyncMLDataSyncProfile& aSyncProfile, |
|
99 const TSmlDataProviderId aDataProviderId ) const; |
|
100 |
|
101 // Gets latest historyJob where task is correct. |
|
102 const CSyncMLHistoryJob* LatestHistoryJob( RSyncMLHistoryLog& aHistoryLog, |
|
103 TInt aTaskId ) const; |
|
104 |
|
105 // Returns ETrue if task exists in HistoryJob. |
|
106 TBool TaskExist( const CSyncMLHistoryJob* aHistoryJob, TInt aTaskId ) const; |
|
107 |
|
108 private: // data |
|
109 TBool iApaSessionConnected; |
|
110 RApaLsSession iApaSession; |
|
111 TBool iSyncSessionOpened; |
|
112 RSyncMLSession iSyncSession; |
|
113 CRepository* iRepository; |
|
114 }; |
|
115 |
|
116 #endif // _SCONSYNCSERVICE_H_ |
|