epoc32/include/etel.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 etel.h
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @publishedAll
       
    21  @released
       
    22 */
       
    23 
       
    24 #if !defined(__ETEL_H__)
       
    25 /** @internalComponent */
       
    26 #define __ETEL_H__
       
    27 
       
    28 #if !defined(__E32BASE_H__)
       
    29 #include <e32base.h>
       
    30 #endif
       
    31 
       
    32 #if !defined (__C32COMM_H__)
       
    33 #include <c32comm.h>
       
    34 #endif
       
    35 
       
    36 #if !defined(__D32COMM_H__)
       
    37 #include <d32comm.h>
       
    38 #endif
       
    39 
       
    40 #if !defined(__FAXDEFN_H)
       
    41 #include <faxdefn.h>
       
    42 #endif
       
    43 /** Major version number.*/
       
    44 const TUint KEtelMajorVersionNumber=1;
       
    45 /** Minor version number. */
       
    46 const TUint KEtelMinorVersionNumber=0;
       
    47 /** Build number. */
       
    48 const TUint KEtelBuildVersionNumber=606;
       
    49 /**
       
    50 @internalComponent
       
    51 */
       
    52 IMPORT_C void PanicClient(TInt aFault);
       
    53 
       
    54 //
       
    55 // Etel Core Error Definitions
       
    56 //
       
    57 
       
    58 const TInt KErrEtelCoreBase = -2000;
       
    59 
       
    60 /** The client is not the call owner and has attempted to perform an operation 
       
    61 that requires ownership.*/
       
    62 const TInt KErrEtelNotCallOwner=KErrEtelCoreBase;
       
    63 /** An attempt has been made to load an ETel (TSY) module which contains a phone 
       
    64 with the same name as one already loaded. */
       
    65 const TInt KErrEtelDuplicatePhoneName=KErrEtelCoreBase-1;
       
    66 /** An attempt has been made to acquire call ownership when the requesting client 
       
    67 is already the call owner. */
       
    68 const TInt KErrEtelAlreadyCallOwner=KErrEtelCoreBase-2;
       
    69 /** A connection has been terminated because the carrier has been lost. */
       
    70 const TInt KErrEtelNoCarrier=KErrEtelCoreBase-3;
       
    71 /** An attempt to establish a connection with the RCall::Dial() function has failed 
       
    72 because the remote party's line was busy. */
       
    73 const TInt KErrEtelBusyDetected=KErrEtelCoreBase-4;
       
    74 /** An attempt has been made to transfer call ownership, but no other clients are 
       
    75 interested in acquiring ownership. */
       
    76 const TInt KErrEtelNoClientInterestedInThisCall=KErrEtelCoreBase-5;
       
    77 /** The TSY has failed to initialise the modem. This may be occur if the modem 
       
    78 is disconnected during initialisation, or if an attempt is made to initialise 
       
    79 an unsupported modem. */
       
    80 const TInt KErrEtelInitialisationFailure=KErrEtelCoreBase-6;
       
    81 /** An attempt has been made to perform an operation which requires the call to 
       
    82 be connected - when the call is not connected. E.g. RCall:LoanDataPort(). */
       
    83 const TInt KErrEtelCallNotActive=KErrEtelCoreBase-7;
       
    84 /** A connection request has failed because there is no answer. */
       
    85 const TInt KErrEtelNoAnswer=KErrEtelCoreBase-8;
       
    86 /** A connection request has failed because there is no dial tone. For example, 
       
    87 if there is no connection between the modem and the network. */
       
    88 const TInt KErrEtelNoDialTone=KErrEtelCoreBase-9;
       
    89 /** An attempt to configure the port has failed because the hardware cannot match 
       
    90 the desired configuration. For example, if an attempt is made to configure 
       
    91 the comms port to a baud rate it cannot support. */
       
    92 const TInt KErrEtelConfigPortFailure=KErrEtelCoreBase-10;
       
    93 /** Out of memory error - global chunk cannot be created. */
       
    94 const TInt KErrEtelFaxChunkNotCreated=KErrEtelCoreBase-11;
       
    95 /** The client is not the fax owner and has attempted to perform an operation that 
       
    96 requires fax ownership.
       
    97 
       
    98 The fax client should be used to access fax functionality. Consequently, client 
       
    99 code should not return this error. */
       
   100 const TInt KErrEtelNotFaxOwner=KErrEtelCoreBase-12;
       
   101 /** An attempt has been made to perform an operation which requires port ownership. 
       
   102 However, the client does not own the port. */
       
   103 const TInt KErrEtelPortNotLoanedToClient=KErrEtelCoreBase-13;
       
   104 /** An operation has failed because the modem has been incorrectly configured. */
       
   105 const TInt KErrEtelWrongModemType=KErrEtelCoreBase-14;
       
   106 /** An operation has failed because the modem does not understand the request - 
       
   107 possible bug in modem. */
       
   108 const TInt KErrEtelUnknownModemCapability=KErrEtelCoreBase-15;
       
   109 /** The call has already placed an 'answer incoming call' request. Only 1 request 
       
   110 of a type (e.g. fax, voice, data) can be outstanding on the server at a time. */
       
   111 const TInt KErrEtelAnswerAlreadyOutstanding=KErrEtelCoreBase-16;
       
   112 /** An attempt to establish a connection with the modem has failed because the 
       
   113 modem cannot be detected. */
       
   114 const TInt KErrEtelModemNotDetected=KErrEtelCoreBase-17;
       
   115 /** Operation failed because the modem settings are corrupt. */
       
   116 const TInt KErrEtelModemSettingsCorrupt=KErrEtelCoreBase-18;
       
   117 /** The Data port is in use by another call or application. */
       
   118 const TInt KErrEtelPortAlreadyLoaned=KErrEtelCoreBase-19;
       
   119 /** Another call active. Close it before opening a new one. */
       
   120 const TInt KErrEtelCallAlreadyActive=KErrEtelCoreBase-20;
       
   121 
       
   122 //
       
   123 //
       
   124 // RTelSubSessionBase
       
   125 //
       
   126 //
       
   127 class CPtrHolder;
       
   128 class RFile;
       
   129 /**
       
   130 A base class used in the derivation of RCall, RLine, and RPhone. It has no user
       
   131 accessible functions. 
       
   132 
       
   133 @publishedPartner
       
   134 @released
       
   135 */
       
   136 class RTelSubSessionBase : public RSubSessionBase
       
   137 	{
       
   138 public:
       
   139 	inline RSessionBase& SessionHandle() const;
       
   140 	inline void SetSessionHandle(RSessionBase& aSession);
       
   141 	inline void ResetSessionHandle();
       
   142 	inline TInt SubSessionHandle();
       
   143 
       
   144 	IMPORT_C void CancelAsyncRequest(TInt aReqToCancel) const;
       
   145 
       
   146 	enum TReqPriorityType
       
   147 		{
       
   148 		EIsNotaPriorityRequest,
       
   149 		EIsaPriorityRequest,
       
   150 		EIsaEmergencyRequest
       
   151 		};
       
   152 	
       
   153 protected:
       
   154 
       
   155 	IMPORT_C RTelSubSessionBase();
       
   156 	IMPORT_C TInt Blank(const TInt aIpc,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   157 	IMPORT_C void Blank(const TInt aIpc,TRequestStatus& aStatus,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   158 
       
   159 	IMPORT_C TInt Set(const TInt aIpc,const TDesC8& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   160 	IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC8& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   161 	IMPORT_C TInt Get(const TInt aIpc,TDes8& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   162 	IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes8& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   163 
       
   164 	IMPORT_C TInt Set(const TInt aIpc,const TDesC8& aDes1,const TDesC8& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   165 	IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC8& aDes1,const TDesC8& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   166 	IMPORT_C TInt Get(const TInt aIpc,TDes8& aDes1,TDes8& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   167 	IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes8& aDes1,TDes8& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   168 	
       
   169 	IMPORT_C TInt Set(const TInt aIpc,const TDesC16& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   170 	IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC16& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   171 	IMPORT_C TInt Get(const TInt aIpc,TDes16& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   172 	IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes16& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   173 
       
   174 	IMPORT_C TInt Set(const TInt aIpc,const TDesC16& aDes1,const TDesC16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   175 	IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC16& aDes1,const TDesC16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   176 	IMPORT_C TInt Set(const TInt aIpc,const TDesC8& aDes1,const TDesC16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   177 	IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC8& aDes1,const TDesC16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   178 
       
   179 	IMPORT_C TInt Get(const TInt aIpc,TDes16& aDes1,TDes16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   180 	IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes16& aDes1,TDes16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   181 	IMPORT_C TInt Get(const TInt aIpc,TDes8& aDes1,TDes16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   182 	IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes8& aDes1,TDes16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   183 
       
   184 	IMPORT_C void SetAndGet(const TInt aIpc, TRequestStatus& aStatus, const TDesC8& aDes1, TDes8& aDes2, TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   185 	IMPORT_C void SetAndGet(const TInt aIpc, TRequestStatus& aStatus, TDes8& aDes1, const TDesC16& aDes2, TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   186 	IMPORT_C void SetAndGet(const TInt aIpc, TRequestStatus& aStatus, const TDesC8&, TDes16& aDes2, TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   187 	IMPORT_C void SetAndGet(const TInt aIpc, TRequestStatus& aStatus, const TDesC16& aDes1, TDes16& aDes2, TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   188 
       
   189 	IMPORT_C TInt Set(const TInt aIpc, const RFile& aFile, TReqPriorityType aType = EIsNotaPriorityRequest) const;
       
   190 
       
   191 	IMPORT_C TInt CancelReq(const TInt aIpc,const TInt aIpcToCancel) const;
       
   192 	IMPORT_C TInt CancelSubSession() const;
       
   193 
       
   194 private:
       
   195 	RTelSubSessionBase(const RTelSubSessionBase& aTelSubSessionBase);
       
   196 	RSessionBase* iTelSession;
       
   197 protected:	
       
   198 	CPtrHolder* iPtrHolder;
       
   199 	};
       
   200 
       
   201 //
       
   202 //
       
   203 // RFax
       
   204 //
       
   205 //
       
   206 class RCall;
       
   207 /**
       
   208 ETel fax subsession.
       
   209 
       
   210 Contains the fax client progress information structure.
       
   211 
       
   212 ETel does include server-side RFax objects, however the 
       
   213 associated APIs are intended solely for use by ETel's own 
       
   214 fax client. Consequently, only the TProgress structure is 
       
   215 considered part of the public API.
       
   216 
       
   217 @publishedPartner
       
   218 @released
       
   219 */
       
   220 class RFax : public RTelSubSessionBase
       
   221 	{
       
   222 public:
       
   223 	IMPORT_C RFax();
       
   224 	IMPORT_C TInt Open(RCall& aCall);
       
   225 	IMPORT_C void Close();
       
   226 
       
   227 //
       
   228 // Read,Write and Wait for Page End
       
   229 //
       
   230 	IMPORT_C void Read(TRequestStatus& aStatus,TDes8& aDes);
       
   231 	IMPORT_C void Write(TRequestStatus& aStatus,const TDesC8& aDes);
       
   232 	IMPORT_C void WaitForEndOfPage(TRequestStatus& aStatus) const;
       
   233 	IMPORT_C TInt TerminateFaxSession() const;
       
   234 //
       
   235 // Progress Information
       
   236 //
       
   237 	struct TProgress
       
   238 	/** Contains fax progress information.*/
       
   239 		{
       
   240 		/** Time of last progress update.*/
       
   241 		TTime iLastUpdateTime;
       
   242 		/** ID of remote fax - filled in after connection.*/
       
   243 		TBuf<20> iAnswerback;
       
   244 
       
   245 		/** Phase of session.*/
       
   246 		TFaxPhase iPhase;
       
   247 		/** Resolution of document.*/
       
   248 		TFaxResolution iResolution;
       
   249 		/** Compression method in use.*/
       
   250 		TFaxCompression iCompression;
       
   251 		/** Error correction mode. Reserved for future releases.*/
       
   252 		TInt iECM;
       
   253 		
       
   254 		/** Last or current page being transferred.*/
       
   255 		TInt iPage;
       
   256 		/** Last or current line on page.*/
       
   257 		TInt iLines;
       
   258 		/** Speed of fax session.*/
       
   259 		TInt iSpeed;
       
   260 		};
       
   261 
       
   262 	IMPORT_C TInt GetProgress(TProgress& aProgress);
       
   263 private:
       
   264 	TProgress* iProgressPtr;
       
   265 	RChunk iChunk;
       
   266 protected:
       
   267 	IMPORT_C virtual void ConstructL();
       
   268 	IMPORT_C virtual void Destruct();
       
   269 	};
       
   270 
       
   271 //
       
   272 //
       
   273 // RCall
       
   274 //
       
   275 //
       
   276 class RTelServer;
       
   277 class RPhone;
       
   278 class RLine;
       
   279 /**
       
   280 Call sub-session.
       
   281 
       
   282 Provides access to the functionality associated with a specific call.
       
   283 
       
   284 This class is not intended for user derivation. 
       
   285 
       
   286 @publishedPartner
       
   287 @released
       
   288 */
       
   289 class RCall : public RTelSubSessionBase
       
   290 	{
       
   291 public:
       
   292 	IMPORT_C RCall();
       
   293 	IMPORT_C TInt OpenNewCall(RTelServer& aServer,const TDesC& aName,TDes& aNewName);
       
   294 	IMPORT_C TInt OpenNewCall(RTelServer& aServer,const TDesC& aName);
       
   295 	IMPORT_C TInt OpenNewCall(RPhone& aPhone,const TDesC& aName,TDes& aNewName);
       
   296 	IMPORT_C TInt OpenNewCall(RPhone& aPhone,const TDesC& aName);
       
   297 	IMPORT_C TInt OpenNewCall(RLine& aLine,TDes& aNewName);
       
   298 	IMPORT_C TInt OpenNewCall(RLine& aLine);
       
   299 	IMPORT_C TInt OpenExistingCall(RTelServer& aServer,const TDesC& aName);
       
   300 	IMPORT_C TInt OpenExistingCall(RPhone& aPhone,const TDesC& aName);
       
   301 	IMPORT_C TInt OpenExistingCall(RLine& aLine,const TDesC& aName);
       
   302 	IMPORT_C void Close();
       
   303 
       
   304 //
       
   305 // Call Status
       
   306 //
       
   307 /** Call status flags. */
       
   308 	enum TStatus
       
   309 		{
       
   310 	/** The call status is not known. */
       
   311 		EStatusUnknown,
       
   312 	/** The call is idle. */
       
   313 		EStatusIdle,
       
   314 	/** The call is dialling. */
       
   315 		EStatusDialling,
       
   316 	/** The call is ringing (an incoming, unanswered call). */
       
   317 		EStatusRinging,
       
   318 	/** The call is being answered. */
       
   319 		EStatusAnswering,
       
   320 	/** The call is connecting (immediate call establishment, without dialling). */
       
   321 		EStatusConnecting,
       
   322 	/** The call is connected and active. */
       
   323 		EStatusConnected,
       
   324 	/** The call is being terminated. */
       
   325 		EStatusHangingUp
       
   326 		};
       
   327 
       
   328 	IMPORT_C TInt GetStatus(TStatus& aStatus) const;
       
   329 
       
   330 //
       
   331 // Call Caps
       
   332 //
       
   333 /** Call capability flags. */
       
   334 	enum TCapsEnum
       
   335 		{
       
   336 	/** The call supports data calls. */
       
   337 		KCapsData=0x00000001,
       
   338 	/** The call supports fax calls. */
       
   339 		KCapsFax=0x00000002,
       
   340 	/** The call supports voice calls. */
       
   341 		KCapsVoice=0x00000004,
       
   342 	/** The Dial request is currently a valid action. */
       
   343 		KCapsDial=0x00000008,
       
   344 	/** The Connect request is currently a valid action. */
       
   345 		KCapsConnect=0x00000010,
       
   346 	/** The Hang Up request is currently a valid action. */
       
   347 		KCapsHangUp=0x00000020,
       
   348 	/** The Answer request is currently a valid action. */
       
   349 		KCapsAnswer=0x00000040,
       
   350 	/** The Loan Data Port request is currently a valid action. */
       
   351 		KCapsLoanDataPort=0x00000080,
       
   352 	/** The Recover Data Port request is currently a valid action. */
       
   353 		KCapsRecoverDataPort=0x00000100
       
   354 		};
       
   355 
       
   356 	struct TCaps
       
   357 /** Call capability information. */
       
   358 		{
       
   359 	/** Call capability flag. Contains a bitmask of values defined in the TCapsEnum 
       
   360 	enumeration.*/
       
   361 		TUint iFlags;
       
   362 		};
       
   363 
       
   364 	IMPORT_C TInt GetCaps(TCaps& aCaps) const;
       
   365 	IMPORT_C void NotifyCapsChange(TRequestStatus& aStatus, TCaps& aCaps);
       
   366 	IMPORT_C void NotifyCapsChangeCancel() const;
       
   367 
       
   368 //
       
   369 // Bearer Service Information
       
   370 //
       
   371 /** Bearer capability flags. */
       
   372 	enum TBearerCaps
       
   373 		{
       
   374 	/** V42bis modem compression protocol. */
       
   375 		KBearerCapsCompressionV42bis=0x00000001,
       
   376 	/** MNP5 modem compression protocol. */
       
   377 		KBearerCapsCompressionMNP5=0x00000002,
       
   378 	/** No compression supported. */
       
   379 		KBearerCapsCompressionNone=0x00000004,
       
   380 	/** LAPM error correction protocol. */
       
   381 		KBearerCapsProtocolLAPM=0x00000008,
       
   382 	/** MNP10 mode. */
       
   383 		KBearerCapsProtocolALT_CELLULAR=0x00000010,
       
   384 	/** MNP error correction. */
       
   385 		KBearerCapsProtocolALT=0x00000020,
       
   386 	/** No protocol information provided. */
       
   387 		KBearerCapsProtocolNone=0x00000040,
       
   388 	/** Compression protocol unknown. */
       
   389 		KBearerCapsCompressionUnknown=0x00000080,
       
   390 	/** Unable to establish protocol. */
       
   391 		KBearerCapsProtocolUnknown=0x00000100
       
   392 		};
       
   393 
       
   394 /** Bearer speed flags. */
       
   395 	enum TCallBearerSpeed
       
   396 		{
       
   397 	/** Transfer rate of 57600 bps. */
       
   398 		EBearerData57600,
       
   399 	/** Transfer rate of 33600 bps. */
       
   400 		EBearerData33600,
       
   401 	/** Transfer rate of 31200 bps. */
       
   402 		EBearerData31200,
       
   403 	/** Transfer rate of 9200 bps. */
       
   404 		EBearerData19200,
       
   405 	/** Transfer rate of 4400 bps. */
       
   406 		EBearerData14400,
       
   407 	/** Transfer rate of 12000 bps. */
       
   408 		EBearerData12000,
       
   409 	/** Transfer rate of 9600 bps. */
       
   410 		EBearerData9600,
       
   411 	/** Transfer rate of 7200 bps. */
       
   412 		EBearerData7200,
       
   413 	/** Transfer rate of 4800 bps. */
       
   414 		EBearerData4800,
       
   415 	/** Transfer rate of 2400 bps. */
       
   416 		EBearerData2400,
       
   417 	/** Transfer rate of 200 bps. */
       
   418 		EBearerData1200,
       
   419 	/** V.23 75 bps forward, 1200 bps back */
       
   420 		EBearerData75_1200,
       
   421 	/** V.23 1200 bps forward, 75 bps back */
       
   422 		EBearerData1200_75,
       
   423 	/** Transfer rate of 300 bps. */
       
   424 		EBearerData300,
       
   425 	/** Transfer rate is unknown. */
       
   426 		EBearerDataUnknown
       
   427 		};
       
   428 
       
   429 	struct TBearerService
       
   430 /** Call bearer information.
       
   431 
       
   432 @see TCallBearerSpeed */
       
   433 		{
       
   434 	/** The bearer capabilities. */
       
   435 		TUint32 iBearerCaps;
       
   436 	/** The bearer's speed.
       
   437 	
       
   438 	@see TCallBearerSpeed */
       
   439 		TCallBearerSpeed iBearerSpeed;
       
   440 		};
       
   441 
       
   442  	IMPORT_C TInt GetBearerServiceInfo(TBearerService& aBearerService) const;
       
   443 
       
   444 //
       
   445 // Notifications
       
   446 //
       
   447 /** Hook status flags. */
       
   448 	enum THookStatus
       
   449 		{
       
   450 	/** The line is currently off hook. */
       
   451 		EHookStatusOff,
       
   452 	/** The line is currently on hook. */
       
   453 		EHookStatusOn,
       
   454 	/** The status of the line's hook is currently unknown */
       
   455 		EHookStatusUnknown
       
   456 		};
       
   457 
       
   458 	class TCallInfo
       
   459 /** Line call capability information.
       
   460 
       
   461 @see TName 
       
   462 @publishedAll
       
   463 @released
       
   464 */
       
   465 		{
       
   466 	public:
       
   467 		IMPORT_C TCallInfo();
       
   468 	/** The name of a call.
       
   469 	
       
   470 	@see TName */
       
   471 		TName iCallName;
       
   472 		TName iLineName;
       
   473 		THookStatus iHookStatus;
       
   474 	/** The call status.
       
   475 	
       
   476 	@see RCall::TStatus */
       
   477 		TStatus iStatus;
       
   478 		TTimeIntervalSeconds iDuration;
       
   479 		};
       
   480 	
       
   481 	IMPORT_C TInt GetInfo(TCallInfo& aCallInfo) const;
       
   482 	IMPORT_C void NotifyHookChange(TRequestStatus& aStatus,THookStatus& aHookStatus);
       
   483 	IMPORT_C void NotifyHookChangeCancel() const;
       
   484 	IMPORT_C void NotifyStatusChange(TRequestStatus& aStatus,TStatus& aCallStatus);
       
   485 	IMPORT_C void NotifyStatusChangeCancel() const;
       
   486 	IMPORT_C void NotifyCallDurationChange(TRequestStatus& aStatus,TTimeIntervalSeconds& aTime);
       
   487 	IMPORT_C void NotifyCallDurationChangeCancel() const;
       
   488 
       
   489 //
       
   490 // Duration of call
       
   491 //
       
   492 	IMPORT_C TInt GetCallDuration(TTimeIntervalSeconds& aTime) const;
       
   493 //
       
   494 // Connecting and Disconnecting
       
   495 //
       
   496 /** Passes telephone numbers into Dial functions. */
       
   497 	typedef TDesC TTelNumberC;
       
   498 	IMPORT_C TInt Dial(const TTelNumberC& aTelNumber) const;
       
   499 	IMPORT_C TInt Dial(const TDesC8& aCallParams,const TTelNumberC& aTelNumber) const;
       
   500 	IMPORT_C void Dial(TRequestStatus& aStatus,const TTelNumberC& aTelNumber);
       
   501 	IMPORT_C void Dial(TRequestStatus& aStatus,const TDesC8& aCallParams,const TTelNumberC& aTelNumber);
       
   502 	IMPORT_C void DialCancel() const;
       
   503 	IMPORT_C TInt Connect() const;
       
   504 	IMPORT_C TInt Connect(const TDesC8& aCallParams) const;
       
   505 	IMPORT_C void Connect(TRequestStatus& aStatus);
       
   506 	IMPORT_C void Connect(TRequestStatus& aStatus,const TDesC8& aCallParams);
       
   507 	IMPORT_C void ConnectCancel() const;
       
   508 	IMPORT_C TInt AnswerIncomingCall() const;
       
   509 	IMPORT_C TInt AnswerIncomingCall(const TDesC8& aCallParams) const;
       
   510 	IMPORT_C void AnswerIncomingCall(TRequestStatus& aStatus);
       
   511 	IMPORT_C void AnswerIncomingCall(TRequestStatus& aStatus,const TDesC8& aCallParams);
       
   512 	IMPORT_C void AnswerIncomingCallCancel() const;
       
   513 	IMPORT_C TInt HangUp() const;
       
   514 	IMPORT_C void HangUp(TRequestStatus& aStatus) const;
       
   515 	IMPORT_C void HangUpCancel() const;
       
   516 
       
   517 //
       
   518 // Call Data Access
       
   519 //
       
   520 	struct  TCommPort
       
   521 /** Communications port information.
       
   522 
       
   523 @see TFileName */
       
   524 		{
       
   525 	/** The CSY module used by the C32 Communications Server to talk to the serial 
       
   526 	device.
       
   527 	@deprecated This has been deprecated as all the information that is needed by the 
       
   528 	lower layers is now being passed in iPort. 
       
   529 	
       
   530 	@see TFileName */
       
   531 		TFileName iCsy;
       
   532 	/** The port used by the C32 Communications Server to talk to the serial device.
       
   533 	It holds both the Csy name and the Port name.
       
   534 	
       
   535 	@see TName */
       
   536 		TName iPort;
       
   537 		};
       
   538 
       
   539 	IMPORT_C TInt LoanDataPort(TCommPort& aDataPort) const;
       
   540 	IMPORT_C void LoanDataPort(TRequestStatus& aStatus,TCommPort& aDataPort);
       
   541 	IMPORT_C void LoanDataPortCancel() const;
       
   542 	IMPORT_C TInt RecoverDataPort() const;
       
   543 
       
   544 //
       
   545 // Call Ownership manipulation
       
   546 //
       
   547 /** Call ownership status flags. */
       
   548 	enum TOwnershipStatus
       
   549 		{
       
   550 	/** The call is not owned. */
       
   551 		EOwnershipUnowned,
       
   552 	/** The call is owned, but not by this RCall instance. */
       
   553 		EOwnershipOwnedByAnotherClient,		// not the priority client
       
   554 	/** The call is owned by this RCall instance. */
       
   555 		EOwnershipOwnedByThisClient,
       
   556 	/** The call is owned, but not by the priority client */
       
   557 		EOwnershipThisIsPriorityClient		// not owned by this (the priority) client
       
   558 		};
       
   559 
       
   560 	IMPORT_C TInt TransferOwnership() const;
       
   561 	IMPORT_C void AcquireOwnership(TRequestStatus& aStatus) const;
       
   562 	IMPORT_C void AcquireOwnershipCancel() const;
       
   563 	IMPORT_C TInt GetOwnershipStatus(TOwnershipStatus& aOwnershipStatus) const;
       
   564 	//
       
   565 //
       
   566 // Get and Set Call Parameters
       
   567 //
       
   568 /** Monitor speaker control setting flags. */
       
   569 	enum TMonitorSpeakerControl
       
   570 		{
       
   571 	/** Speaker control is always off */
       
   572 		EMonitorSpeakerControlAlwaysOff,
       
   573 	/** Speaker control is on until the carrier is detected */
       
   574 		EMonitorSpeakerControlOnUntilCarrier,
       
   575 	/** Speaker control is always active. */
       
   576 		EMonitorSpeakerControlAlwaysOn,
       
   577 	/** Speaker control is on, except while dialling */
       
   578 		EMonitorSpeakerControlOnExceptDuringDialling,
       
   579 	/** Speaker control is unknown. */
       
   580 		EMonitorSpeakerControlUnknown
       
   581 		};
       
   582 
       
   583 /** Monitor speaker volume control setting flags. */
       
   584 	enum TMonitorSpeakerVolume
       
   585 		{
       
   586 	/** Speaker volume is off. */
       
   587 		EMonitorSpeakerVolumeOff,
       
   588 	/** Speaker volume is low. */
       
   589 		EMonitorSpeakerVolumeLow,
       
   590 	/** Speaker volume is medium. */
       
   591 		EMonitorSpeakerVolumeMedium,
       
   592 	/** Speaker volume is high. */
       
   593 		EMonitorSpeakerVolumeHigh,
       
   594 	/** Speaker volume is unknown. */
       
   595 		EMonitorSpeakerVolumeUnknown
       
   596 		};
       
   597 
       
   598 /** Wait for dial tone flags. */
       
   599 	enum TWaitForDialTone
       
   600 		{
       
   601 	/** Waiting for dial tone. */
       
   602 		EDialToneWait,
       
   603 	/** Not waiting for dial tone. */
       
   604 		EDialToneNoWait
       
   605 		};
       
   606 
       
   607 	class TCallParams
       
   608 	/**
       
   609 	@publishedAll
       
   610 	@released
       
   611 	*/
       
   612 		{
       
   613 	public:
       
   614 		IMPORT_C TCallParams();
       
   615 		IMPORT_C TCallParams(TMonitorSpeakerControl aSpeakerControl,
       
   616 							 TMonitorSpeakerVolume aSpeakerVolume,
       
   617 							 TUint aInterval,
       
   618 							 TWaitForDialTone aWaitForDialTone);
       
   619 		IMPORT_C TInt ExtensionId();
       
   620 		IMPORT_C TBool IsDefault();
       
   621 		TMonitorSpeakerControl iSpeakerControl;
       
   622 		TMonitorSpeakerVolume iSpeakerVolume;
       
   623 		TUint iInterval;
       
   624 		TWaitForDialTone iWaitForDialTone;
       
   625 	protected:
       
   626 		TBool iIsDefault;
       
   627 		TInt iExtensionId;
       
   628 		};
       
   629 
       
   630 /** Call parameters package
       
   631 
       
   632 The call parameters to be associated with a call may be passed into functions 
       
   633 using this type.
       
   634 
       
   635 @see TCallParams */
       
   636 	typedef TPckg<TCallParams> TCallParamsPckg;
       
   637 
       
   638 	IMPORT_C TInt GetCallParams(TDes8& aParams) const;
       
   639 
       
   640 //
       
   641 // Fax Settings
       
   642 //
       
   643 /** Fax mode flags. */
       
   644 	enum TFaxMode
       
   645 		{
       
   646 	/** Fax is transmitting */
       
   647 		ETransmit,
       
   648 	/** Fax is receiving. */
       
   649 		EReceive
       
   650 		};
       
   651 
       
   652 /** Fax retrieval type flags. */
       
   653 	enum TFaxRetrieveType
       
   654 		{
       
   655 	/** Retrieving a fax opened from voice call (not currently supported by GSM networks). */
       
   656 		EFaxOnDemand,
       
   657 	/** Retrieve a fax opened from fax call. */
       
   658 		EFaxPoll
       
   659 		};
       
   660 
       
   661 /** Fax identifier size flags. */
       
   662 	enum TConstants
       
   663 		{
       
   664 	/** 20 */
       
   665 		KFaxIdUserNameMaxSize=20
       
   666 		};
       
   667 
       
   668 	struct TFaxSessionSettings
       
   669 /** Fax session settings information.
       
   670 
       
   671 @see TFaxMode */
       
   672 		{
       
   673 	/** The fax mode.
       
   674 	
       
   675 	@see TFaxMode */
       
   676 		TFaxMode iMode;
       
   677 	/** The mode of retrieving faxes.
       
   678 	
       
   679 	@see TFaxRetrieveType */
       
   680 		TFaxRetrieveType iFaxRetrieveType;
       
   681 	/** The class of fax 
       
   682 	
       
   683 	@see TFaxClass */
       
   684 		TFaxClass iFaxClass;
       
   685 	/** The fax identifier string displayed at the top of the fax.
       
   686 	
       
   687 	@see KFaxIdUserNameMaxSize */
       
   688 		TBuf<KFaxIdUserNameMaxSize> iFaxId;
       
   689 	/** The maximum transfer speed that can be negotiated. */
       
   690 		TInt iMaxSpeed;
       
   691 	/** The minimum transfer speed that should be negotiated. */
       
   692 		TInt iMinSpeed;
       
   693 	/** The preferred compression mode used for negotiation. This may take one of the 
       
   694 	following values: EModifiedHuffman, EModifiedRead, EUncompressedModifiedRead, 
       
   695 	EModifiedModifiedRead. */
       
   696 		TInt iPreferredECM;
       
   697 	/** The delay used for Fax on Demand services. Measured in seconds. */
       
   698 		TInt iFaxOnDemandDelay;
       
   699 		// Tx Settings
       
   700 	/** The preferred transmit resolution. This may take one of the following values: 
       
   701 	EFaxNormal EFaxFine
       
   702 	
       
   703 	@see TFaxResolution */
       
   704 		TFaxResolution iTxResolution;
       
   705 	/** Compression mode for transmitting faxes.
       
   706 	
       
   707 	@see TFaxCompression */
       
   708 		TFaxCompression iTxCompression;
       
   709 	/** The number of pages to be transmitted. */
       
   710 		TInt iTxPages;
       
   711 		// Rx Settings
       
   712 	/** The preferred receive resolution. This may take one of the following values: 
       
   713 	EFaxNormal EFaxFine.
       
   714 	
       
   715 	@see TFaxResolution */
       
   716 		TFaxResolution iRxResolution;
       
   717 	/** Compression mode for receiving faxes.
       
   718 	
       
   719 	@see TFaxCompression */
       
   720 		TFaxCompression iRxCompression;
       
   721 		};
       
   722 
       
   723 	IMPORT_C TInt GetFaxSettings(TFaxSessionSettings& aSettings) const;
       
   724 	IMPORT_C TInt SetFaxSettings(const TFaxSessionSettings& aSettings) const;
       
   725 	IMPORT_C TInt AdoptFaxSharedHeaderFile(const RFile& aSharedFile) const;
       
   726 //
       
   727 // Retrieval of call objects' reference count
       
   728 //
       
   729  	IMPORT_C TInt ReferenceCount() const;
       
   730 
       
   731 protected:
       
   732 	IMPORT_C virtual void ConstructL();
       
   733 	IMPORT_C virtual void Destruct();
       
   734 	};
       
   735 
       
   736 //
       
   737 //
       
   738 // RLine
       
   739 //
       
   740 //
       
   741 class RPhone;
       
   742 /**
       
   743 Provides access to the functionality associated with a specific line.
       
   744 
       
   745 This class is not intended for user derivation. 
       
   746 
       
   747 @publishedPartner
       
   748 @released
       
   749 */
       
   750 class RLine : public RTelSubSessionBase
       
   751 	{
       
   752 public:
       
   753 	IMPORT_C RLine();
       
   754 	IMPORT_C TInt Open(RPhone& aPhone,const TDesC& aName);
       
   755 	IMPORT_C TInt Open(RTelServer& aServer,const TDesC& aName);
       
   756 	IMPORT_C void Close();
       
   757 
       
   758 //
       
   759 // Caps
       
   760 //
       
   761 /** Line capability flags. */
       
   762 	enum TCapsFlags
       
   763 		{
       
   764 	/** The line supports data connections.*/
       
   765 		KCapsData=0x00000001,
       
   766 	/** The line supports fax connections. */
       
   767 		KCapsFax=0x00000002,
       
   768 	/** The line supports voice connections.*/
       
   769 		KCapsVoice=0x00000004,
       
   770 	/** The line supports incoming call notification requests. */
       
   771 		KCapsEventIncomingCall=0x00010000,
       
   772 		};
       
   773 
       
   774 	struct TCaps
       
   775 /** Line capability information. */
       
   776 		{
       
   777 	/** Line capability flag. Contains a bitmask of the values defined in the TCapsFlags 
       
   778 	enumeration.*/
       
   779 		TUint iFlags;
       
   780 		};
       
   781 
       
   782 	IMPORT_C TInt GetCaps(TCaps& aCaps) const;
       
   783 	IMPORT_C void NotifyCapsChange(TRequestStatus& aStatus, TCaps& aCaps);
       
   784 	IMPORT_C void NotifyCapsChangeCancel() const;
       
   785 
       
   786 //
       
   787 // Line and Hook Status
       
   788 //
       
   789 	IMPORT_C TInt GetStatus(RCall::TStatus& aStatus) const;
       
   790 	IMPORT_C TInt GetHookStatus(RCall::THookStatus& aHookStatus) const;
       
   791 
       
   792 //
       
   793 // Call enumeration and Information
       
   794 //
       
   795 	struct TCallInfo
       
   796 /** Line call capability information.
       
   797 
       
   798 @see TName */
       
   799 		{
       
   800 	/** The name of a call.
       
   801 	
       
   802 	@see TName */
       
   803 		TName iCallName;
       
   804 	/** The call status.
       
   805 	
       
   806 	@see RCall::TStatus */
       
   807 		RCall::TStatus iStatus;
       
   808 	/** The call capabilities flag. 
       
   809 	
       
   810 	@see RCall::TCapsEnum*/
       
   811 		TUint32 iCallCapsFlags;
       
   812 		};
       
   813 
       
   814 	IMPORT_C TInt EnumerateCall(TInt& aCount) const;
       
   815 	IMPORT_C TInt GetCallInfo(TInt aIndex,TCallInfo& aCallInfo) const;
       
   816 //
       
   817 //	General line notification information
       
   818 //
       
   819 	class TLineInfo
       
   820 /** Line information.
       
   821 
       
   822 @see RCall::TStatus 
       
   823 @publishedAll
       
   824 @released
       
   825 */
       
   826 		{
       
   827 	public:
       
   828 		IMPORT_C TLineInfo();
       
   829 		RCall::THookStatus iHookStatus;
       
   830 	/** The current line status.
       
   831 	
       
   832 	@see RCall::TStatus */
       
   833 		RCall::TStatus iStatus;
       
   834 		TName iNameOfLastCallAdded;
       
   835 		TName iNameOfCallForAnswering;	// if an incoming call occurs, this contains the name
       
   836 										// of the call to answer it on.
       
   837 		};
       
   838 	
       
   839 //
       
   840 // Notifications
       
   841 //
       
   842 	IMPORT_C TInt GetInfo(TLineInfo& aLineInfo) const;
       
   843 	IMPORT_C void NotifyIncomingCall(TRequestStatus& aStatus, TName& aName);
       
   844 	IMPORT_C void NotifyIncomingCallCancel() const;
       
   845 	IMPORT_C void NotifyHookChange(TRequestStatus& aStatus,RCall::THookStatus& aHookStatus);
       
   846 	IMPORT_C void NotifyHookChangeCancel() const;
       
   847 	IMPORT_C void NotifyStatusChange(TRequestStatus& aStatus,RCall::TStatus& aLineStatus);
       
   848 	IMPORT_C void NotifyStatusChangeCancel() const;
       
   849 	IMPORT_C void NotifyCallAdded(TRequestStatus& aStatus,TName& aName);
       
   850 	IMPORT_C void NotifyCallAddedCancel() const;
       
   851 protected:
       
   852 	IMPORT_C virtual void ConstructL();
       
   853 	IMPORT_C virtual void Destruct();
       
   854 	};
       
   855 
       
   856 //
       
   857 //
       
   858 // RPhone
       
   859 //
       
   860 //
       
   861 class RTelServer;
       
   862 /**
       
   863 Phone sub-session.
       
   864 
       
   865 Provides access to the functionality associated with a specific phone.
       
   866 
       
   867 This class is not intended for user derivation.
       
   868 
       
   869 @publishedPartner
       
   870 @released
       
   871 */
       
   872 class RPhone : public RTelSubSessionBase
       
   873 	{
       
   874 public:
       
   875 	IMPORT_C RPhone();
       
   876 	IMPORT_C TInt Open(RTelServer& aSession,const TDesC& aName);
       
   877 	IMPORT_C void Close();
       
   878 
       
   879 //
       
   880 // Initialisation
       
   881 //
       
   882 	IMPORT_C TInt Initialise();
       
   883 	IMPORT_C void Initialise(TRequestStatus& aStatus);
       
   884 	IMPORT_C void InitialiseCancel();
       
   885 
       
   886 //
       
   887 // Caps
       
   888 //
       
   889 /** Phone capability flags. */
       
   890 	enum TCapsFlags
       
   891 		{
       
   892 	/** The capabilities of the phone are not known. */
       
   893 		KCapsUnknown=0x00000001,
       
   894 	/** The phone supports data calls. */
       
   895 		KCapsData=0x00000002,
       
   896 	/** The phone supports the fax class 1 interface. */
       
   897 		KCapsFaxClassOne=0x0000004,
       
   898 	/** The phone supports the fax class 1.0 interface. */
       
   899 		KCapsFaxClassOnePointZero=0x0000008,
       
   900 	/** The phone supports the fax class 2 interface. */
       
   901 		KCapsFaxClassTwo=0x00000010,
       
   902 	/** The phone supports the fax class 2.0 interface. */
       
   903 		KCapsFaxClassTwoPointZero=0x00000020,
       
   904 	/** The phone supports the fax class 2.1 interface. */
       
   905 		KCapsFaxClassTwoPointOne=0x00000040,
       
   906 	/** The phone supports voice calls. */
       
   907 		KCapsVoice=0x00000080,
       
   908 	/** The phone supports modem detection events, i.e. it can notify clients when 
       
   909 	the modem can be or can no longer be detected. */
       
   910 		KCapsEventModemDetection=0x00010000,
       
   911 	/** The phone supports the ability to take the communications port from whatever 
       
   912 	component is currently using it. */
       
   913 		KCapsStealCommPort=0x00020000
       
   914 		};
       
   915 
       
   916 	struct TCaps
       
   917 /** Phone capability information. */
       
   918 		{
       
   919 	/** Phone capability flag. Contains bitmask of values defined in the TCapsFlags 
       
   920 	enumeration. */
       
   921 		TUint iFlags;
       
   922 		};
       
   923 
       
   924 	IMPORT_C TInt GetCaps(TCaps& aCaps) const;
       
   925 	IMPORT_C void NotifyCapsChange(TRequestStatus& aStatus, TCaps& aCaps);
       
   926 	IMPORT_C void NotifyCapsChangeCancel() const;
       
   927 
       
   928 //
       
   929 // Status
       
   930 //
       
   931 /** Phone mode status flags. */
       
   932 	enum TMode
       
   933 		{
       
   934 	/** Phone (modem) status unknown. */
       
   935 		EModeUnknown,
       
   936 	/** Phone is idle. */
       
   937 		EModeIdle,
       
   938 	/** Phone is establishing link. */
       
   939 		EModeEstablishingLink,
       
   940 	/** Modem is in data mode. */
       
   941 		EModeOnlineData,
       
   942 	/** Modem is in command mode and the line is active. */
       
   943 		EModeOnlineCommand
       
   944 		};
       
   945 
       
   946 /** Modem connection status flags. */
       
   947 	enum TModemDetection
       
   948 		{
       
   949 	/** Modem present. */
       
   950 		EDetectedPresent,
       
   951 	/** Modem is not present. */
       
   952 		EDetectedNotPresent,
       
   953 	/** Modem connection status is unknown. */
       
   954 		EDetectedUnknown
       
   955 		};
       
   956 
       
   957 	struct TStatus
       
   958 /** Current phone status.
       
   959 
       
   960 @see TModemDetection */
       
   961 		{
       
   962 	/** The current modem connection status. 
       
   963 	
       
   964 	@see TModemDetection */
       
   965 		TModemDetection iModemDetected;
       
   966 	/** The current mode of the phone.
       
   967 	
       
   968 	@see TMode */
       
   969 		TMode iMode;
       
   970 		};
       
   971 
       
   972 	IMPORT_C TInt GetStatus(TStatus& aStatus) const;
       
   973 
       
   974 //
       
   975 // Line Enumeration and Information
       
   976 //
       
   977 	struct TLineInfo
       
   978 /** Line information.
       
   979 
       
   980 @see RCall::TStatus */
       
   981 		{
       
   982 	/** The current line status.
       
   983 	
       
   984 	@see RCall::TStatus */
       
   985 		RCall::TStatus iStatus;
       
   986 	/** The line capabilities flag. 
       
   987 	
       
   988 	@see RLine::TCapsFlags */
       
   989 		TUint32 iLineCapsFlags;
       
   990 	/** The name of the line.
       
   991 	
       
   992 	@see TName */
       
   993 		TName iName;
       
   994 		};
       
   995 
       
   996 	IMPORT_C TInt EnumerateLines(TInt& aCount) const;
       
   997 	IMPORT_C TInt GetLineInfo(const TInt aIndex,TLineInfo& aLineInfo) const;
       
   998 
       
   999 //
       
  1000 //	General phone notification information
       
  1001 //
       
  1002 	class TPhoneInfo
       
  1003 /** Phone notification information.
       
  1004 
       
  1005 Collects all the information associated with an instance of the core API phone 
       
  1006 class is collected together into a single, directly accessible, structure. 
       
  1007 This increases the efficiency of applications that require access to the majority 
       
  1008 of the phone's data.
       
  1009 
       
  1010 This class is not intended for user derivation.
       
  1011 
       
  1012 @see TNetworkType 
       
  1013 @publishedAll
       
  1014 @released
       
  1015 */
       
  1016 		{
       
  1017 	public:
       
  1018 		IMPORT_C TPhoneInfo();
       
  1019 	/** The current modem detection state (is it present or not).
       
  1020 	
       
  1021 	@see TModemDetection */
       
  1022 		TModemDetection iDetection;
       
  1023 		};
       
  1024 
       
  1025 	IMPORT_C TInt GetInfo(TPhoneInfo& aPhoneInfo) const;
       
  1026 
       
  1027 //
       
  1028 // Notifications
       
  1029 //
       
  1030 	IMPORT_C void NotifyModemDetected(TRequestStatus& aStatus,TModemDetection& aDetection);
       
  1031 	IMPORT_C void NotifyModemDetectedCancel() const;
       
  1032 
       
  1033 //	
       
  1034 // TEmergencyRequest is a bit-mask where each bit-flag represents 
       
  1035 // the emergency request type that the client wishes to handle
       
  1036 //
       
  1037 	enum TEmergencyRequest
       
  1038 		{
       
  1039 	/** Location Based Services Emergency Request */ 
       
  1040 		EEmergencyLCSRequest = 0x00000001,
       
  1041 	/** Circuit Switch Voice Call Emergency Request */
       
  1042 		EEmergencyCSVoiceCallRequest = 0x00000002,
       
  1043 		};
       
  1044 	
       
  1045 	IMPORT_C TInt SetEmergencyClient(const TUint32 aEmergencyRequest) const;
       
  1046 
       
  1047 protected:
       
  1048 	IMPORT_C virtual void ConstructL();
       
  1049 	IMPORT_C virtual void Destruct();
       
  1050 	};
       
  1051 
       
  1052 //
       
  1053 //
       
  1054 // RTelServer
       
  1055 //
       
  1056 //
       
  1057 /**
       
  1058 Root telephony server session.
       
  1059 
       
  1060 Provides access to general telephony information and functionality. Clients 
       
  1061 wishing to use the ETel Server must open a connection with the root server 
       
  1062 using the functions defined in this class. They may then obtain information 
       
  1063 about loaded TSY modules, and the phones that they support. To access functionality 
       
  1064 associated with a specific phone, the client must open a sub-session for that 
       
  1065 phone.
       
  1066 
       
  1067 This class is not intended for user derivation.
       
  1068 
       
  1069 @publishedPartner
       
  1070 @released 
       
  1071 */
       
  1072 class RTelServer : public RSessionBase
       
  1073 	{
       
  1074 public:
       
  1075 	enum { KDefaultMessageSlots=32 };
       
  1076 
       
  1077 	IMPORT_C RTelServer();
       
  1078 	IMPORT_C TInt Connect(TInt aMessageSlots =KDefaultMessageSlots);
       
  1079 	inline TVersion Version() const;
       
  1080 
       
  1081 //
       
  1082 // Enumeration and Information
       
  1083 //
       
  1084 /** Types of telephony connection flags. */
       
  1085 	enum TNetworkType
       
  1086 		{
       
  1087 	/** Wired analog network. */
       
  1088 		ENetworkTypeWiredAnalog,
       
  1089 	/** Wired digital network (not supported by ETel). */
       
  1090 		ENetworkTypeWiredDigital,
       
  1091 	/** Mobile analog network (not supported by ETel). */
       
  1092 		ENetworkTypeMobileAnalog,
       
  1093 	/** Mobile digital network. */
       
  1094 		ENetworkTypeMobileDigital,
       
  1095 	/** Unknown network type. */
       
  1096 		ENetworkTypeUnknown
       
  1097 		};
       
  1098 
       
  1099 	struct  TPhoneInfo
       
  1100 /** Phone notification information.
       
  1101 
       
  1102 Collects all the information associated with an instance of the core API phone 
       
  1103 class is collected together into a single, directly accessible, structure. 
       
  1104 This increases the efficiency of applications that require access to the majority 
       
  1105 of the phone's data.
       
  1106 
       
  1107 This class is not intended for user derivation. 
       
  1108 
       
  1109 @see TNetworkType */
       
  1110 		{
       
  1111 	/** The type of telephony connection supported by the phone.
       
  1112 	
       
  1113 	@see TNetworkType */
       
  1114 		TNetworkType iNetworkType;
       
  1115 	/** The name of the phone.
       
  1116 	
       
  1117 	@see TName */
       
  1118 		TName iName;
       
  1119 	/** The number of lines supported by the phone. */
       
  1120 		TUint iNumberOfLines;
       
  1121 	/** The extensions that the TSY module supports. */
       
  1122 		TUint iExtensions;
       
  1123 		};
       
  1124 
       
  1125 	IMPORT_C TInt EnumeratePhones(TInt& aNoOfPhones) const;
       
  1126 	IMPORT_C TInt GetPhoneInfo(const TInt aIndex,TPhoneInfo& aInfo) const;
       
  1127 	IMPORT_C TInt GetTsyName(const TInt aIndexOfPhone, TDes& aTsyName) const;
       
  1128 
       
  1129 //
       
  1130 // Load and Unload Phone modules
       
  1131 //
       
  1132 
       
  1133 	IMPORT_C TInt LoadPhoneModule(const TDesC& aFileName) const;
       
  1134 	IMPORT_C TInt UnloadPhoneModule(const TDesC& aFileName) const;
       
  1135 
       
  1136 //
       
  1137 // Check whether specified Phone module (TSY) supports certain functionality
       
  1138 //
       
  1139 		
       
  1140 	IMPORT_C TInt IsSupportedByModule(const TDesC& aTsyName, const TInt aMixin, TBool& aResult) const;
       
  1141 	IMPORT_C TInt GetTsyVersionNumber(const TDesC& aTsyName,TVersion& aVersion) const;
       
  1142 //
       
  1143 // Set this session as Priority client
       
  1144 //
       
  1145 	/** @deprecated This function has been deprecated. Use RTelServer::SetPriorityClientV2 followed by 
       
  1146 	RPhone::SetEmergencyClient(EEmergencyCSVoiceCallRequest) */
       
  1147 	IMPORT_C TInt SetPriorityClient() const;
       
  1148 
       
  1149 //
       
  1150 // Set this session to receive detailed errors
       
  1151 //
       
  1152 
       
  1153 /** Error granularity flags. */
       
  1154 	enum TErrorGranularity
       
  1155 		{
       
  1156 	/** Client is only interested in core errors */
       
  1157 		EErrorBasic,
       
  1158 	/** Client is interested in extended errors */
       
  1159 		EErrorExtended
       
  1160 		};
       
  1161 
       
  1162 	IMPORT_C TInt SetExtendedErrorGranularity(const TErrorGranularity aGranularity) const;
       
  1163 
       
  1164 //
       
  1165 // Debug calls - stubbed in release builds
       
  1166 //
       
  1167 	IMPORT_C TInt __DbgMarkHeap();
       
  1168 	IMPORT_C TInt __DbgCheckHeap(TInt aCount);
       
  1169 	IMPORT_C TInt __DbgMarkEnd(TInt aCount);
       
  1170 	IMPORT_C TInt __DbgFailNext(TInt aCount);
       
  1171 	IMPORT_C TInt __DbgFailNextAvailable(TBool& aResult);
       
  1172 	
       
  1173 //
       
  1174 // Set this session as Priority client
       
  1175 //
       
  1176 	IMPORT_C TInt SetPriorityClientV2() const;
       
  1177 	
       
  1178 	};
       
  1179 
       
  1180 
       
  1181 #include <etel.inl>
       
  1182 #endif