|
1 /* |
|
2 * Copyright (c) 2008 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: Plugin transaction list header file. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_HWRMHAPTICSPLUGINTRANSACTIONLIST_H |
|
20 #define C_HWRMHAPTICSPLUGINTRANSACTIONLIST_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "hwrmhapticsplugintransactionlistitem.h" |
|
24 |
|
25 |
|
26 /** |
|
27 * Haptics server side plugin transaction list handler |
|
28 * |
|
29 * @lib hwrmhapticspluginmanager.lib |
|
30 * @since S60 5.1 |
|
31 */ |
|
32 class CHWRMHapticsPluginTransactionList : public CBase |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Destructor. |
|
38 * Deletes all data instances still in the list, even though normally |
|
39 * instances are deleted by using class. This is because after |
|
40 * list destruction there is no way to find the instances to delete any more. |
|
41 */ |
|
42 virtual ~CHWRMHapticsPluginTransactionList(); |
|
43 |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Finds a transaction from transaction list. |
|
48 * |
|
49 * @param aTransId Unique transcation identifier |
|
50 * @param aRemove If ETrue, transaction will be removed from the list. |
|
51 * @return Transaction data found or NULL if not found. |
|
52 */ |
|
53 CHWRMHapticsPluginTransactionListItem* |
|
54 FindTransaction( TUint8 aTransId, TBool aRemove); |
|
55 |
|
56 /** |
|
57 * Add transaction to transaction list |
|
58 * |
|
59 * @param aTransactionData Transaction data to add to list |
|
60 */ |
|
61 void AddTransaction( |
|
62 CHWRMHapticsPluginTransactionListItem* aTransactionData ); |
|
63 |
|
64 /** |
|
65 * Removes first item from list. |
|
66 * |
|
67 * @return Pointer to removed item or NULL if empty |
|
68 */ |
|
69 CHWRMHapticsPluginTransactionListItem* RemoveFirstItem(); |
|
70 |
|
71 /** |
|
72 * Get first transaction data item in the list |
|
73 * That item can be then used to iterate further. |
|
74 * |
|
75 * @return First item in the list or NULL if empty. |
|
76 */ |
|
77 inline CHWRMHapticsPluginTransactionListItem* FirstItem(); |
|
78 |
|
79 /** |
|
80 * Get last transaction data item in the list |
|
81 * |
|
82 * @return Last item in the list or NULL if empty. |
|
83 */ |
|
84 inline CHWRMHapticsPluginTransactionListItem* LastItem(); |
|
85 |
|
86 /** |
|
87 * Get count of transactions in list |
|
88 */ |
|
89 inline TInt Count() const; |
|
90 |
|
91 public: |
|
92 |
|
93 /** |
|
94 * C++ default constructor. |
|
95 */ |
|
96 CHWRMHapticsPluginTransactionList(); |
|
97 |
|
98 private: // data |
|
99 |
|
100 /** |
|
101 * Pointer to the next data in list. |
|
102 * User of the list is responsible for creation and deletion |
|
103 * of data. All existing items will be deleted automatically |
|
104 * in list destructor. |
|
105 */ |
|
106 CHWRMHapticsPluginTransactionListItem* iTransactionData; |
|
107 |
|
108 /** |
|
109 * Last transaction data in list |
|
110 */ |
|
111 CHWRMHapticsPluginTransactionListItem* iTransactionDataLast; |
|
112 |
|
113 /** |
|
114 * Number of transactions in list |
|
115 */ |
|
116 TInt iCount; |
|
117 |
|
118 }; |
|
119 |
|
120 |
|
121 #include "hwrmhapticsplugintransactionlist.inl" |
|
122 |
|
123 #endif // C_HWRMHAPTICSPLUGINTRANSACTIONLIST_H |
|
124 |
|
125 // End of File |