Symbian3/PDK/Source/GUID-A1F0D18B-5A89-58FC-9361-7B0A9786C826.dita
changeset 9 59758314f811
parent 5 f345bda72bc4
child 12 80ef3a206772
equal deleted inserted replaced
8:ae94777fff8f 9:59758314f811
     7     Nokia Corporation - initial contribution.
     7     Nokia Corporation - initial contribution.
     8 Contributors: 
     8 Contributors: 
     9 -->
     9 -->
    10 <!DOCTYPE concept
    10 <!DOCTYPE concept
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    12 <concept id="GUID-A1F0D18B-5A89-58FC-9361-7B0A9786C826" xml:lang="en"><title>pdrstore:
    12 <concept id="GUID-A1F0D18B-5A89-58FC-9361-7B0A9786C826" xml:lang="en"><title>pdrstore: Creating a Printer Driver using pdr files</title><prolog><metadata><keywords/></metadata></prolog><conbody>
    13 Creating a Printer Driver using pdr files</title><prolog><metadata><keywords/></metadata></prolog><conbody>
    13 <section id="GUID-A041DECA-21EB-462E-A503-ED794BEB8CF1"><title> Description</title> <p>This example demonstrates
    14 <section><title> Description</title> <p>This example demonstrates how to load
    14 how to load printer driver information files and create a printer
    15 printer driver information files and create a printer driver. The purpose
    15 driver. The purpose of the PdrStore API is to: </p> <ul>
    16 of the PdrStore API is to: </p> <ul>
    16 <li id="GUID-4320D425-C6D3-5119-A7DF-9C75BA4FA66A"><p>Provide access
    17 <li id="GUID-4320D425-C6D3-5119-A7DF-9C75BA4FA66A"><p>Provide access to the
    17 to the printer driver information contained in <filepath>.pdr</filepath> files for applications to build a printer driver list </p> </li>
    18 printer driver information contained in <filepath>.pdr</filepath> files for
    18 <li id="GUID-7F7C199C-EC78-565B-8CF2-3ED6212035A5"><p>Load and create
    19 applications to build a printer driver list </p> </li>
    19 an appropriate printer driver for a given printer. </p> </li>
    20 <li id="GUID-7F7C199C-EC78-565B-8CF2-3ED6212035A5"><p>Load and create an appropriate
    20 </ul> <p>During initialisation, the example first loads the printer
    21 printer driver for a given printer. </p> </li>
    21 driver, then creates a session with the font and bitmap server. This
    22 </ul> <p>During initialisation, the example first loads the printer driver,
    22 is detailed in the following sections. </p> </section>
    23 then creates a session with the font and bitmap server. This is detailed in
    23 <section id="GUID-F2FBFB59-3029-50FD-8854-E734D3ACF5C0"><title>Download</title> <p>Click on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-b4699e53-658f-4006-a903-12af723cc33f.zip" scope="external"> PDRStore.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-b4699e53-658f-4006-a903-12af723cc33f.html" scope="peer">browse</xref> to view the example code. </p> </section>
    24 the following sections. </p> </section>
    24 <section id="GUID-7C100FE7-38EB-4EE0-9D3C-C0D209FE6BAA"><title> Create a printer driver</title> <codeblock id="GUID-0ED8C6D9-81DF-52A6-8F7F-70D21449C1A1" xml:space="preserve">void CPdrExample::CreatePrinterDriver()</codeblock> <p>This function provides the following funtionality: </p> <ul>
    25 <section id="GUID-F2FBFB59-3029-50FD-8854-E734D3ACF5C0"><title>Download</title> <p>Click
    25 <li id="GUID-DA7ECFC7-7728-5A57-82B7-E0330ACBE71A"><p>Opens a printer
    26 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-b4699e53-658f-4006-a903-12af723cc33f.zip" scope="external"> PDRStore.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-b4699e53-658f-4006-a903-12af723cc33f.html" scope="peer">browse</xref> to view the example code. </p> </section>
    26 driver information (<filepath>.pdr</filepath>) file using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-89C95254-2667-37CD-A9DC-0DEEC77A9C82"><apiname>CPrinterDriver::OpenPdrL(const TDesC&amp;)</apiname></xref>  </p> </li>
    27 <section><title> Create a printer driver</title> <codeblock id="GUID-0ED8C6D9-81DF-52A6-8F7F-70D21449C1A1" xml:space="preserve">void CPdrExample::CreatePrinterDriver()</codeblock> <p>This function provides the following funtionality: </p> <ul>
    27 <li id="GUID-CF237DFC-249B-5B44-8F5F-3011A75422E3"><p>Gets the total
    28 <li id="GUID-DA7ECFC7-7728-5A57-82B7-E0330ACBE71A"><p>Opens a printer driver
    28 number of driver models available using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-99C5E5F5-DF2C-3682-AE88-47E06A0D1AC0"><apiname>CPrinterDriver::NumModels()
    29 information (<filepath>.pdr</filepath>) file using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-617D27C1-AB5F-3B58-A4F3-9EB53FE70B63"><apiname>CPrinterDriver::OpenPdrL()</apiname></xref>  </p> </li>
    29 const</apiname></xref>  </p> </li>
    30 <li id="GUID-CF237DFC-249B-5B44-8F5F-3011A75422E3"><p>Gets the total number
    30 <li id="GUID-8363CBE3-D404-5805-A6FF-F14B5E65D0ED"><p>Creates a printer
    31 of driver models available using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-EC44033C-1209-389B-9230-827BBB49F72C"><apiname>CPrinterDriver::NumModels()</apiname></xref>  </p> </li>
    31 device using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-225235E0-2F06-3C7F-BB2E-83A932E410B6"><apiname>CPrinterDriver::CreatePrinterDeviceL(TInt)</apiname></xref>. </p> </li>
    32 <li id="GUID-8363CBE3-D404-5805-A6FF-F14B5E65D0ED"><p>Creates a printer device
       
    33 using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-03171887-4F70-36F9-BF02-F664717E5E2D"><apiname>CPrinterDriver::CreatePrinterDeviceL()</apiname></xref>. </p> </li>
       
    34 </ul> </section>
    32 </ul> </section>
    35 <section><title>Display the supported typefaces</title> <codeblock id="GUID-95133682-4612-50F6-94F3-7FA6F5EFA54C" xml:space="preserve">void CPdrExample::DisplayTypefaces()</codeblock> <p>Gets the list of supported typefaces using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-52F99F83-3BFE-3703-B30F-36453BAC4FD5"><apiname>CPrinterDevice::TypefaceSupport()</apiname></xref> and
    33 <section id="GUID-DE05838E-A239-4535-849C-0F4DA4289DB0"><title>Display the supported typefaces</title> <codeblock id="GUID-95133682-4612-50F6-94F3-7FA6F5EFA54C" xml:space="preserve">void CPdrExample::DisplayTypefaces()</codeblock> <p>Gets the list of supported typefaces using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-CA59407C-8F11-36F0-A31C-7E7F38F1B624"><apiname>CPrinterDevice::TypefaceSupport(TTypefaceSupport
    36 displays them. </p> </section>
    34 &amp;,TInt) const</apiname></xref> and displays them. </p> </section>
    37 <section><title>Create a printer control</title> <codeblock id="GUID-FF996CFF-8CA3-581F-824C-B76EF8EA5006" xml:space="preserve">void CPdrExample::CreatePrinterControl()</codeblock> <p>Creates a printer control using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-CEB04B4E-78C8-33C1-B894-1C89C65BF8C4"><apiname>CPrinterDevice::CreateControlL()</apiname></xref>. </p> </section>
    35 <section id="GUID-4C6EDF7D-49BE-4309-9B83-654F2EA33C08"><title>Create a printer control</title> <codeblock id="GUID-FF996CFF-8CA3-581F-824C-B76EF8EA5006" xml:space="preserve">void CPdrExample::CreatePrinterControl()</codeblock> <p>Creates a printer control using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-CEB04B4E-78C8-33C1-B894-1C89C65BF8C4"><apiname>CPrinterDevice::CreateControlL()</apiname></xref>. </p> </section>
    38 <section><title>Preparing for printing</title> <codeblock id="GUID-2BE7956F-C976-583B-8E9A-01990D7B44E1" xml:space="preserve">void CPdrExample::PrintPages()</codeblock> <p>This function prepares the printer driver for printing the pages. It
    36 <section id="GUID-6165F5D5-FBF6-4910-B241-F9D61A4FB5C3"><title>Preparing for printing</title> <codeblock id="GUID-2BE7956F-C976-583B-8E9A-01990D7B44E1" xml:space="preserve">void CPdrExample::PrintPages()</codeblock> <p>This function prepares the printer driver for printing the pages.
    39 involves the following: </p> <ul>
    37 It involves the following: </p> <ul>
    40 <li id="GUID-73362C6E-DEC0-5842-A76E-99247F34E567"><p>Gets the number of bands
    38 <li id="GUID-73362C6E-DEC0-5842-A76E-99247F34E567"><p>Gets the number
    41 per page using <xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita#GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906/GUID-6DD8081E-C801-3B80-83FB-E613A527A274"><apiname>CPrinterControl::BandsPerPage()</apiname></xref>  </p> </li>
    39 of bands per page using <xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita#GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906/GUID-6DD8081E-C801-3B80-83FB-E613A527A274"><apiname>CPrinterControl::BandsPerPage()</apiname></xref>  </p> </li>
    42 <li id="GUID-5B0F8F3C-FE43-5B97-AE37-97454C71D7BF"><p>Gets each band to be
    40 <li id="GUID-5B0F8F3C-FE43-5B97-AE37-97454C71D7BF"><p>Gets each band
    43 printed using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-3B4B041B-0840-3FBA-8C6B-8A28342D57DC"><apiname>CPrinterDevice::QueueGetBand()</apiname></xref>  </p> </li>
    41 to be printed using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-0CE0ABD3-841A-3121-9EDE-CE031567A195"><apiname>CPrinterDevice::QueueGetBand(TRequestStatus&amp;
    44 <li id="GUID-EF600D86-1EB8-52EE-B3D4-5A15BBDAEB79"><p>Creates a graphic context
    42 aStatus, TBandAttributes&amp; aBand)</apiname></xref>  </p> </li>
    45 using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-5A8B4073-BA25-34FC-8186-88D6B000028A"><apiname>CPrinterDevice::CreateContextL()</apiname></xref> to draw </p> </li>
    43 <li id="GUID-EF600D86-1EB8-52EE-B3D4-5A15BBDAEB79"><p>Creates a graphic
    46 <li id="GUID-D0E0ECC7-BB6F-5EF6-80BE-EFAEA4216B8D"><p>Terminates the print
    44 context using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-5A8B4073-BA25-34FC-8186-88D6B000028A"><apiname>CPrinterDevice::CreateContextL()</apiname></xref> to
    47 process using <xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita#GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906/GUID-AE7026BB-9E8C-3367-B9BD-AB3594DDD1A0"><apiname>CPrinterControl::QueueEndPrint()</apiname></xref> when no
    45 draw </p> </li>
    48 more bands are available. </p> </li>
    46 <li id="GUID-D0E0ECC7-BB6F-5EF6-80BE-EFAEA4216B8D"><p>Terminates the
       
    47 print process using <xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita#GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906/GUID-6714C5BC-8458-339B-8BED-DA7BE95106E7"><apiname>CPrinterControl::QueueEndPrint(TRequestStatus
       
    48 &amp;)</apiname></xref> when no more bands are available. </p> </li>
    49 </ul> </section>
    49 </ul> </section>
    50 <section><title>Class Summary</title><p><xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita"><apiname>CPrinterDevice</apiname></xref></p><p><xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita"><apiname>CPrinterControl</apiname></xref></p><p><xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita"><apiname>CPrinterDriver</apiname></xref></p><p><xref href="GUID-DAD09DCF-3123-38B4-99E9-91FB24B92138.dita"><apiname>CGraphicsContext</apiname></xref></p></section>
    50 <section id="GUID-E2DBE267-21AE-4D47-B520-AB78F01C0BC5"><title>Class Summary</title><p><xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita"><apiname>CPrinterDevice</apiname></xref></p><p><xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita"><apiname>CPrinterControl</apiname></xref></p><p><xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita"><apiname>CPrinterDriver</apiname></xref></p><p><xref href="GUID-DAD09DCF-3123-38B4-99E9-91FB24B92138.dita"><apiname>CGraphicsContext</apiname></xref></p></section>
    51 <section><title>Usage</title> <p>This is a console application, so does not
    51 <section id="GUID-F887FECF-4B72-406D-B185-6BDEC8DFE622"><title>Usage</title> <p>This is a console application, so
    52 have a GUI. It builds an executable called <filepath>pdrstoreexample.exe</filepath> in
    52 does not have a GUI. It builds an executable called <filepath>pdrstoreexample.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i>&lt;build_variant&gt;</i> for CodeWarrior). The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian platform
    53 the standard location (<filepath>\epoc32\release\winscw\</filepath> <i>&lt;build_variant&gt;</i> for
    53 build process</xref> describes how to build this application. After
    54 CodeWarrior). The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian
    54 launching the executable, depending on the emulator you are using,
    55 platform build process</xref> describes how to build this application. After
    55 you may need to task away from the app launcher/shell screen to view
    56 launching the executable, depending on the emulator you are using, you may
    56 the console. </p> </section>
    57 need to task away from the app launcher/shell screen to view the console. </p> </section>
       
    58 </conbody></concept>
    57 </conbody></concept>