ImagePrint/ImagePrintEngine/DeviceProtocols/upnpprotocolfw2/inc/upconsts.h
branchRCL_3
changeset 28 d59c248c9d36
parent 0 d11fb78c4374
equal deleted inserted replaced
27:159fc2f68139 28:d59c248c9d36
       
     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:  Common constants for UPnP printing
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef UPCONSTS_H
       
    20 #define UPCONSTS_H
       
    21 
       
    22 #include <e32def.h>
       
    23 #include <e32std.h>
       
    24 
       
    25 #include "printmessagecodes.h"
       
    26 
       
    27 // Debugging
       
    28 #define _DEBUG_OUT
       
    29 
       
    30 #define KUPnPIdBase 402216
       
    31 typedef TBuf8<KMaxFileName> TFileName8;
       
    32 
       
    33 // UPnP setting names
       
    34 _LIT8(KUPnPPrintQuality, 	"PrintQuality");
       
    35 _LIT8(KUPnPNumberUp, 		"NumberUp");
       
    36 _LIT8(KUPnPMediaSize, 		"MediaSize");
       
    37 
       
    38 // UPnP values
       
    39 _LIT8(KUPnPDeviceSetting, 	"device-setting");
       
    40 _LIT8(KUPnPOne, 			"1");
       
    41 #define KUPnPDeviceSettingStrLength 15
       
    42 
       
    43 // Actions
       
    44 _LIT8( KCancelJob,				"CancelJob" );
       
    45 _LIT8( KCreateJob,				"CreateJob" );
       
    46 _LIT8( KCreateJobV2,			"CreateJobV2" );
       
    47 _LIT8( KCreateURIJob,			"CreateURIJob" );
       
    48 _LIT8( KGetJobAttr, 			"GetJobAttributes" );
       
    49 _LIT8( KGetMargins,		 		"GetMargins" );
       
    50 _LIT8( KGetMediaList,		 	"GetMediaList" );
       
    51 _LIT8( KGetPrinterAttr, 		"GetPrinterAttributes" );
       
    52 _LIT8( KGetPrinterAttrV2, 		"GetPrinterAttributesV2" );
       
    53 
       
    54 // Arguments
       
    55 _LIT8( KJobId,					"JobId" );
       
    56 _LIT8( KJobIdList,				"JobIdList" );
       
    57 _LIT8( KJobName,				"JobName" );
       
    58 _LIT8( KUserName,				"JobOriginatingUserName" );
       
    59 _LIT8( KCopies,					"Copies" );
       
    60 _LIT8( KSides,					"Sides" );
       
    61 _LIT8( KNumberUp,				"NumberUp" );
       
    62 _LIT8( KOrientationRequest,		"OrientationRequested" );
       
    63 _LIT8( KSize,					"MediaSize" );
       
    64 _LIT8( KType,					"MediaType" );
       
    65 _LIT8( KQuality,				"PrintQuality" );
       
    66 _LIT8( KDataSink,				"DataSink");
       
    67 _LIT8( KCriticalAttributes,		"CriticalAttributesList" );
       
    68 //_LIT8( KCriticalAttributes,		"A_ARG_TYPE_CriticalAttribList" );
       
    69 _LIT8( KDocFormat,				"DocumentFormat" );
       
    70 _LIT8( KSourceURI,				"SourceURI" );
       
    71 _LIT8( KSheetsCompleted, 		"JobMediaSheetsCompleted" );
       
    72 _LIT8( KPrinterState,			"PrinterState" );
       
    73 _LIT8( KPrinterStateReasons,	"PrinterStateReasons" );
       
    74 _LIT8( KInternetConnectState,	"InternetConnectState" );
       
    75 _LIT8( KJobAbortState,			"JobAbortState" );
       
    76 _LIT8( KJobEndState,			"JobEndState" );
       
    77 _LIT8( KContentCompleteList,	"ContentCompleteList" );
       
    78 
       
    79 _LIT8( KPrintBasic,				"PrintBasic:1" );
       
    80 _LIT8( KPrintEnhanced,			"PrintEnhanced:1" );
       
    81 _LIT8( KJobIdErr, 				"-1");
       
    82 
       
    83 // Job state
       
    84 _LIT8(KUPnPJobStateSuccessful, 	"successful");
       
    85 _LIT8(KUPnPJobStateAborted, 	"aborted");
       
    86 _LIT8(KUPnPJobStateCanceled,	"canceled");
       
    87 
       
    88 // Printer states
       
    89 _LIT8(KUPnPPrinterStateIdle, 		"idle");
       
    90 _LIT8(KUPnPPrinterStateProcessing,	"processing" );
       
    91 _LIT8(KUPnPPrinterStateStopped,		"stopped");
       
    92 
       
    93 enum TUPnPState
       
    94 {
       
    95 	EJobStateSuccessful = 0,
       
    96 	EJobStateAborted,
       
    97 	EJobStateCanceled,
       
    98 	EPrinterStateIdle,
       
    99 	EPrinterStateProcessing,
       
   100 	EPrinterStateStopped,
       
   101 	EStatePrinting,
       
   102 	EStateReady,
       
   103 	EStatePending,
       
   104 	EStateUnknown
       
   105 };
       
   106 
       
   107 //UPnP PrinterStateReasons
       
   108 _LIT8(KUPnPStateNone, 					"none");
       
   109 _LIT8(KUPnPStateAttentionRequired, 		"attention-required");
       
   110 _LIT8(KUPnPStateMediaJam, 				"media-jam");
       
   111 _LIT8(KUPnPStatePaused, 				"paused");
       
   112 _LIT8(KUPnPStateDoorOpen, 				"door-open");
       
   113 _LIT8(KUPnPStateMediaLow, 				"media-low");
       
   114 _LIT8(KUPnPStateMediaEmpty, 			"media-empty");
       
   115 _LIT8(KUPnPStateOutputAreaAlmostFull,	"output-area-almost-full");
       
   116 _LIT8(KUPnPStateOutputAreaFull, 		"output-area-full");
       
   117 _LIT8(KUPnPStateMarkerSupplyLow, 		"marker-supply-low");
       
   118 _LIT8(KUPnPStateMarkerSupplyEmpty, 		"marker-supply-empty");
       
   119 _LIT8(KUPnPStateMarkerFailure, 			"marker-failure");
       
   120 _LIT8(KUPnPStateMediaChangeRequest, 	"media-change-request");
       
   121 _LIT8(KUPnPStateVendorDefined, 			"vendor-defined");
       
   122 _LIT8(KUPnPJobStateHwError, 			"hardware-error");
       
   123 _LIT8(KUPnPJobStateUriNotFound, 		"external-access-uri-not-found");
       
   124 _LIT8(KUPnPJobStateObjectFailure, 		"external-access-object-failure");
       
   125 _LIT8(KUPnPJobStateFormatError, 		"external-access-doc-format-error");
       
   126 _LIT8(KUPnPJobStateHttpError, 			"external-access-http-error");
       
   127 _LIT8(KUPnPJobStateCopies, 				"copies");
       
   128 _LIT8(KUPnPJobStateSides, 				"sides");
       
   129 _LIT8(KUPnPJobStateNumberUp, 			"number-up");
       
   130 _LIT8(KUPnPJobStateOrientationRequested,"orientation-requested");
       
   131 _LIT8(KUPnPJobStateMediaSize, 			"media-size");
       
   132 _LIT8(KUPnPJobStateMediaType, 			"media-type");
       
   133 _LIT8(KUPnPJobStatePrintQuality, 		"print-quality");
       
   134 _LIT8(KUPnPJobStateTextLayout, 			"text-layout");
       
   135 _LIT8(KUPnPJobStateImageLayout, 		"image-layout");
       
   136 _LIT8(KUPnPJobStateImageOrientation, 	"image-orientation");
       
   137 _LIT8(KUPnPJobStatePdlFidelity, 		"pdl-fidelity");
       
   138 _LIT8(KUPnPJobStateFontFamily, 			"font-family");
       
   139 _LIT8(KUPnPJobStateFontSize, 			"font-size");
       
   140 
       
   141 
       
   142 // Copies
       
   143 #define KMaxCopiesLength 3
       
   144 
       
   145 // Sides
       
   146 _LIT8(KUPnPOneSided,	 		"one-sided");
       
   147 _LIT8(KUPnPTwoSidedLongEdge,	"two-sided-long-edge");
       
   148 _LIT8(KUPnPTwoSidedShortEdge,	"two-sided-short-edge");
       
   149 
       
   150 // Number up
       
   151 _LIT8(KUPnP1Up,	"1");
       
   152 _LIT8(KUPnP2Up,	"2");
       
   153 _LIT8(KUPnP4Up,	"4");
       
   154 
       
   155 // Orientations
       
   156 _LIT8(KUPnPPortrait,		"portrait");
       
   157 _LIT8(KUPnPLandscape,		"landscape");
       
   158 _LIT8(KUPnPReversePortrait,	"reverse-portrait");
       
   159 _LIT8(KUPnPReverseLandscape,"reverse-landscape");
       
   160 
       
   161 #define KUPnP270Deg 270;
       
   162 #define KUPnPZeroDeg 0;
       
   163 #define KUPnP90Deg 90;
       
   164 #define KUPnP180Deg 180;
       
   165 
       
   166 // Media sizes
       
   167 _LIT8(KUPnPNaLetterMediaSize,	"na_letter_8.5x11in");
       
   168 _LIT8(KUPnPNaLegalMediaSize, 	"na_legal_8.5x14in");
       
   169 _LIT8(KUPnPIsoA4MediaSize, 		"iso_a4_210x297mm");
       
   170 _LIT8(KUPnPIsoC5MediaSize, 		"iso_c5_162x229mm");
       
   171 _LIT8(KUPnPIsoD1MediaSize, 		"iso_d1_110x220mm");
       
   172 _LIT8(KUPnPJisB4MediaSize, 		"jis_b4_257x364mm");
       
   173 _LIT8(KUPnPCustomXMmMediaSize, 	"custom_xxx_IIIxJJJmm");
       
   174 _LIT8(KUPnPCustomXInMediaSize, 	"custom_xxx_IIIxJJJin");
       
   175 _LIT8(KUPnPCustomMinMmMediaSize,"custom_min_xxx_IIIxJJJmm");
       
   176 _LIT8(KUPnPCustomMaxInMediaSize,"custom_max_xxx_IIIxJJJin");
       
   177 
       
   178 // Custom sizes
       
   179 _LIT8(KUPnPCustom4x6MediaSize, 	"custom_xxx_4x6in");
       
   180 
       
   181 // Media types
       
   182 _LIT8(KUPnPStationeryMediaType,			"stationery");
       
   183 _LIT8(KUPnPStationeryInkjetMediaType,	"stationery-inkjet");
       
   184 _LIT8(KUPnPTransparencyMediaType,		"transparency");
       
   185 _LIT8(KUPnPEnvelopeMediaType,			"envelope");
       
   186 _LIT8(KUPnPLabelsMediaType,				"labels");
       
   187 _LIT8(KUPnPPhotographicMediaType,		"photographic");
       
   188 _LIT8(KUPnPCardstockMediaType,			"cardstock");
       
   189 
       
   190 // Print quality
       
   191 _LIT8(KUPnPNormalPrintQuality,	"normal");
       
   192 _LIT8(KUPnPDraftPrintQuality,	"draft");
       
   193 _LIT8(KUPnPHighPrintQuality,	"high");
       
   194 
       
   195 // Misc
       
   196 _LIT8(KUPnPDocFormat, 			"application/xhtml-print");
       
   197 _LIT8(KUPnPUserName, 			"UPnP Print"); // Use instead the KUPnPAppFriendlyName name from central repository
       
   198 _LIT( KUPnPDataPath, 			"c:\\system\\data\\upnp\\" );
       
   199 _LIT( KUPnPXhtmlPath, 			"c:\\system\\data\\upnp\\xhtml\\" );
       
   200 _LIT8(KHttpPrefix,				"http://");
       
   201 _LIT8(KUPnPLineFeed8, 			"\n");
       
   202 _LIT( KUPnPLineFeed, 			"\n");
       
   203 _LIT8(KUPnPComma,				",");
       
   204 _LIT8(KUPnPColon,				":");
       
   205 _LIT8(KUPnPSlash,				"/");
       
   206 
       
   207 // Upnp item type
       
   208 _LIT8(KImageType, "object.item.imageItem");
       
   209 _LIT8(KTextType, "object.item.textItem");
       
   210 
       
   211 // Mime type
       
   212 _LIT8(KJpegMime, "image/jpeg");
       
   213 _LIT8(KHtmlMime, "text/html");
       
   214 
       
   215 #define KMaxIdLength 		10
       
   216 
       
   217 // Print service
       
   218 _LIT8(KUPnPServicePrint, "urn:schemas-upnp-org:service:PrintBasic:1");
       
   219 
       
   220 /*
       
   221 * @class 		TMapError
       
   222 * @description	This class contains the mapping for a single error 
       
   223 				string / ImagePrint error code.
       
   224 */
       
   225 class TMapError
       
   226 {
       
   227 	public:	
       
   228 		// @var iErrorCode		ImagePrint error codes
       
   229 		TPrintMessageCodes	iErrorCode;
       
   230 
       
   231 		// @var iErrorString	UPnP specific error string
       
   232 		TPtrC8	iErrorString;
       
   233 };
       
   234 
       
   235 #endif // UPCONSTS_H
       
   236 
       
   237 //  End of File