1 /* |
|
2 * Copyright (c) 2009 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: This file contains the CPrintQueue and |
|
15 * TPrintQueueItem class definitions. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef PRINTQUEUE_H |
|
20 #define PRINTQUEUE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 #include <StifTestInterface.h> |
|
26 |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // The print queue maximum length. If queue overflows, the lowest |
|
31 // priority item is discarded from queue. |
|
32 const TInt KQueueMaxLen = 20; |
|
33 |
|
34 // MACROS |
|
35 |
|
36 // DATA TYPES |
|
37 |
|
38 // FUNCTION PROTOTYPES |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 // DESCRIPTION |
|
45 // TPrintQueueItem is a print queue item class. |
|
46 class TPrintQueueItem |
|
47 :public CBase |
|
48 { |
|
49 public: // Enumerations |
|
50 // None |
|
51 |
|
52 protected: // Enumerations |
|
53 // None |
|
54 |
|
55 private: // Enumerations |
|
56 // None |
|
57 |
|
58 public: // Constructors and destructor |
|
59 /** |
|
60 * C++ default constructor. |
|
61 */ |
|
62 TPrintQueueItem( const TInt aPriority, |
|
63 const TStifInfoName& aText1, |
|
64 const TName& aText2 ); |
|
65 |
|
66 public: // New functions |
|
67 // None |
|
68 |
|
69 protected: // New functions |
|
70 // None |
|
71 |
|
72 private: // New functions |
|
73 |
|
74 public: // Functions from base classes |
|
75 |
|
76 protected: // Functions from base classes |
|
77 // None |
|
78 |
|
79 private: |
|
80 // None |
|
81 |
|
82 public: //Data |
|
83 TStifInfoName iData1; // Description |
|
84 TName iData2; // Text |
|
85 TInt iPriority; // Priority |
|
86 static const TInt iOffset; // Queue link offset |
|
87 |
|
88 protected: // Data |
|
89 // None |
|
90 |
|
91 private: // Data |
|
92 TSglQueLink iSlink; // Queue link |
|
93 |
|
94 public: // Friend classes |
|
95 // None |
|
96 |
|
97 protected: // Friend classes |
|
98 // None |
|
99 |
|
100 private: // Friend classes |
|
101 // None |
|
102 |
|
103 }; |
|
104 |
|
105 // DESCRIPTION |
|
106 // CPrintQueue is a queue for test module prints |
|
107 class CPrintQueue |
|
108 :public CBase |
|
109 { |
|
110 public: // Enumerations |
|
111 // None |
|
112 |
|
113 protected: // Enumerations |
|
114 // None |
|
115 |
|
116 private: // Enumerations |
|
117 // None |
|
118 |
|
119 public: // Constructors and destructor |
|
120 |
|
121 /** |
|
122 * NewL is first phase of two-phased constructor. |
|
123 */ |
|
124 static CPrintQueue* NewL(); |
|
125 |
|
126 /** |
|
127 * Destructor of CPrintQueue. |
|
128 */ |
|
129 virtual ~CPrintQueue(); |
|
130 |
|
131 |
|
132 public: // New functions |
|
133 |
|
134 /** |
|
135 * Pops item from queue |
|
136 */ |
|
137 TPrintQueueItem* Pop(); |
|
138 |
|
139 |
|
140 /** |
|
141 * Push item to queue |
|
142 */ |
|
143 TInt Push( TPrintQueueItem& anItem ); |
|
144 |
|
145 /** |
|
146 * Returns the count |
|
147 */ |
|
148 TInt Count(); |
|
149 |
|
150 |
|
151 public: // Functions from base classes |
|
152 // None |
|
153 |
|
154 protected: // New functions |
|
155 // None |
|
156 |
|
157 protected: // Functions from base classes |
|
158 // None |
|
159 |
|
160 private: |
|
161 |
|
162 /** |
|
163 * C++ default constructor. |
|
164 */ |
|
165 CPrintQueue(); |
|
166 |
|
167 public: //Data |
|
168 // None |
|
169 |
|
170 protected: // Data |
|
171 // None |
|
172 |
|
173 private: // Data |
|
174 TSglQue<TPrintQueueItem> iQueue; |
|
175 TSglQueIter<TPrintQueueItem> iQueueIterator; |
|
176 TInt iQueueLen; |
|
177 |
|
178 public: // Friend classes |
|
179 // None |
|
180 |
|
181 protected: // Friend classes |
|
182 // None |
|
183 |
|
184 private: // Friend classes |
|
185 // None |
|
186 |
|
187 }; |
|
188 |
|
189 #endif // PRINTQUEUE_H |
|
190 |
|
191 // End of File |
|