29
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-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: DUN Infrared plugin
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef C_CDUNIRPLUGIN_H
|
|
20 |
#define C_CDUNIRPLUGIN_H
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <c32comm.h>
|
|
24 |
#include "DunTransporter.h"
|
|
25 |
#include "DunPlugin.h"
|
|
26 |
|
|
27 |
/**
|
|
28 |
* DUN Infrared plugin's main class
|
|
29 |
* This class creates new transporter channel as soon as listening is
|
|
30 |
* required by DUN server
|
|
31 |
*
|
|
32 |
* @lib dunir.lib
|
|
33 |
* @since S60 v3.2
|
|
34 |
*/
|
|
35 |
NONSHARABLE_CLASS( CDunIrPlugin ) : public CBase,
|
|
36 |
public MDunLocalMediaPlugin,
|
|
37 |
public MDunConnMon
|
|
38 |
{
|
|
39 |
|
|
40 |
public:
|
|
41 |
|
|
42 |
CDunIrPlugin();
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Destructor.
|
|
46 |
*/
|
|
47 |
virtual ~CDunIrPlugin();
|
|
48 |
|
|
49 |
private:
|
|
50 |
|
|
51 |
/**
|
|
52 |
* State of this plugin
|
|
53 |
*
|
|
54 |
* @since S60 3.2
|
|
55 |
* @return State of plugin
|
|
56 |
*/
|
|
57 |
TDunPluginState PluginState();
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Constructs a listener object for this plugin
|
|
61 |
*
|
|
62 |
* @since S60 3.2
|
|
63 |
* @return None
|
|
64 |
*/
|
|
65 |
TInt ConstructListener();
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Sets new state
|
|
69 |
* New state must be one more than the old state
|
|
70 |
*
|
|
71 |
* @since S60 3.2
|
|
72 |
* @param aPluginState New state to set for a plugin
|
|
73 |
* @return Symbian error code on error, KErrNone otherwise
|
|
74 |
*/
|
|
75 |
TInt ReportStateChangeUp( TDunPluginState aPluginState );
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Sets new state
|
|
79 |
* New state must be one less than the old state
|
|
80 |
*
|
|
81 |
* @since S60 3.2
|
|
82 |
* @param aPluginState New state to set for a plugin
|
|
83 |
* @return Symbian error code on error, KErrNone otherwise
|
|
84 |
*/
|
|
85 |
TInt ReportStateChangeDown( TDunPluginState aPluginState );
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Initializes one infrared port with role DCE
|
|
89 |
*
|
|
90 |
* @since S60 3.2
|
|
91 |
* @return Symbian error code on error, KErrNone otherwise
|
|
92 |
*/
|
|
93 |
TInt InitPort();
|
|
94 |
|
|
95 |
/**
|
|
96 |
* Allocates a channel
|
|
97 |
*
|
|
98 |
* @since S60 3.2
|
|
99 |
* @return None
|
|
100 |
*/
|
|
101 |
void AllocateChannelL();
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Uninitializes this plugin
|
|
105 |
*
|
|
106 |
* @since S60 3.2
|
|
107 |
* @return Symbian error code on error, KErrNone otherwise
|
|
108 |
*/
|
|
109 |
TInt Uninitialize();
|
|
110 |
|
|
111 |
// from base class MDunLocalMediaPlugin
|
|
112 |
|
|
113 |
void ConstructL( MDunServerCallback* aServer,
|
|
114 |
CDunTransporter* aTransporter );
|
|
115 |
|
|
116 |
/**
|
|
117 |
* From MDunLocalMediaPlugin.
|
|
118 |
* Gets called when server changes a plugin's state
|
|
119 |
*
|
|
120 |
* @since S60 3.2
|
|
121 |
* @param aPluginState New changed state
|
|
122 |
* @return Symbian error code on error, KErrNone otherwise
|
|
123 |
*/
|
|
124 |
TInt NotifyServerStateChange( TDunPluginState aPluginState );
|
|
125 |
|
|
126 |
/**
|
|
127 |
* From MDunLocalMediaPlugin.
|
|
128 |
* Gets called when server needs to know the active connection
|
|
129 |
* (For testing purposes only)
|
|
130 |
*
|
|
131 |
* @since S60 5.0
|
|
132 |
* @return Active connection, NULL otherwise
|
|
133 |
*/
|
|
134 |
TConnId ActiveConnection();
|
|
135 |
|
|
136 |
// from base class MDunConnMon
|
|
137 |
|
|
138 |
/**
|
|
139 |
* From MDunConnMon.
|
|
140 |
* Gets called when line status changes or when any type of error is
|
|
141 |
* detected
|
|
142 |
*
|
|
143 |
* @since S60 3.2
|
|
144 |
* @param aConnId Connection ID for callback
|
|
145 |
* @param aConnReason Reason for progress change
|
|
146 |
* @return None
|
|
147 |
*/
|
|
148 |
void NotifyProgressChangeL( TConnId aConnId,
|
|
149 |
TDunConnectionReason aConnReason );
|
|
150 |
|
|
151 |
private: // Data
|
|
152 |
|
|
153 |
/**
|
|
154 |
* Callback to call when notification MDunServerCallback via to be made
|
|
155 |
* Not own.
|
|
156 |
*/
|
|
157 |
MDunServerCallback* iServer;
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Communications server used to load IRCOMM and open IR port
|
|
161 |
*/
|
|
162 |
RCommServ iCommServer;
|
|
163 |
|
|
164 |
/**
|
|
165 |
* RComm port for infrared local media side
|
|
166 |
*/
|
|
167 |
RComm iIrPort;
|
|
168 |
|
|
169 |
/**
|
|
170 |
* Transporter to use for network side communication
|
|
171 |
* Not own.
|
|
172 |
*/
|
|
173 |
CDunTransporter* iTransporter;
|
|
174 |
|
|
175 |
};
|
|
176 |
|
|
177 |
#endif // C_CDUNIRPLUGIN_H
|