|
1 /* |
|
2 * Copyright (c) 2010 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 the License "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 * Declares entry classes for Software Components Registry interface. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedPartner |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef SCRENTRIES_PARTNER_H |
|
27 #define SCRENTRIES_PARTNER_H |
|
28 |
|
29 #include <e32base.h> |
|
30 #include <s32strm.h> |
|
31 #include <f32file.h> |
|
32 #include <usif/usifcommon.h> |
|
33 #include <usif/scr/screntries.h> |
|
34 #include <ct/rcpointerarray.h> |
|
35 |
|
36 namespace Usif |
|
37 { |
|
38 class CLocalizedSoftwareTypeName; |
|
39 |
|
40 enum TAccessMode |
|
41 { |
|
42 ETransactionalSid = 0x0001, // Sids requiring component/application transactional support, usually Installers/Execution layers |
|
43 EMaxAccessMode = 0xFFFF |
|
44 }; |
|
45 |
|
46 NONSHARABLE_CLASS (TCustomAccessInfo) |
|
47 { |
|
48 public: |
|
49 IMPORT_C TSecureId SecureId() const; |
|
50 IMPORT_C TAccessMode AccessMode() const; |
|
51 IMPORT_C TCustomAccessInfo(TSecureId aSecureId, TAccessMode aAccessMode); |
|
52 |
|
53 private: |
|
54 TAccessMode iAccessMode; |
|
55 TSecureId iSecureId; |
|
56 }; |
|
57 |
|
58 NONSHARABLE_CLASS (CSoftwareTypeRegInfo) : public CBase |
|
59 { |
|
60 public: |
|
61 IMPORT_C static CSoftwareTypeRegInfo* NewL(const TDesC& aUniqueSoftwareTypeName); |
|
62 IMPORT_C static CSoftwareTypeRegInfo* NewL(RReadStream& aStream); |
|
63 |
|
64 IMPORT_C virtual ~CSoftwareTypeRegInfo(); |
|
65 |
|
66 IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
|
67 |
|
68 inline void SetSifPluginUid(TUid aUid); |
|
69 inline void SetCustomAccessL(TCustomAccessInfo aCustomAccessListInfo); |
|
70 inline void SetCustomAccessL(TSecureId aSecureId, TAccessMode aAccessMode); |
|
71 IMPORT_C void SetMimeTypeL(const TDesC& aMimeType); |
|
72 IMPORT_C void SetLocalizedSoftwareTypeNameL(TLanguage aLanguage, const TDesC& aName); |
|
73 IMPORT_C void SetLauncherExecutableL(const TDesC& aLauncherExecutable); |
|
74 |
|
75 inline const TDesC& UniqueSoftwareTypeName() const; |
|
76 inline TUid SifPluginUid() const; |
|
77 inline RArray<TCustomAccessInfo> CustomAccessList() const; |
|
78 |
|
79 inline const RPointerArray<HBufC>& MimeTypes() const; |
|
80 inline const RPointerArray<CLocalizedSoftwareTypeName>& LocalizedSoftwareTypeNames() const; |
|
81 inline const TDesC& LauncherExecutable() const; |
|
82 |
|
83 private: |
|
84 CSoftwareTypeRegInfo(); |
|
85 void InternalizeL(RReadStream& aStream); |
|
86 |
|
87 enum { EUniqueSwTypeNameMaxLength = 64, |
|
88 ELauncherExecutableMaxLength = 512}; |
|
89 |
|
90 HBufC* iUniqueSoftwareTypeName; |
|
91 TUid iSifPluginUid; |
|
92 RArray<TCustomAccessInfo> iCustomAccessList; |
|
93 RCPointerArray<HBufC> iMimeTypes; |
|
94 RCPointerArray<CLocalizedSoftwareTypeName> iLocalizedSoftwareTypeNames; |
|
95 HBufC* iLauncherExecutable; |
|
96 }; |
|
97 |
|
98 inline void CSoftwareTypeRegInfo::SetSifPluginUid(TUid aUid) |
|
99 { |
|
100 iSifPluginUid = aUid; |
|
101 } |
|
102 |
|
103 inline void CSoftwareTypeRegInfo::SetCustomAccessL(TCustomAccessInfo aCustomAccessList) |
|
104 { |
|
105 iCustomAccessList.AppendL(aCustomAccessList); |
|
106 } |
|
107 |
|
108 inline void CSoftwareTypeRegInfo::SetCustomAccessL(TSecureId aSecureId, TAccessMode aAccessMode) |
|
109 { |
|
110 iCustomAccessList.AppendL(TCustomAccessInfo(aSecureId, aAccessMode)); |
|
111 } |
|
112 |
|
113 inline const TDesC& CSoftwareTypeRegInfo::UniqueSoftwareTypeName() const |
|
114 { |
|
115 if (iUniqueSoftwareTypeName == NULL) |
|
116 { |
|
117 return KNullDesC; |
|
118 } |
|
119 return *iUniqueSoftwareTypeName; |
|
120 } |
|
121 |
|
122 inline TUid CSoftwareTypeRegInfo::SifPluginUid() const |
|
123 { |
|
124 return iSifPluginUid; |
|
125 } |
|
126 |
|
127 inline RArray<TCustomAccessInfo> CSoftwareTypeRegInfo::CustomAccessList() const |
|
128 { |
|
129 return iCustomAccessList; |
|
130 } |
|
131 |
|
132 const RPointerArray<HBufC>& CSoftwareTypeRegInfo::MimeTypes() const |
|
133 { |
|
134 return iMimeTypes; |
|
135 } |
|
136 |
|
137 inline const RPointerArray<CLocalizedSoftwareTypeName>& CSoftwareTypeRegInfo::LocalizedSoftwareTypeNames() const |
|
138 { |
|
139 return iLocalizedSoftwareTypeNames; |
|
140 } |
|
141 |
|
142 inline const TDesC& CSoftwareTypeRegInfo::LauncherExecutable() const |
|
143 { |
|
144 if (iLauncherExecutable == NULL) |
|
145 { |
|
146 return KNullDesC; |
|
147 } |
|
148 return *iLauncherExecutable; |
|
149 } |
|
150 |
|
151 } // End of namespace Usif |
|
152 |
|
153 #endif // SCRENTRIES_H |