DirectPrint/DirectPrintServer/inc/directprintprotocolsloader.h
author msekine <m.sekine@kthree.co.jp>
Wed, 31 Mar 2010 00:04:55 +0900
branchRCL_3
changeset 11 613a5ff70823
child 19 2275db202402
permissions -rw-r--r--
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
     1
/*
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
     2
* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
     3
* All rights reserved.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
     8
*
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
     9
* Initial Contributors:
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    10
* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    11
*
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    12
* Contributors:
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    13
*
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    14
* Description:  Contains the CDirectPrintProtocolsLoader class definition.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    15
*
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    16
*/
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    17
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    18
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    19
// Protection against nested includes
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    20
#ifndef DIRECTPRINTPROTOCOLSLOADER_H
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    21
#define DIRECTPRINTPROTOCOLSLOADER_H
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    22
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    23
// System includes
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    24
#include <e32base.h>
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    25
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    26
// User includes
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    27
#include "directprintprotocolinfo.h"
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    28
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    29
// Forward declarations
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    30
class MProtPrintingDevice;
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    31
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    32
class CDirectPrintProtocolsLoader : public CBase
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    33
	{
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    34
	public:
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    35
	
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    36
		static CDirectPrintProtocolsLoader* NewL();
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    37
		~CDirectPrintProtocolsLoader();
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    38
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    39
		/**
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    40
		 *	Gets the number of protocol implementations that could be loaded.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    41
		 *	@return Number of protocols available.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    42
		 */
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    43
		TInt GetNumberOfProtocolsAvailable() const;
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    44
		
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    45
		/**
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    46
		 *	Gets the next protocol in the internal list of protocols.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    47
		 *
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    48
		 *	Returns a pointer to the next protocol in the list. If the end of the list is reached, it starts the list over.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    49
		 *	The order in which protocols will be returned is: DPOF, BPP, PictBridge, any other protocols (sorted alpha-
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    50
		 *	betically). This pointer should not be deleted. 
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    51
		 *	@return Pointer to the next protocol instance.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    52
		 */
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    53
		MProtPrintingDevice* GetNextProtocol();
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    54
		
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    55
		/**
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    56
		 *	Gets the protocol located in the position specified. 
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    57
		 *	@param aIndex Index of the desired protocol. If there are 3 protocols, the valid indexes are: 0, 1, 2.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    58
		 *	@return Pointer to the next protocol instance. This pointer should not be deleted. 
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    59
		 */
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    60
		MProtPrintingDevice* GetProtocolAt(TInt aIndex);
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    61
		
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    62
		/**
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    63
		 *	Resets the inner pointers to the beginning of the protocols' list.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    64
		 */
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    65
		void Reset();
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    66
		
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    67
		/**
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    68
		 * Returns the index of the current protocol
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    69
		 */
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    70
		TInt GetProtocolIndex() const;
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    71
		
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    72
		/**
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    73
		 *	@brief Returns the Protocols supported by the DLL. It can be any of the KDirectPrint_PrinterProtocol* constants.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    74
		 *	@return An OR'ed value with the supported protocols information.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    75
		 */
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    76
		TUint SupportedProtocols() const;
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    77
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    78
		/**
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    79
		 *	Gets the protocol name in the position specified. 
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    80
		 *	@param aIndex Index of the desired protocol. If there are 3 protocols, the valid indexes are: 0, 1, 2.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    81
		 *	@param aName Name of the protocol.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    82
		 *	@param aUid Uid of the protocol.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    83
		 *	@return error code.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    84
		 */
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    85
		TInt GetProtocolName(TInt aIndex, TDes& aName, TInt& aUid);
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    86
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    87
	private:
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    88
	
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    89
		CDirectPrintProtocolsLoader();
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    90
		void ConstructL();
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    91
		void LoadL();
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    92
		static void CleanupProt( TAny* aData );
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    93
	
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    94
	private: // data
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    95
	
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    96
		/// Used to store the number of protocols loaded and available for use.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    97
		TInt iAvailableProtocols;
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    98
					
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
    99
		/// Index of the next protocol available.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   100
		TInt iProtIndex;
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   101
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   102
		/// Pointer array used to store the reference to the protocols.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   103
		RPointerArray<MProtPrintingDevice> iProtocols;
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   104
				
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   105
		/// OR'ed value with the supported protocols information.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   106
		TUint iSupportedProtocols;
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   107
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   108
		/// Pointer array used to store the reference to the protocol infomations.
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   109
		RPointerArray<CDirectPrintProtocolInfo> iProtocolInfos;
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   110
	};
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   111
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   112
#endif // DIRECTPRINTPROTOCOLSLOADER_H
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   113
613a5ff70823 transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff changeset
   114
//  End of File