1 /* |
|
2 * Copyright (c) 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: This plugin enables the Catalogs PC client to communicate |
|
15 * with the Catalogs engine |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef C_CATALOGSPCCONNECTIVITYPLUGIN_H |
|
21 #define C_CATALOGSPCCONNECTIVITYPLUGIN_H |
|
22 |
|
23 #include "catalogspcconnectivityclient.h" |
|
24 |
|
25 /** |
|
26 * Plugin enables Catalogs PC client to communicate with the Catalogs engine |
|
27 * |
|
28 * This class get requests from Catalogs PC client. It passes the requests |
|
29 * to client CatalogsPCConnectivityClient |
|
30 * |
|
31 * @lib catalogspcconnectivityplugin |
|
32 * @since S60 v3.1 |
|
33 */ |
|
34 class CCatalogsPCConnectivityPlugin : public CBase |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Standard symbian object construction first phase |
|
40 * |
|
41 * @since S60 v3.1 |
|
42 * @return CCatalogsPCConnectivityPlugin pointer |
|
43 */ |
|
44 IMPORT_C static CCatalogsPCConnectivityPlugin* NewL(); |
|
45 |
|
46 /** |
|
47 * Standard symbian object constructing first phase |
|
48 * |
|
49 * @since S60 v3.1 |
|
50 * @return CCatalogsPCConnectivityPlugin pointer |
|
51 */ |
|
52 IMPORT_C static CCatalogsPCConnectivityPlugin* NewLC(); |
|
53 |
|
54 /** |
|
55 * Destructor |
|
56 * |
|
57 * @since S60 v3.1 |
|
58 */ |
|
59 IMPORT_C virtual ~CCatalogsPCConnectivityPlugin(); |
|
60 |
|
61 /** |
|
62 * A connection is formed to the Catalogs engine pc client front-end. |
|
63 * This will start up the front-end server and connect to it |
|
64 * |
|
65 * @return TInt Standard error code, KErrNone if connection is formed |
|
66 * @since S60 v3.1 |
|
67 */ |
|
68 IMPORT_C TInt Connect(); |
|
69 |
|
70 /** |
|
71 * The connection to the Catalogs engine front-end is closed |
|
72 * |
|
73 * @since S60 v3.1 |
|
74 */ |
|
75 IMPORT_C void Close(); |
|
76 |
|
77 /** |
|
78 * All MIME types supported by this component can be asked using this method |
|
79 * |
|
80 * @return RPointerArray<TDataType> contains all supported MIME types. |
|
81 * The ownership is transferred to the caller. |
|
82 * Use ResetAndDestroy method to free all allocated memory |
|
83 * @exeption Leaves with standard error codes |
|
84 * @since S60 v3.1 |
|
85 */ |
|
86 IMPORT_C RPointerArray<TDataType> SupportedMimeTypesL(); |
|
87 |
|
88 /** |
|
89 * A Data packet of max length 65535 (0xFFFF) bytes is synchronously |
|
90 * sent to the Catalogs engine front-end. |
|
91 * Usage: After PutDataL has been called, you must call GetDataL |
|
92 * before you can call PutDataL again |
|
93 * |
|
94 * @param aMimeType Data packet MIME type |
|
95 * @param aData Data buffer to read from |
|
96 * @exeption Leaves with standard error codes |
|
97 * KErrNotSupported if not supported MIME type |
|
98 * @since S60 v3.1 |
|
99 */ |
|
100 IMPORT_C void PutDataL( const TDataType& aMimeType, |
|
101 const CBufFlat& aData ); |
|
102 |
|
103 /** |
|
104 * A data packet is synchronously transfered from the Catalogs front-end |
|
105 * and returned to caller |
|
106 * Usage: Everytime before calling GetDataL, you have to call PutDataL. |
|
107 * You may not call GetData in sequentially. |
|
108 * |
|
109 * @since S60 v3.1 |
|
110 * @param aMimeType MIME type of the received data packet |
|
111 * @param aData Data buffer to write to. ExpandL function will be called |
|
112 * with the correct size for aData, but not more than max length |
|
113 * 65535 (OxFFFF) |
|
114 * @return The reference parameters contain the return data |
|
115 * @exeption Leaves with standard error codes |
|
116 */ |
|
117 IMPORT_C void GetDataL( TDataType& aMimeType, CBufFlat& aData ); |
|
118 |
|
119 |
|
120 private: |
|
121 |
|
122 // private functions |
|
123 |
|
124 |
|
125 /** |
|
126 * Constructor |
|
127 * |
|
128 * @since S60 v3.1 |
|
129 */ |
|
130 CCatalogsPCConnectivityPlugin(); |
|
131 |
|
132 /** |
|
133 * Standard symbian object construction second phase |
|
134 */ |
|
135 void ConstructL(); |
|
136 |
|
137 |
|
138 private: // data |
|
139 |
|
140 /** |
|
141 * Client that communicate with the CatalogsEnginePCClientFrontEnd |
|
142 */ |
|
143 RCatalogsPCConnectivityClient iClient; |
|
144 |
|
145 }; |
|
146 |
|
147 #endif // C_CATALOGSPCCONNECTIVITYPLUGIN_H |
|