|
1 /* |
|
2 * Copyright (c) 2002-2007 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: Declares CUPPrinter class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CUPPRINTER_H |
|
20 #define CUPPRINTER_H |
|
21 |
|
22 #include <upnpservice.h> |
|
23 #include <upnpdevice.h> |
|
24 |
|
25 #include "upconsts.h" |
|
26 #include "tprinter.h" |
|
27 #include "imageprint.h" |
|
28 |
|
29 /* |
|
30 * @class CUPPrinter |
|
31 * @description This class maps the printers between protocol client and |
|
32 * UPnP printer control point. |
|
33 */ |
|
34 |
|
35 NONSHARABLE_CLASS(CUPPrinter) : public CBase |
|
36 { |
|
37 public: |
|
38 /* |
|
39 * @function NewL |
|
40 * @description Constructs the CUPPrinter object |
|
41 * @param CDevice* |
|
42 * @param TInt Mapping id |
|
43 */ |
|
44 static CUPPrinter* NewL(CUpnpDevice& aDevice, const TInt aId); |
|
45 |
|
46 /* |
|
47 * @function NewL |
|
48 * @description Constructs the CUAPrinter object |
|
49 * @param TInt Mapping id |
|
50 * @param TDesC& UPnP UId |
|
51 * @param TDesC& Display name of printer |
|
52 */ |
|
53 static CUPPrinter* NewL(const TInt aId, const TDesC8& aUId, const TDesC8& aDisplayName, const TInt aVendor); |
|
54 |
|
55 |
|
56 /* |
|
57 * @function Destructor |
|
58 * @description Destructor |
|
59 */ |
|
60 ~CUPPrinter(); |
|
61 |
|
62 |
|
63 /* |
|
64 * @function Device |
|
65 * @description Returns a pointer to CDevice |
|
66 * @return CDevice* |
|
67 */ |
|
68 CUpnpDevice* Device(); |
|
69 |
|
70 /* |
|
71 * @function ToTPrinter |
|
72 * @description Returns the object as TPrinter |
|
73 * @return TPrinter |
|
74 */ |
|
75 TPrinter ToTPrinter(); |
|
76 |
|
77 /* |
|
78 * @function Id |
|
79 * @description Returns the id of the device. |
|
80 * NOTE: This id maps the printer requests from protocol client |
|
81 * to a correct UPnP printer control point's printer |
|
82 */ |
|
83 TInt Id(); |
|
84 |
|
85 /* |
|
86 * @function GetUId |
|
87 * @description Returns the UPnP uid of the device. |
|
88 */ |
|
89 void GetUId(TDesC& aUId); |
|
90 |
|
91 /* |
|
92 * @function IsDisappeared |
|
93 * @description Returns ETrue if the printer is reported to be disappeared |
|
94 * @return TBool |
|
95 */ |
|
96 TBool IsDisappeared(); |
|
97 |
|
98 /* |
|
99 * @function SetDisappeared |
|
100 * @description Sets the iDisappeared value as ETrue. Called when the printer is reported to be disappeared. |
|
101 * @param TBool |
|
102 */ |
|
103 void SetDisappeared(TBool aDisappeared = ETrue); |
|
104 /* |
|
105 * @function UId |
|
106 * @description Returns the printers UPnP UId |
|
107 * @return TPtrC |
|
108 */ |
|
109 TPtrC8 UId(); |
|
110 |
|
111 /* |
|
112 * @function DisplayName |
|
113 * @description Returns the printers display name |
|
114 * @return TPtrC |
|
115 */ |
|
116 TPtrC8 DisplayName(); |
|
117 |
|
118 /* |
|
119 * @function SetDevice |
|
120 * @description Sets the CDevice pointer. NOTE: The actual object is never owned by this class! |
|
121 * @return CDevice* |
|
122 */ |
|
123 void SetDevice(CUpnpDevice* aDevice); |
|
124 |
|
125 /* |
|
126 * @function SetCached |
|
127 * @description Sets a flag if printer is cached in cache file or not |
|
128 * @param TBool |
|
129 */ |
|
130 void SetCached(TBool aCached); |
|
131 |
|
132 /* |
|
133 * @function Cached |
|
134 * @description Returns a flag if printer is cached in cache file or not |
|
135 * @return TBool |
|
136 */ |
|
137 TBool Cached(); |
|
138 |
|
139 /* |
|
140 * @function Vendor |
|
141 * @description Returns an enum value TPrinterVendor |
|
142 * @return TPrinterVendor |
|
143 */ |
|
144 TPrinter::TPrinterVendor Vendor(); |
|
145 |
|
146 /* |
|
147 * @function SetVendor |
|
148 * @description Returns an enum value TPrinterVendor |
|
149 * @return TPrinterVendor |
|
150 */ |
|
151 void SetVendor(const TDesC8& aManufacturer); |
|
152 |
|
153 protected: |
|
154 |
|
155 |
|
156 private: |
|
157 /* |
|
158 * @function Constructor |
|
159 * @description C++ constructor |
|
160 */ |
|
161 CUPPrinter(); |
|
162 |
|
163 /* |
|
164 * @function ConstructL |
|
165 * @description Construction's second phase |
|
166 * @param CDevice* Pointer to UPnP device |
|
167 * @param TInt Mapping id |
|
168 * @param TDesC8& UPnP UId |
|
169 * @param TDesC8& Display name of printer |
|
170 */ |
|
171 void ConstructL(CUpnpDevice* aDevice, const TInt aId, const TDesC8& aUId, const TDesC8& aDisplayName, const TInt aVendor); |
|
172 |
|
173 private: |
|
174 |
|
175 // @var iDevice Pointer to UPnP device object |
|
176 CUpnpDevice* iDevice; |
|
177 |
|
178 // @var iId Printer id for client apps |
|
179 TInt iId; |
|
180 |
|
181 // @var iUId Printer UPnP UId |
|
182 HBufC8* iUId; |
|
183 |
|
184 // @var iDisplayName Printer's display name (UPnP Friendly name) |
|
185 HBufC8* iDisplayName; |
|
186 |
|
187 // @var iDisappeared ETrue, when a disappearing notification is received for this printer |
|
188 TBool iDisappeared; |
|
189 |
|
190 // @var iCached ETrue, if printer is cached in cache file. |
|
191 TBool iCached; |
|
192 |
|
193 // @var iVendor TPrinter::TPrinterVendor value for defining vendor |
|
194 TPrinter::TPrinterVendor iVendor; |
|
195 |
|
196 }; |
|
197 |
|
198 #endif // CUPPRINTER_H |
|
199 |
|
200 // End of File |