|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Provides methods to retrieve device management |
|
15 * information. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef DMINFORETRIEVAL_H_ |
|
20 #define DMINFORETRIEVAL_H_ |
|
21 #include <qobject.h> |
|
22 #include <featmgr.h> |
|
23 #include <QGraphicsItem> |
|
24 #include <e32base.h> |
|
25 #include <badesca.h> |
|
26 #include "nsmldmsyncappengine.h" |
|
27 #include "nsmldmsyncprofile.h" |
|
28 //#include "NSmlDMSyncProfileItem.h" |
|
29 #include "nsmldmsyncutil.h" |
|
30 #include "nsmldmsyncdebug.h" |
|
31 #include "nsmldmsyncprofilelist.h" |
|
32 #include "nsmldmdbnotifier.h" |
|
33 class DmAdvancedView; |
|
34 class TNSmlDMProfileItem; |
|
35 //class CNSmlDMDbNotifier; |
|
36 class DmInfo: public QObject, public MNSmlDMDbEventHandler |
|
37 { |
|
38 Q_OBJECT |
|
39 |
|
40 public: |
|
41 DmInfo(DmAdvancedView* serversview, QGraphicsItem *parent=0); |
|
42 virtual ~DmInfo(); |
|
43 void refreshProfileList(TBool aIncludeHidden = ETrue); |
|
44 int profilescount(); |
|
45 int profileinfo(int profilelistnum, QStringList& itemtext, int& icon, bool& lock); |
|
46 void setDefaultProfile(int listitem); |
|
47 bool Isprofilelocked(int profilelistnum/*, bool& lock*/); |
|
48 bool Isdefaultprofile(int profilelistnum/*, bool& defaultprofile*/); |
|
49 void profileTransport(int profilelistnum, int& transport); |
|
50 TInt DeleteProfile( TInt& aIndex ); |
|
51 bool createNewprofile(); |
|
52 int saveProfile(QStringList& itemdata, bool& sessmode, QString& currap,unsigned int& portnum, bool& nauth ); |
|
53 bool getProfiledata(int& itemnum, QStringList& itemdata, bool& sessmode, QStringList& iaplist, int& curriap, int& portnum, bool& nwauth); |
|
54 bool checksrvid(QString& serverid); |
|
55 void getIaplist(QStringList& iaplist, int& iapselected, int& listindex); |
|
56 void synchronize(int& itemnum); |
|
57 void synccomplete(int); |
|
58 /** |
|
59 * Handles DB events |
|
60 * @param aEvent DB event |
|
61 * @return None |
|
62 */ |
|
63 void HandleDbEventL( TNSmlDMDbEvent aEvent ); |
|
64 |
|
65 void DisableDbNotifications( TBool aEvent ); |
|
66 |
|
67 private: |
|
68 void GetProfiles( ); |
|
69 void OpenSyncSession(); |
|
70 TInt DefaultFotaProfileIdL() const; |
|
71 void SetDefaultFotaProfileIdL( const TInt aProfileId ); |
|
72 |
|
73 public slots: |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 private: |
|
80 //Profile list array |
|
81 CArrayFixFlat<TNSmlDMProfileItem>* iProfileList; |
|
82 // Profile list |
|
83 CNSmlDMSyncProfileList* iSyncProfileList; |
|
84 //Application engine |
|
85 CNSmlDMSyncAppEngine* iAppEngine; |
|
86 // DB notifier |
|
87 CNSmlDMDbNotifier* iDbNotifier; |
|
88 TInt iProfileId; |
|
89 // Blocks db events |
|
90 TBool iDbEventsBlocked; |
|
91 CNSmlDMSyncProfile* iProfile; |
|
92 |
|
93 QMap<QString,int> iapmap; |
|
94 QStringList sortediaplist; |
|
95 DmAdvancedView* serversView; |
|
96 |
|
97 }; |
|
98 |
|
99 // CLASS DECLARATION |
|
100 |
|
101 |
|
102 /** |
|
103 * TNSmlDMProfileItem helper class |
|
104 */ |
|
105 NONSHARABLE_CLASS (TNSmlDMProfileItem) |
|
106 { |
|
107 public: |
|
108 TBuf<KNSmlMaxProfileNameLength> iProfileName; |
|
109 TInt iProfileId; |
|
110 TBool iSynced; |
|
111 TTime iLastSync; |
|
112 TInt iBearer; |
|
113 TInt iActive; |
|
114 TTime iLastSuccessSync; |
|
115 TBool iDeleteAllowed; |
|
116 TBool iProfileLocked; |
|
117 }; |
|
118 |
|
119 |
|
120 #endif /* DMINFORETRIEVAL_H_ */ |