|
1 /** @file |
|
2 * Copyright (c) 2005-2006 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: CUpnpHttpServerTransactionHandler declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef UPNPDLNAFILTER_H |
|
19 #define UPNPDLNAFILTER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> |
|
25 #include "upnphttpservertransactioncreator.h" |
|
26 |
|
27 // FORWARD DECLARATION |
|
28 class CUpnpHttpMessage; |
|
29 class CUpnpDeviceImplementationBase; |
|
30 class TInetAddr; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Creates http server transactions and provides methods |
|
36 * for resolving source file by request URL |
|
37 * Served files are: device and service description xml's and icons. |
|
38 * |
|
39 */ |
|
40 NONSHARABLE_CLASS( CUpnpHttpServerTransactionHandler ) : public CBase, |
|
41 public MUpnpHttpServerTransactionCreator |
|
42 { |
|
43 public: |
|
44 // Public Constructors and destructor |
|
45 |
|
46 enum TDescriptionType |
|
47 { |
|
48 EDevice, |
|
49 EService, |
|
50 EIcon, |
|
51 ENotFound |
|
52 }; |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 ~CUpnpHttpServerTransactionHandler(); |
|
58 |
|
59 /** |
|
60 * Two-phased constructor. |
|
61 */ |
|
62 static CUpnpHttpServerTransactionHandler* NewL( CUpnpDeviceImplementationBase& aDevice ); |
|
63 |
|
64 /** |
|
65 * Two-phased constructor. |
|
66 */ |
|
67 static CUpnpHttpServerTransactionHandler* NewLC( CUpnpDeviceImplementationBase& aDevice ); |
|
68 |
|
69 /** |
|
70 * Checks correctness of path to, requested in HTTP message, file and |
|
71 * changes its format to be compliant with Symbian's file system. |
|
72 * @since Series60 2.6 |
|
73 * @param aMsg HTTP message containing file request. |
|
74 * @param aPathWithNewMethod reference which is filled with formated path |
|
75 * to requested file. |
|
76 **/ |
|
77 void FormatPathL( const TDesC8& aUri, TDes& aPathWithNewMethod ); |
|
78 |
|
79 /** |
|
80 * Opens file depending on specified uri and IP address |
|
81 * |
|
82 * @since Series60 MCL |
|
83 * @param aFile File to open |
|
84 * @param aUri request uri |
|
85 * @param aInetAdress requestor IP address |
|
86 * @return error code |
|
87 */ |
|
88 TInt GetFileL( RFile& aFile, |
|
89 const TDesC8& aUri, const TInetAddr& aInetAdress ); |
|
90 |
|
91 private: // from MUpnpHttpServerTransactionCreator |
|
92 |
|
93 virtual void NewTransactionL( const TDesC8& aMethod, const TDesC8& aUri, |
|
94 const TInetAddr& aSender, CUpnpHttpServerTransaction*& aResultTrans ); |
|
95 |
|
96 |
|
97 private: |
|
98 |
|
99 /** |
|
100 * Constructor for performing 1st stage construction |
|
101 */ |
|
102 CUpnpHttpServerTransactionHandler( CUpnpDeviceImplementationBase& aDevice ); |
|
103 |
|
104 /** |
|
105 * EPOC default constructor for performing 2nd stage construction |
|
106 */ |
|
107 void ConstructL(); |
|
108 |
|
109 |
|
110 TDescriptionType MatchType( const TDesC8& aUri ); |
|
111 |
|
112 private: |
|
113 CUpnpDeviceImplementationBase& iDevice; |
|
114 |
|
115 }; |
|
116 |
|
117 #endif // UPNPDLNAFILTER_H |
|
118 // End Of File |