epoc32/include/pdrport.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef PDRPORT_H
    17 #define PDRPORT_H
    18 
    19 #include <e32std.h>
    20 #include <c32comm.h>
    21 #include <gdi.h>
    22 #include <s32file.h>
    23 
    24 
    25 /**
    26  @publishedAll
    27  @released 
    28  */
    29 class CFilePrinterPort : public CPrinterPort
    30 	{
    31 public:
    32 	IMPORT_C static CFilePrinterPort* NewL(const TDesC& aFileName);
    33 	IMPORT_C ~CFilePrinterPort();
    34 	void WriteRequest(const TDesC8& aBuf,TRequestStatus& aRequestStatus);
    35 	void Cancel();
    36 	inline const TDesC& FileName() { return iFileName; }
    37 private:
    38 	void ConstructL();
    39 	CFilePrinterPort(const TDesC& aFileName);
    40 private:
    41 	RFs iFs;
    42 	TFileName iFileName;
    43 	RFile iFile;
    44 	TBool iCancelled;
    45 	};
    46 
    47 /**
    48  * @internalTechnology
    49  * Internal to Symbian
    50  */
    51 class TOutputHandshake
    52 	{
    53 public:
    54 	IMPORT_C TOutputHandshake();
    55 	IMPORT_C void InternalizeL(RReadStream& aStream);
    56 	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
    57 public:
    58 	TBool iXonXoff;
    59 	TBool iCts;
    60 	TBool iDsr;
    61 	TBool iDcd;
    62 	};
    63 
    64 /**
    65  * @internalTechnology
    66  * Internal to Symbian
    67  */
    68 class TSerialPrinterPortConfig
    69 	{
    70 public:
    71 	IMPORT_C TSerialPrinterPortConfig();
    72 	IMPORT_C void InternalizeL(RReadStream& aStream);
    73 	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
    74 public:
    75 	TBps iRate;
    76 	TDataBits iDataBits;
    77 	TStopBits iStopBits;
    78 	TParity iParity;
    79 	TBool iIgnoreParity;
    80 	TOutputHandshake iHandshake;
    81 	};
    82 
    83 /**
    84  * @internalTechnology
    85  * Internal to Symbian
    86  */
    87 class CCommPrinterPort : public CPrinterPort
    88 	{
    89 public:
    90 	IMPORT_C static CCommPrinterPort* NewL(const TDesC& aCsyName, const TDesC& aPortName, const TSerialPrinterPortConfig& aConfig, const TFifo aFifo = EFifoEnable);
    91 	IMPORT_C ~CCommPrinterPort();
    92 	IMPORT_C void WriteRequest(const TDesC8& aBuf, TRequestStatus& aRequestStatus);
    93 	IMPORT_C void Cancel();
    94 protected:
    95 	IMPORT_C void ConstructL(const TDesC& aCsyName, const TDesC& aPortName, const TSerialPrinterPortConfig& aConfig, const TFifo aFifo = EFifoEnable);
    96 	IMPORT_C CCommPrinterPort();
    97 protected:
    98 	RCommServ iCommServ;
    99 	RComm iComm;
   100 	};
   101 
   102 /**
   103  * @internalTechnology
   104  * Internal to Symbian
   105  */
   106 class CSerialPrinterPort : public CCommPrinterPort
   107 	{
   108 public:
   109 	IMPORT_C static CSerialPrinterPort* NewL(const TDesC& aPortName, const TSerialPrinterPortConfig& aConfig);
   110 	IMPORT_C ~CSerialPrinterPort();
   111 	IMPORT_C TSerialPrinterPortConfig Config();  // returns the current port config
   112 private:
   113 	void ConstructL(const TDesC& aPortName);
   114 	CSerialPrinterPort(const TSerialPrinterPortConfig& aConfig);
   115 private:
   116 	TSerialPrinterPortConfig iConfig;
   117 	};
   118 
   119 /**
   120  * @internalTechnology
   121  * Internal to Symbian
   122  */
   123 class CParallelPrinterPort : public CCommPrinterPort
   124 	{
   125 public:
   126 	IMPORT_C static CParallelPrinterPort* NewL(const TDesC& aPortName);
   127 	IMPORT_C ~CParallelPrinterPort();
   128 private:
   129 	void ConstructL(const TDesC& aPortName);
   130 	CParallelPrinterPort();
   131 	};
   132 
   133 /**
   134  * @internalTechnology
   135  * Internal to Symbian
   136  */
   137 class CIrdaPrinterPort : public CCommPrinterPort
   138 	{
   139 public:
   140 	IMPORT_C static CIrdaPrinterPort* NewL();
   141 	IMPORT_C ~CIrdaPrinterPort();
   142 private:
   143 	void ConstructL();
   144 	CIrdaPrinterPort();
   145 	};
   146 
   147 /**
   148  * @internalTechnology
   149  * Internal to Symbian
   150  */
   151 class CEpocConnectPort : public CCommPrinterPort
   152 	{
   153 public:
   154 	IMPORT_C static CEpocConnectPort* NewL();
   155 	IMPORT_C ~CEpocConnectPort();
   156 private:
   157 	void ConstructL();
   158 	CEpocConnectPort();
   159 	};
   160 
   161 #endif