|
1 /* |
|
2 * Copyright (c) 2002 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: DM ScreenSaver List |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __ScreenSaverList_H__ |
|
21 #define __ScreenSaverList_H__ |
|
22 |
|
23 // ------------------------------------------------------------------------------------------------ |
|
24 // Includes |
|
25 // ------------------------------------------------------------------------------------------------ |
|
26 #include <e32base.h> |
|
27 #include <smldmadapter.h> |
|
28 #include <SWInstApi.h> |
|
29 |
|
30 // Constants |
|
31 const TInt KPkgId_ScrId_Separator = ':'; |
|
32 const TInt KDisableScreensaver = 1; |
|
33 const TInt KEnableScreensaver = 0; |
|
34 |
|
35 |
|
36 // ------------------------------------------------------------------------------------------------ |
|
37 // CScreenSaverInfo |
|
38 // ------------------------------------------------------------------------------------------------ |
|
39 class CScreenSaverInfo : public CBase |
|
40 { |
|
41 public: |
|
42 static CScreenSaverInfo* NewL( const TDesC& aId ); |
|
43 static CScreenSaverInfo* NewLC( const TDesC& aId ); |
|
44 |
|
45 virtual ~CScreenSaverInfo(); |
|
46 |
|
47 // Other |
|
48 const TDesC8& Id(); |
|
49 |
|
50 const TDesC8& Name(); |
|
51 void SetNameL( const TDesC8& aName ); |
|
52 void SetNameL( const TDesC& aName ); |
|
53 |
|
54 const TDesC8& Description(); |
|
55 void SetDescriptionL( const TDesC8& aDescription ); |
|
56 |
|
57 const TDesC8& CustomProperty(); |
|
58 void SetCustomPropertyL( const TDesC8& aCustomProperty ); |
|
59 |
|
60 const TDesC8& Version(); |
|
61 void SetVersionL( const TDesC8& aVersion ); |
|
62 |
|
63 void ActivateL(); |
|
64 |
|
65 enum TScreenSaverType |
|
66 { |
|
67 EText = 0, |
|
68 EDateTime = 1, |
|
69 EObject = 3 |
|
70 }; |
|
71 |
|
72 TScreenSaverType TypeId(); |
|
73 TBool IsActivatedL(); |
|
74 const TDesC8& FileName(); |
|
75 |
|
76 |
|
77 protected: |
|
78 |
|
79 private: |
|
80 CScreenSaverInfo( ); |
|
81 void ConstructL( const TDesC& aId ); |
|
82 |
|
83 private: |
|
84 HBufC8* iId; |
|
85 HBufC8* iName; |
|
86 HBufC8* iDescription; |
|
87 HBufC8* iCustomProperty; |
|
88 HBufC8* iVersion; |
|
89 }; |
|
90 |
|
91 // ------------------------------------------------------------------------------------------------ |
|
92 // CScreenSaverList |
|
93 // ------------------------------------------------------------------------------------------------ |
|
94 class CScreenSaverList : public CBase |
|
95 { |
|
96 public: |
|
97 static CScreenSaverList* NewL( ); |
|
98 static CScreenSaverList* NewLC( ); |
|
99 |
|
100 virtual ~CScreenSaverList(); |
|
101 |
|
102 MSmlDmAdapter::TError GetScreenSaverListL( const CArrayFix<TSmlDmMappingInfo>& aPreviousList, CBufBase& aList ); |
|
103 |
|
104 MSmlDmAdapter::TError GetIdL( const TDesC8& aId, CBufBase& aResult ); |
|
105 |
|
106 MSmlDmAdapter::TError GetNameL( const TDesC8& aId, CBufBase& aResult ); |
|
107 MSmlDmAdapter::TError SetNameL( const TDesC8& aId, const TDesC8& aData ); |
|
108 |
|
109 MSmlDmAdapter::TError GetDescriptionL( const TDesC8& aId, CBufBase& aResult ); |
|
110 MSmlDmAdapter::TError SetDescriptionL( const TDesC8& aId, const TDesC8& aData ); |
|
111 |
|
112 MSmlDmAdapter::TError GetCustomPropertyL( const TDesC8& aId, CBufBase& aResult ); |
|
113 MSmlDmAdapter::TError SetCustomPropertyL( const TDesC8& aId, const TDesC8& aData ); |
|
114 |
|
115 MSmlDmAdapter::TError GetVersionL( const TDesC8& aId, CBufBase& aResult ); |
|
116 MSmlDmAdapter::TError SetVersionL( const TDesC8& aId, const TDesC8& aVersion ); |
|
117 |
|
118 MSmlDmAdapter::TError GetActiveL( CBufBase& aResult ); |
|
119 MSmlDmAdapter::TError SetActiveL( const TDesC8& aId ); |
|
120 |
|
121 MSmlDmAdapter::TError SetInstallOptionsL( const TDesC8& aOptions ); |
|
122 MSmlDmAdapter::TError InstallL( const TDesC& aFileName ); |
|
123 |
|
124 MSmlDmAdapter::TError DeleteL( const TDesC8& aLUID ); |
|
125 |
|
126 private: |
|
127 CScreenSaverList( ); |
|
128 void ConstructL( ); |
|
129 |
|
130 void CheckUpdatesL(); |
|
131 void LoadL(); |
|
132 TBool LoadPluginsL( const TDesC& aPath ); |
|
133 |
|
134 CScreenSaverInfo* FindByIdL( const TDesC8& aId ); |
|
135 TPtrC8 ScreenSaverIdFromLUID( const TDesC8& aLUID ); |
|
136 void GetDefaultInstallOptions( SwiUI::TInstallOptions& aOptions ); |
|
137 |
|
138 private: |
|
139 TBool iDirty; |
|
140 CArrayPtr< CScreenSaverInfo >* iScreenSavers; |
|
141 SwiUI::TInstallOptions iInstallOptions; |
|
142 }; |
|
143 |
|
144 |
|
145 #endif // __ScreenSaverList_H__ |