|
1 /* |
|
2 * Copyright (c) 2002-2005 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef ISCCHANNELCONTAINER_H |
|
22 #define ISCCHANNELCONTAINER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <kernel.h> |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class DIscChannel; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Static class to hold channel objects |
|
42 * |
|
43 * @lib IscDriver.LIB |
|
44 * @since 2.8 |
|
45 */ |
|
46 class IscChannelContainer |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 |
|
51 public: // New functions |
|
52 |
|
53 /** |
|
54 * Set pointer to channel |
|
55 * @since 2.8 |
|
56 * @param IscChannel* aChannel pointer to channel |
|
57 * @param const TUint16 aUnit channelnumber |
|
58 * @return void |
|
59 */ |
|
60 IMPORT_C static TInt SetChannel( DIscChannel* aChannel, |
|
61 const TUint16 aUnit ); |
|
62 |
|
63 /** |
|
64 * Return pointer to channel. TUint16 aChannelSharingIndex is needed |
|
65 * for channel sharing |
|
66 * @since 2.8 |
|
67 * @param const TUint16 aChannel channel number |
|
68 * @param const TUint16 aChannelSharingIndex, index in channel table. |
|
69 * @return static DIscChannel* pointer to channel instance |
|
70 */ |
|
71 static DIscChannel* Channel( const TUint16 aChannel, |
|
72 const TUint16 aChannelSharingIndex ); |
|
73 |
|
74 /** |
|
75 * Remove channel pointer from channel table |
|
76 * @since 2.8 |
|
77 * @param DIscChannel* aChannel pointer to DIscChannel |
|
78 * @return static TInt |
|
79 */ |
|
80 static TInt RemoveChannel( DIscChannel* aChannel ); |
|
81 |
|
82 /** |
|
83 * Goes through channels and open ones are emptied |
|
84 * @since 2.8 |
|
85 * @param TAny* not used |
|
86 * @return static void |
|
87 */ |
|
88 static void ChannelComplition( TAny* /*a*/ ); |
|
89 |
|
90 /** |
|
91 * Allocates Dfc function dynamically and formats data tables. |
|
92 * @since 2.8 |
|
93 * @return static void |
|
94 */ |
|
95 static void Initialize(); |
|
96 |
|
97 |
|
98 /** |
|
99 * Deallocates Dfc function |
|
100 * @since 2.8 |
|
101 * @return static void |
|
102 */ |
|
103 static void DeActivate(); |
|
104 |
|
105 /** |
|
106 * Adds ChannelComplition Dfc. |
|
107 * Can be called from any context. |
|
108 * @since 2.8 |
|
109 * @return static void |
|
110 */ |
|
111 static void AddDfc(); |
|
112 |
|
113 /** |
|
114 * Make sure that pointer is valid DIscChannel pointer |
|
115 * @since 2.8 |
|
116 * @param aChannelPtr DIscChannel pointer |
|
117 * @return void |
|
118 */ |
|
119 static TInt ValidateChannel( DIscChannel* aChannelPtr ); |
|
120 |
|
121 private: // Data |
|
122 |
|
123 static DIscChannel* iIscChannels[KIscNumberOfUnits][KIscMaxNumberOfChannelSharers]; |
|
124 |
|
125 static TDfc* iDfc; |
|
126 |
|
127 }; |
|
128 |
|
129 #endif // ISCCHANNELCONTAINER_H |
|
130 |
|
131 // End of File |