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