bluetooth/btextnotifiers/inc/BTExtNotifiersPartner.h
changeset 0 29b1cd4cb562
child 11 20fda83a6398
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2001-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef BTEXTNOTIFIERSPARTNER_H
       
    17 #define BTEXTNOTIFIERSPARTNER_H
       
    18 
       
    19 #include <btextnotifiersconsts.h>
       
    20 #include <bttypes.h>
       
    21 #include <btdevice.h>
       
    22 
       
    23 /**
       
    24 @publishedPartner
       
    25 @released
       
    26 
       
    27 UID of the PBAP authentication notifier
       
    28 */
       
    29 const TUid KPbapAuthNotifierUid={0x10282B22};
       
    30 
       
    31 /**
       
    32 @publishedPartner
       
    33 @deprecated
       
    34 @see "bt_subscribe.h"
       
    35 
       
    36 UID to notify the UI that a bluetooth link is currently active.
       
    37 Now deprecated by the publish/subscribe mechanism.
       
    38 **/
       
    39 const TUid KUidBTBasebandNotification={0x1000A5FB};
       
    40 
       
    41 NONSHARABLE_CLASS(TBTDeviceList)
       
    42 /**
       
    43 A list of TBTDevAddrs
       
    44 @note Used to pass a list of devices to which to connect.
       
    45 @publishedPartner
       
    46 @released
       
    47 */
       
    48 	{
       
    49 public:
       
    50 	IMPORT_C TBTDeviceList();
       
    51 	
       
    52 	IMPORT_C TInt AddDevice(const TBTDevAddr& aDevAddr);
       
    53 	IMPORT_C TInt GetDevice(TBTDevAddr& aDevAddr);
       
    54 	IMPORT_C void Reset();
       
    55 	
       
    56 	IMPORT_C operator const TDesC8&();
       
    57 	IMPORT_C operator TDes8&();
       
    58 	
       
    59 	IMPORT_C TUint MaxNumberOfDevices();
       
    60 	
       
    61 private:
       
    62 	const static TUint KMaxDevicesForSimultaneousSelection = 8;
       
    63 
       
    64 private:
       
    65 	TInt iPosition;	// the position within the list for stateful reading
       
    66 	TFixedArray<TBTDevAddr, KMaxDevicesForSimultaneousSelection> iDevices;
       
    67 	TPckg<TFixedArray<TBTDevAddr, KMaxDevicesForSimultaneousSelection> > iPtr;
       
    68 		
       
    69 	const TBTDevAddr iKNullDevAddr;
       
    70 
       
    71 	// This data padding has been added to help prevent future binary compatibility breaks	
       
    72 	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
       
    73 	TUint32     iPadding1; 
       
    74 	TUint32     iPadding2; 	
       
    75 	};
       
    76 
       
    77 NONSHARABLE_CLASS(TPbapAuthNotifierParams)
       
    78 /**
       
    79 Parameters passed to the PBAP authentication notifier plugin
       
    80 @publishedPartner
       
    81 @released
       
    82 */
       
    83 	{
       
    84 public:
       
    85 	IMPORT_C TPbapAuthNotifierParams();
       
    86 
       
    87 	IMPORT_C void SetRealm(const TDesC& aRealm);
       
    88 	IMPORT_C void SetRemoteAddr(const TBTDevAddr& aBDAddr);
       
    89 
       
    90 	IMPORT_C const TDesC& Realm() const;
       
    91 	IMPORT_C TBool RealmTruncated() const;
       
    92 	IMPORT_C const TBTDevAddr& RemoteAddr() const;
       
    93 
       
    94 	IMPORT_C TBool IsValidRealm() const;
       
    95 	IMPORT_C TBool IsValidRemoteAddr() const;
       
    96 	
       
    97 private:
       
    98 	TBuf<KPbapAuthRealmLength> iRealm; /*!< The Realm specified by the device requesting authentication. */
       
    99 	TBool iRealmTruncated; /*!< Set to ETrue if iRealm has been truncated */
       
   100 	TBTDevAddr iRemoteAddr; /*!< The Bluetooth device address of the device requesting authentication. */ 
       
   101 
       
   102 	TBool iValidRealm; /*!< ETrue if iRealm has been set, EFalse if not */
       
   103 	TBool iValidRemoteAddr; /*!< ETrue if iRemoteAddr has been set, EFalse if not */
       
   104 
       
   105 	// This data padding has been added to help prevent future binary compatibility breaks	
       
   106 	// iPadding has not been zero'd because they are currently not used
       
   107 	TUint32     iPadding;
       
   108 	};
       
   109 
       
   110 /**
       
   111 Packaged version of <code>TPbapAuthNotifierParams</code> that allows data transfer over process boundaries.
       
   112 @publishedPartner
       
   113 @released
       
   114 */
       
   115 typedef TPckgBuf<TPbapAuthNotifierParams> TPbapAuthNotifierParamsPckg;
       
   116 
       
   117 NONSHARABLE_CLASS(TPbapAuthNotifierResponse)
       
   118 /**
       
   119 Response data from the PBAP authentication notifier plugin
       
   120 @publishedPartner
       
   121 @released
       
   122 */
       
   123 	{
       
   124 public:
       
   125 	IMPORT_C TPbapAuthNotifierResponse();
       
   126 
       
   127 	IMPORT_C TBool SetPassword(const TDesC& aPassword);
       
   128 	IMPORT_C void ResetPassword();
       
   129 
       
   130 	IMPORT_C const TDesC& Password() const;
       
   131 
       
   132 	IMPORT_C TBool IsValidPassword() const;
       
   133 
       
   134 private:
       
   135     /** The password used to create the challenge response. */
       
   136 	TBuf<KPbapAuthPasswordLength> iPassword;
       
   137 
       
   138 	TBool iValidPassword; /*!< ETrue if iPassword has been set, EFalse if not */
       
   139 
       
   140 	// This data padding has been added to help prevent future binary compatibility breaks	
       
   141 	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
       
   142 	TUint32     iPadding1; 
       
   143 	TUint32     iPadding2; 	
       
   144 	};
       
   145 
       
   146 /**
       
   147 Packaged version of <code>TPbapAuthNotifierResponse</code> that allows data transfer over process boundaries.
       
   148 @publishedPartner
       
   149 @released
       
   150 */
       
   151 typedef TPckgBuf<TPbapAuthNotifierResponse> TPbapAuthNotifierResponsePckg;
       
   152 
       
   153 
       
   154 //
       
   155 // Standard Bluetooth Authentication Notifiers
       
   156 //
       
   157 
       
   158 
       
   159 /**
       
   160 UID of the "Numeric Comparison" confirmation request RNotifier plugin.
       
   161 
       
   162 The notifier will be started with a parameter of type TBTNumericComparisonParamsPckg.
       
   163 
       
   164 The notifier will receive updates of type TBTNotifierUpdateParamsPckg2.
       
   165 
       
   166 @see TBTNotifierUpdateParamsPckg2
       
   167 
       
   168 @publishedPartner
       
   169 @released
       
   170 */
       
   171 const TUid KBTNumericComparisonNotifierUid={0x10285AD5};
       
   172 
       
   173 /**
       
   174 UID of the "Passkey Entry" display RNotifier plugin.
       
   175 
       
   176 The notifier will be started with a parameter of type TBTPasskeyDisplayParamsPckg.
       
   177 
       
   178 The notifier will receive updates of type TBTNotifierUpdateParamsPckg2.
       
   179 
       
   180 @see TBTNotifierUpdateParamsPckg2
       
   181 
       
   182 @publishedPartner
       
   183 @released
       
   184 */
       
   185 const TUid KBTPasskeyDisplayNotifierUid={0x10285AD4};
       
   186 
       
   187 /**
       
   188 UID of the "PIN Code Entry" RNotifier plugin.
       
   189 
       
   190 Note that this is an SSP aware notifier taking the new parameter type.  This is
       
   191 intended to replace the deprecated KBTManPinNotifierUid RNotifier plugin.
       
   192 @see KBTManPinNotifierUid
       
   193 
       
   194 The notifier will be started with a parameter of type TBTPinCodeEntryNotifierParamsPckg.
       
   195 
       
   196 The notifier will receive updates of type TBTNotifierUpdateParamsPckg2.
       
   197 
       
   198 @see TBTNotifierUpdateParamsPckg2
       
   199 
       
   200 @publishedPartner
       
   201 @released
       
   202 */
       
   203 const TUid KBTPinCodeEntryNotifierUid={0x10285D55};
       
   204 
       
   205 /**
       
   206 The base parameter for the secure simple pairing notifiers.
       
   207 	
       
   208 @publishedPartner
       
   209 @released
       
   210 */
       
   211 NONSHARABLE_CLASS(TBTNotifierParams2)	
       
   212 	{
       
   213 public:
       
   214 	IMPORT_C TBTDevAddr DeviceAddress() const;
       
   215 	IMPORT_C TPtrC DeviceName() const;
       
   216 	
       
   217 protected:
       
   218 	TBTNotifierParams2(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName);
       
   219 	TBTNotifierParams2();
       
   220 	
       
   221 private:
       
   222 	TBTDevAddr		iBDAddr;
       
   223 	TBTDeviceName	iName;	
       
   224 	
       
   225 	// This data padding has been added to help prevent future binary compatibility breaks	
       
   226 	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
       
   227 	TUint32	iPadding1; 
       
   228 	TUint32	iPadding2; 
       
   229 	};
       
   230 
       
   231 /** 
       
   232 Secure simple pairing "Numeric Comparison" parameters.
       
   233 This class packages the parameters passed to a numeric comparison notifier.
       
   234 	
       
   235 @publishedPartner
       
   236 @released
       
   237 */
       
   238 NONSHARABLE_CLASS(TBTNumericComparisonParams)
       
   239 	: public TBTNotifierParams2
       
   240 	{
       
   241 public:
       
   242 	/**
       
   243 	This represents the type of comparison that is being performed.
       
   244 	It is intended to allow the UI to present the user of the device
       
   245 	with suitable information to help them complete the pairing.
       
   246 	*/
       
   247 	enum TComparisonScenario
       
   248 		{
       
   249 		ERemoteCannotConfirm,	/*!< Only the Symbian device can confirm the displayed numbers are the same. */
       
   250 		ERemoteCanConfirm,		/*!< Both devices can confirm that the displayed numbers are the same */
       
   251 		};
       
   252 		
       
   253 public:
       
   254 	IMPORT_C TBTNumericComparisonParams(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName, TUint32 aNumericalValue, TComparisonScenario aComparisonScenario, TBool aLocallyInitiated);
       
   255 	IMPORT_C TBTNumericComparisonParams();
       
   256 	
       
   257 public:
       
   258 	IMPORT_C TUint32 NumericalValue() const;
       
   259 	IMPORT_C TComparisonScenario ComparisonScenario() const;
       
   260 	IMPORT_C TBool LocallyInitiated() const;
       
   261 	
       
   262 private:
       
   263 	TUint32				iNumericalValue;
       
   264 	TComparisonScenario	iComparisonScenario;
       
   265 	TBool				iLocallyInitiated;
       
   266 	
       
   267 	// This data padding has been added to help prevent future binary compatibility breaks	
       
   268 	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
       
   269 	TUint32	iPadding1;
       
   270 	TUint32 iPadding2;
       
   271 	};
       
   272 
       
   273 /**
       
   274 Secure simple pairing "Passkey Entry" display parameters.
       
   275 This class packages the parameters passed to a passkey display notifier.
       
   276 	
       
   277 @publishedPartner
       
   278 @released
       
   279 */
       
   280 NONSHARABLE_CLASS(TBTPasskeyDisplayParams)
       
   281 	: public TBTNotifierParams2	
       
   282 	{
       
   283 public:
       
   284 	IMPORT_C TBTPasskeyDisplayParams(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName, TUint32 aNumericalValue, TBool aLocallyInitiated);
       
   285 	IMPORT_C TBTPasskeyDisplayParams();
       
   286 	
       
   287 public:
       
   288 	IMPORT_C TUint32 NumericalValue() const;
       
   289 	IMPORT_C TBool LocallyInitiated() const;
       
   290 	
       
   291 private:
       
   292 	TUint32	iNumericalValue;
       
   293 	TBool	iLocallyInitiated;
       
   294 	
       
   295 	// This data padding has been added to help prevent future binary compatibility breaks	
       
   296 	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
       
   297 	TUint32	iPadding1; 
       
   298 	TUint32	iPadding2;
       
   299 	};
       
   300 
       
   301 /** 
       
   302 Simple secure pairing aware "PIN Code Entry" request parameters.
       
   303 This class packages the parameters passed to a PIN code entry notifier.
       
   304 	
       
   305 @publishedPartner
       
   306 @released
       
   307 */
       
   308 NONSHARABLE_CLASS(TBTPinCodeEntryNotifierParams)
       
   309 	: public TBTNotifierParams2
       
   310 	{
       
   311 public:
       
   312 	IMPORT_C TBTPinCodeEntryNotifierParams(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName, TUint aPinCodeMinLength, TBool aLocallyInitiated, TBool aStrongPinCodeRequired, TUint aRecommendedPinCodeMinLength);
       
   313 	IMPORT_C TBTPinCodeEntryNotifierParams();
       
   314 	
       
   315 public:
       
   316 	IMPORT_C TUint PinCodeMinLength() const;
       
   317 	IMPORT_C TBool LocallyInitiated() const;
       
   318 	IMPORT_C TBool StrongPinCodeRequired() const;
       
   319 	IMPORT_C TUint RecommendedPinCodeMinLength() const;
       
   320 	
       
   321 private:
       
   322 	TUint	iPinCodeMinLength;
       
   323 	TBool	iLocallyInitiated;
       
   324 	TBool	iStrongPinCodeRequired;
       
   325 	//TUint32 used here as this space was once a padding field.
       
   326 	TUint32	iRecommendedPinCodeMinLength;
       
   327 	
       
   328 	// This data padding has been added to help prevent future binary compatibility breaks	
       
   329 	// iPadding1 has not been zero'd because it is currently not used
       
   330 	TUint32	iPadding1; 
       
   331 	};
       
   332 
       
   333 /**
       
   334 The base update parameter for the Bluetooth pairing notifiers.
       
   335 This class is intended to allow multiple different updates parameters to be
       
   336 passed to the Bluetooth notifiers.
       
   337 	
       
   338 @publishedPartner
       
   339 @released
       
   340 */
       
   341 NONSHARABLE_CLASS(TBTNotifierUpdateParams2)
       
   342 	{
       
   343 public:
       
   344 	enum TUpdateParamType
       
   345 		{
       
   346 		EDeviceName,
       
   347 		EPasskeyDisplay,
       
   348 		};
       
   349 	
       
   350 public:
       
   351 	IMPORT_C TBTNotifierUpdateParams2();
       
   352 	IMPORT_C TUpdateParamType Type() const;
       
   353 	
       
   354 protected:
       
   355 	TBTNotifierUpdateParams2(TBTNotifierUpdateParams2::TUpdateParamType aType);
       
   356 	
       
   357 private:
       
   358 	TUpdateParamType	iType;
       
   359 	
       
   360 	// This data padding has been added to help prevent future binary compatibility breaks	
       
   361 	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
       
   362 	TUint32	iPadding1;
       
   363 	TUint32	iPadding2;
       
   364 	};
       
   365 
       
   366 /** 
       
   367 Bluetooth device name update parameter.
       
   368 This class provides the parameters to indicate an update to the name of
       
   369 the Bluetooth device for which the notifier is waiting for input.
       
   370 	
       
   371 @publishedPartner
       
   372 @released
       
   373 */
       
   374 NONSHARABLE_CLASS(TBTDeviceNameUpdateParams)
       
   375 	: public TBTNotifierUpdateParams2
       
   376 	{
       
   377 public:
       
   378 	IMPORT_C TBTDeviceNameUpdateParams(const TDesC& aDeviceName, TInt aResult);
       
   379 	IMPORT_C TBTDeviceNameUpdateParams();
       
   380 	
       
   381 public:
       
   382 	IMPORT_C TPtrC DeviceName() const;
       
   383 	IMPORT_C TInt Result() const;
       
   384 	
       
   385 private:
       
   386 	TBTDeviceName	iDeviceName;
       
   387 	TInt			iResult;
       
   388 	
       
   389 	// This data padding has been added to help prevent future binary compatibility breaks	
       
   390 	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
       
   391 	TUint32	iPadding1; 
       
   392 	TUint32	iPadding2;
       
   393 	};
       
   394 
       
   395 /** 
       
   396 Secure simple pairing "Passkey Entry" display update parameters.
       
   397 This class provides the update parameters associated with a passkey entry
       
   398 display notifier.  Notably it provides the notification of keypresses from
       
   399 the remote device.
       
   400 
       
   401 @publishedPartner
       
   402 @released
       
   403 */
       
   404 NONSHARABLE_CLASS(TBTPasskeyDisplayUpdateParams) 
       
   405 	: public TBTNotifierUpdateParams2	
       
   406 	{
       
   407 public:
       
   408 	IMPORT_C TBTPasskeyDisplayUpdateParams(THCIPasskeyEntryNotificationType aNotificationType);
       
   409 	IMPORT_C TBTPasskeyDisplayUpdateParams();
       
   410 	
       
   411 public:
       
   412 	IMPORT_C THCIPasskeyEntryNotificationType KeypressNotification() const;
       
   413 	
       
   414 private:
       
   415 	THCIPasskeyEntryNotificationType iNotificationType;
       
   416 	
       
   417 	TUint32 iPadding1;
       
   418 	TUint32 iPadding2;
       
   419 	};
       
   420 
       
   421 /**
       
   422 Typedef'ed pckgbuf to send numeric comparison parameters to the notifier framework.
       
   423 @publishedPartner
       
   424 @released
       
   425 */
       
   426 typedef TPckgBuf<TBTNumericComparisonParams> TBTNumericComparisonParamsPckg;
       
   427 /**
       
   428 Typedef'ed pckgbuf to send passkey entry display parameters to the notifier framework.
       
   429 @publishedPartner
       
   430 @released
       
   431 */
       
   432 typedef TPckgBuf<TBTPasskeyDisplayParams> TBTPasskeyDisplayParamsPckg;
       
   433 /**
       
   434 Typedef'ed pckgbuf to send PIN code entry parameters to the notifier framework.
       
   435 @publishedPartner
       
   436 @released
       
   437 */
       
   438 typedef TPckgBuf<TBTPinCodeEntryNotifierParams> TBTPinCodeEntryNotifierParamsPckg;
       
   439 
       
   440 /**
       
   441 Typedef'ed pckgbuf to represent the base class of Bluetooth update parameters.
       
   442 @publishedPartner
       
   443 @released
       
   444 */
       
   445 typedef TPckgBuf<TBTNotifierUpdateParams2> TBTNotifierUpdateParamsPckg2;
       
   446 /**
       
   447 Typedef'ed pckgbuf to send device name update parameters to the notifier framework.
       
   448 @publishedPartner
       
   449 @released
       
   450 */
       
   451 typedef TPckgBuf<TBTDeviceNameUpdateParams> TBTDeviceNameUpdateParamsPckg;
       
   452 /**
       
   453 Typedef'ed pckgbuf to send passkey entry display update parameters to the notifier framework.
       
   454 @publishedPartner
       
   455 @released
       
   456 */
       
   457 typedef TPckgBuf<TBTPasskeyDisplayUpdateParams> TBTPasskeyDisplayUpdateParamsPckg;
       
   458 
       
   459 #endif // BTEXTNOTIFIERSPARTNER_H