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 "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: CUpnpTmServerDeviceXmlParser class declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __UPNPTMSERVERDEVICEXMLPARSER_H__ |
|
19 #define __UPNPTMSERVERDEVICEXMLPARSER_H__ |
|
20 |
|
21 // System Includes |
|
22 #include <xml/parser.h> |
|
23 #include <xml/contenthandler.h> |
|
24 #include <f32file.h> |
|
25 #include <etelmm.h> |
|
26 #include <ctsy/mmtsy_names.h> |
|
27 #include <upnpcons.h> |
|
28 |
|
29 // User Include |
|
30 #include "upnptmserverdeviceinfo.h" |
|
31 |
|
32 // Constants |
|
33 const TUint KBufSize = 20480; |
|
34 const TUint KMaxBufLength = 255; |
|
35 const TUint KDirectorySeparator = '\\'; |
|
36 |
|
37 using namespace Xml; |
|
38 |
|
39 /** |
|
40 * This class takes the root device content as xml formatted buffer which serves as placeholders |
|
41 * for many element values as an input and then constructs the complete device description |
|
42 * xml file and service xml files which are published over the network |
|
43 */ |
|
44 class CUpnpTmServerDeviceXmlParser: public CBase, |
|
45 public MContentHandler |
|
46 { |
|
47 public: |
|
48 static CUpnpTmServerDeviceXmlParser* NewL( CUpnpTmServerDeviceInfo& aDeviceInfo ); |
|
49 ~CUpnpTmServerDeviceXmlParser(); |
|
50 void StartL(); |
|
51 inline const TDesC& DevicePath(); |
|
52 inline const TDesC& AppServerSrvPath(); |
|
53 inline const TDesC& ClientProfileSrvPath(); |
|
54 inline const TDesC8& DescriptionUri(); |
|
55 |
|
56 private: |
|
57 CUpnpTmServerDeviceXmlParser( CUpnpTmServerDeviceInfo& aDeviceInfo ); |
|
58 void ConstructL( ); |
|
59 void DeleteDirectory(); |
|
60 |
|
61 private: // From MContentHandler |
|
62 void OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode); |
|
63 void OnEndDocumentL(TInt aErrorCode); |
|
64 void OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode); |
|
65 void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode); |
|
66 void OnContentL(const TDesC8& aBytes, TInt aErrorCode); |
|
67 void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode); |
|
68 void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode); |
|
69 void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode); |
|
70 void OnSkippedEntityL(const RString& aName, TInt aErrorCode); |
|
71 void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode); |
|
72 inline void OnError(TInt aErrorCode); |
|
73 inline TAny* GetExtendedInterface(const TInt32 aUid); |
|
74 |
|
75 private: |
|
76 RBuf8 iAppServerSrvDescription; |
|
77 RBuf8 iClientProfSrvDescription; |
|
78 RBuf8 iReadBuf; |
|
79 RBuf8 iDeviceDescription; |
|
80 CParser* iParser; |
|
81 RBuf iDescFilePath; |
|
82 RBuf iAppServerSrvFilePath; |
|
83 RBuf iClientProfSrvFilePath; |
|
84 RBuf8 iDescriptionUri; |
|
85 RFs iFs; |
|
86 RBuf iDeviceDir; |
|
87 RBuf iIconDirectory; |
|
88 RMobilePhone iPhone; |
|
89 RTelServer iEtelSrv; |
|
90 RMobilePhone::TMobilePhoneIdentityV1 iPhoneId; |
|
91 CUpnpTmServerDeviceInfo& iDeviceInfo; |
|
92 CFileMan* iFileMan; |
|
93 }; |
|
94 |
|
95 #include "upnptmserverdevicexmlparser.inl" |
|
96 |
|
97 #endif //__UPNPTMSERVERDEVICEXMLPARSER_H__ |
|