|
1 // Copyright (c) 2006-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 @internalComponent |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef CMTPSERVICEMGR_H_ |
|
23 #define CMTPSERVICEMGR_H_ |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <e32cmn.h> |
|
27 |
|
28 |
|
29 #include "cmtpserviceinfo.h" |
|
30 #include "rmtpframework.h" |
|
31 #include "mtpdebug.h" |
|
32 |
|
33 class CMTPServiceConfig; |
|
34 |
|
35 /** |
|
36 Implements the MTP service manager interface. |
|
37 @internalComponent |
|
38 |
|
39 */ |
|
40 |
|
41 class CMTPServiceMgr : public CBase |
|
42 { |
|
43 public: |
|
44 |
|
45 static CMTPServiceMgr* NewL(); |
|
46 ~CMTPServiceMgr(); |
|
47 |
|
48 private: |
|
49 |
|
50 CMTPServiceMgr(); |
|
51 void ConstructL(); |
|
52 |
|
53 public: |
|
54 TInt GetServiceId(const TMTPTypeGuid& aServiceGUID, TUint& aServiceID) const; |
|
55 IMPORT_C const RArray<TUint>& GetServiceIDs() const; |
|
56 |
|
57 TInt InsertServiceId(const TUint aServiceId); |
|
58 |
|
59 TInt GetServicePropertyCode( const TMTPTypeGuid& aServicePGUID, const TMTPTypeGuid& aPKNamespace, const TUint aPKID, TUint& aServicePropertyCode ) const; |
|
60 TInt SetServicePropertyCode( const TMTPTypeGuid& aServicePGUID, const TMTPTypeGuid& aPKNamespace, const TUint aPKID, const TUint aCurrPropertyCode ); |
|
61 |
|
62 TInt GetServiceFormatCode( const TMTPTypeGuid& aServicePGUID, const TMTPTypeGuid& aGUID, TUint& aServiceFormatCode ) const; |
|
63 TInt SetServiceFormatCode( const TMTPTypeGuid& aServicePGUID, const TMTPTypeGuid& aGUID, const TUint aCurrFormatCode ); |
|
64 |
|
65 TInt GetServiceMethodCode( const TMTPTypeGuid& aServicePGUID, const TMTPTypeGuid& aGUID, TUint& aServiceFormatCode ) const; |
|
66 TInt SetServiceMethodCode( const TMTPTypeGuid& aServicePGUID, const TMTPTypeGuid& aGUID, const TUint aCurrMethodCode ); |
|
67 |
|
68 IMPORT_C TBool IsSupportedService( const TMTPTypeGuid& aPGUID ) const; |
|
69 IMPORT_C TBool IsSupportedService( const TUint aServiceID ) const; |
|
70 |
|
71 TInt EnableService(const TMTPTypeGuid& aPGUID, const TUint aServiceID ); |
|
72 TInt ServiceTypeOfSupportedService( const TMTPTypeGuid& aPGUID ) const; |
|
73 |
|
74 |
|
75 IMPORT_C CMTPServiceInfo* ServiceInfo(const TMTPTypeGuid& aServiceGUID ) const; |
|
76 IMPORT_C CMTPServiceInfo* ServiceInfo(const TUint aServiceID) const; |
|
77 IMPORT_C TBool IsServiceFormatCode(const TUint32 aDatacode ) const; |
|
78 |
|
79 private: |
|
80 void LoadServiceL(const TMTPTypeGuid& aPGUID); |
|
81 TInt GetServiceProperty( const TMTPTypeGuid& aServicePGUID, const TMTPTypeGuid& aPKNamespace, const TUint aPKID, CServiceProperty** aServicePropertye) const; |
|
82 TInt GetServiceFormat( const TMTPTypeGuid& aServicePGUID, const TMTPTypeGuid& aGUID, CServiceFormat** aServiceFormat ) const; |
|
83 TInt GetServiceMethod( const TMTPTypeGuid& aServicePGUID, const TMTPTypeGuid& aGUID, CServiceMethod** aServiceMethod ) const; |
|
84 private: |
|
85 |
|
86 /** |
|
87 The framework singletons. |
|
88 */ |
|
89 RMTPFramework iSingletons; |
|
90 |
|
91 /* |
|
92 * Service IDs store |
|
93 */ |
|
94 RArray<TUint> iServiceIDs; |
|
95 |
|
96 /** |
|
97 * Service Config |
|
98 */ |
|
99 CMTPServiceConfig* iServiceCfg; |
|
100 |
|
101 /** |
|
102 FLOGGER debug trace member variable. |
|
103 */ |
|
104 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
105 |
|
106 }; |
|
107 |
|
108 #endif /*CMTPSERVICEMGR_H_*/ |