|
1 /* |
|
2 * Copyright (c) 2004-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: Contains the CProtocolsLoader class definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPROTOCOLSLOADER_H |
|
20 #define CPROTOCOLSLOADER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class MProtPrintingDevice; |
|
25 |
|
26 class CProtocolsLoader : public CBase |
|
27 { |
|
28 public: |
|
29 |
|
30 static CProtocolsLoader* NewL(); |
|
31 ~CProtocolsLoader(); |
|
32 |
|
33 /** |
|
34 * Gets the number of protocol implementations that could be loaded. |
|
35 * @return Number of protocols available. |
|
36 */ |
|
37 TInt GetNumberOfProtocolsAvailable() const; |
|
38 |
|
39 /** |
|
40 * Gets the next protocol in the internal list of protocols. |
|
41 * |
|
42 * Returns a pointer to the next protocol in the list. If the end of the list is reached, it starts the list over. |
|
43 * The order in which protocols will be returned is: DPOF, BPP, PictBridge, any other protocols (sorted alpha- |
|
44 * betically). This pointer should not be deleted. |
|
45 * @return Pointer to the next protocol instance. |
|
46 */ |
|
47 MProtPrintingDevice* GetNextProtocol(); |
|
48 |
|
49 /** |
|
50 * Gets the protocol located in the position specified. |
|
51 * @param aIndex Index of the desired protocol. If there are 3 protocols, the valid indexes are: 0, 1, 2. |
|
52 * @return Pointer to the next protocol instance. This pointer should not be deleted. |
|
53 */ |
|
54 MProtPrintingDevice* GetProtocolAt(TInt aIndex); |
|
55 |
|
56 /** |
|
57 * Resets the inner pointers to the beginning of the protocols' list. |
|
58 */ |
|
59 void Reset(); |
|
60 |
|
61 /** |
|
62 * Returns the index of the current protocol |
|
63 */ |
|
64 TInt GetProtocolIndex() const; |
|
65 |
|
66 /** |
|
67 * @brief Returns the Protocols supported by the DLL. It can be any of the KImagePrint_PrinterProtocol* constants. |
|
68 * @return An OR'ed value with the supported protocols information. |
|
69 */ |
|
70 TUint SupportedProtocols() const; |
|
71 |
|
72 private: |
|
73 |
|
74 CProtocolsLoader(); |
|
75 void ConstructL(); |
|
76 void LoadL(); |
|
77 static void CleanupProt( TAny* aData ); |
|
78 |
|
79 private: // data |
|
80 |
|
81 /// Used to store the number of protocols loaded and available for use. |
|
82 TInt iAvailableProtocols; |
|
83 |
|
84 /// Index of the next protocol available. |
|
85 TInt iProtIndex; |
|
86 |
|
87 /// Pointer array used to store the reference to the protocols. |
|
88 RPointerArray<MProtPrintingDevice> iProtocols; |
|
89 |
|
90 /// OR'ed value with the supported protocols information. |
|
91 TUint iSupportedProtocols; |
|
92 }; |
|
93 |
|
94 #endif // CPROTOCOLSLOADER_H |
|
95 |
|
96 // End of File |