2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This file contains the header of the CHWRMHaptics class.
19 #ifndef C_HWRMHAPTICS_H
20 #define C_HWRMHAPTICS_H
23 #include <hwrmlogicalactuators.h>
24 #include <hwrmhapticsobserver.h>
25 #include <hwrmhapticsactuatorobserver.h>
27 /** Minimum magnitude value. */
28 const TInt KHWRMHapticsMinMagnitude = 0;
30 /** Maximum magnitude value. */
31 const TInt KHWRMHapticsMaxMagnitude = 10000;
34 * Minimum device priority.
36 * To be used with SetDeviceProperty().
38 const TInt KHWRMHapticsMinDevicePriority = 0;
41 * Maximum device priority.
43 * To be used with SetDeviceProperty().
45 const TInt KHWRMHapticsMaxDevicePriority = 15;
48 /** Minimum strength value. */
49 const TInt KHWRMHapticsMinStrength = 0;
51 /** Maximum strength value. */
52 const TInt KHWRMHapticsMaxStrength = 10000;
56 * The class used to control the device's haptics feature.
58 * The Haptics API provides the ability to control the device's haptics feature.
59 * The API provides methods for receiving the current status and effect
60 * completion of the haptics. The API provides synchronous and asynchronous
61 * versions of playing methods due to the nature of effect playing
62 * where multiple calls may be made to play effects.
63 * Synchronous methods are provided for other API functionality.
64 * They will block the calling client during their execution.
65 * The API is meant for all applications which need to control the
66 * device's haptics feature.
68 * The API consist of the class CHWRMHaptics and related observer classes:
69 * MHWRMHapticsObserver and MHWRMHapticsActuatorObserver. If the client
70 * requires up-to-date status information, it can be achieved by deriving
71 * the client from MHWRMHapticsObserver or MHWRMHapticsActuatorObserver or
72 * from both and providing a callback pointer(s) of the implementing class
73 * for the NewL() method.
77 * // ===================================================================
79 * // - Setting the license key.
80 * // - Playing a periodic effect
82 * // - Haptics feature must be enabled by the system.
83 * // ===================================================================
85 * #include <hwrmhaptics.h> // link against hwrmhapticsclient.lib
86 * #include <hwrmlogicalactuators.h> // enumeration of logical actuators
88 * TInt minPeriod( 0 );
89 * TInt effectHandle( 0 );
92 * CHWRMHaptics* haptics = CHWRMHaptics::NewL( NULL, NULL );
94 * haptics->SupportedActuators( suppAct );
96 * if( EHWRMLogicalActuatorDevice & suppAct )
98 * haptics->OpenActuatorL( EHWRMLogicalActuatorDevice );
100 * else if ( EHWRMLogicalActuatorAny & suppAct )
102 * haptics->OpenActuatorL( EHWRMLogicalActuatorAny );
106 * // 3rd party developers can obtain the license key from Forum Nokia
107 * _LIT8( KLicenseKey,"_this_value_must_be_32_in_length" );
109 * User::LeaveIfError(
110 * haptics->SetDeviceProperty(
111 * THWRMHapticsDevicePropertyTypes::EHWRMHapticsLicenseKey,
114 * // --> now playing effects is possible
116 * CHWRMHaptics::THWRMHapticsPeriodicEffect periodicEff;
118 * periodicEff.iDuration = 5000;
119 * periodicEff.iMagnitude = 5000;
120 * periodicEff.iPeriod = minPeriod;
121 * periodicEff.iStyle = CHWRMHaptics::EHWRMHapticsStyleSharp;
122 * periodicEff.iAttackTime = 250;
123 * periodicEff.iAttackLevel = 10000;
124 * periodicEff.iFadeTime = 250;
125 * periodicEff.iFadeLevel = 0;
127 * haptics->PlayPeriodicEffect( periodicEff, effectHandle );
129 * // ... something happened in the application and it has lost focus
130 * // so stop the effect immediately
132 * haptics->StopPlayingEffect( effectHandle );
134 * // ================================================================
135 * // Usage example 2:
136 * // - Loading effect data from a file and playing effects from the
138 * // - Preconditions:
139 * // - license key is set
140 * // - Recommended usage style:
141 * // - Effect data file can contain definition(s) of periodic
142 * // effects, magsweep effects or a combination of these basic
143 * // types called timeline effects, which call basic effects in
144 * // sequence thus forming new more complex effects.
145 * // - Load the effect data once in the client application.
146 * // - Play effects from the loaded data using the effectIndex
147 * // ================================================================
149 * // Use S60 FileSystem to load the effect data file to a buffer
153 * // Effect data has been read into a descriptor by the user.
154 * // Load the effect data to be used by the haptic subsystem.
155 * TInt fileHandle( 0 );
156 * User::LeaveIfError( haptics->LoadEffectData( data, fileHandle ) );
158 * TInt effectIndex = 0;
159 * TInt hapticsStatus = haptics->PlayEffect( fileHandle,
163 * hapticsStatus = haptics->DeleteEffectData( fileHandle );
165 * if( KErrNone != hapticsStatus )
167 * // do some error handling...
175 * Common error codes returned by the Haptics API methods.
177 * KErrArgument Argument is invalid, e.g., malformatted effect data, or too
178 * large magnitude value.
179 * KErrAccessDenied The license key is not set when trying to use some
181 * KErrNoMemory There is insufficient memory available for the method to
183 * KErrNotReady Initialization has not been done properly when trying to use
186 * @lib hwrmhapticsclient.dll
190 class CHWRMHaptics : public CBase
195 * Defines the paramaters used in a magsweep effect.
198 * PlayMagSweepEffect(),
199 * ModifyPlayingMagSweepEffect(),
200 * GetMagSweepEffectDefinition().
202 struct THWRMHapticsMagSweepEffect
205 * Duration of the effect. Unit is milliseconds.
207 * To specify an infinite duration, the effect duration
208 * should be set to a value returned by InfiniteDuration().
209 * For a finite duration, the effect duration is clamped to a value
210 * from 0 to the value returned by GetDeviceCapability()
211 * for the EHWRMHapticsMaxEffectDuration capability type.
216 * Magnitude of the effect.
218 * The effect magnitude is clamped to a value from
219 * KHWRMHapticsMinMagnitude to KHWRMHapticsMaxMagnitude.
224 * Style of the effect.
226 * Can be one of THWRMHapticsEffectStyles.
231 * Attack time of the effect. Unit is milliseconds.
233 * The attack time is clamped to a value from 0 to the value returned
234 * by GetDeviceCapability() for the EHWRMHapticsMaxEnvelopeTime
240 * Attack level of the effect.
242 * The attack level is clamped to a value from KHWRMHapticsMinMagnitude
243 * to KHWRMHapticsMaxMagnitude.
248 * Fade time of the effect. Unit is milliseconds.
250 * The fade time is clamped to a value from 0 to the value returned
251 * by GetDeviceCapability() for the EHWRMHapticsMaxEnvelopeTime
257 * Fade level of the effect.
259 * The fade level is clamped to a value from KHWRMHapticsMinMagnitude
260 * to KHWRMHapticsMaxMagnitude inclusive.
266 * Defines the parameters used in a periodic effect.
269 * PlayPeriodicEffect(),
270 * ModifyPlayingPeriodicEffect(),
271 * GetPeriodicEffectDefinition().
273 struct THWRMHapticsPeriodicEffect
276 * Duration of the effect. Unit is milliseconds.
278 * To specify an infinite duration, the effect duration
279 * should be set to InfiniteDuration().
280 * For a finite duration, the effect duration is clamped to a value
281 * from 0 to the value returned by GetDeviceCapability()
282 * for the EHWRMHapticsMaxEffectDuration capability type.
287 * Magnitude of the effect.
289 * The effect magnitude is clamped to a value from
290 * KHWRMHapticsMinMagnitude to KHWRMHapticsMaxMagnitude.
295 * Period of the effect. Unit is milliseconds.
297 * The period is clamped to a value returned by GetDeviceCapability()
298 * for EHWRMHapticsMinPeriod capability type to the value returned
299 * by GetDeviceCapability() for the EHWRMHapticsMaxEnvelopeTime
305 * Style of the effect.
307 * Can be one of THWRMHapticsEffectStyles.
312 * Attack time of the effect. Unit is milliseconds.
314 * The attack time is clamped to a value from 0 to the value returned
315 * by GetDeviceCapability() for the EHWRMHapticsMaxEnvelopeTime
321 * Attack level of the effect.
323 * The attack level is clamped to a value from KHWRMHapticsMinMagnitude
324 * to KHWRMHapticsMaxMagnitude.
329 * Fade time of the effect. Unit is milliseconds.
331 * The fade time is clamped to a value from 0 to the value returned
332 * by GetDeviceCapability() for the EHWRMHapticsMaxEnvelopeTime
338 * Fade level of the effect.
340 * The fade level is clamped to a value from KHWRMHapticsMinMagnitude
341 * to KHWRMHapticsMaxMagnitude.
347 * THWRMHapticsDevicePropertyTypes enumeration
348 * Use SetDeviceProperty() to set properties for the haptics
349 * and GetDeviceProperty() to get properties currently in use.
351 enum THWRMHapticsDevicePropertyTypes
354 * License key property. Usable with SetDeviceProperty() only.
355 * Use const TDesC8& overloaded version of the method.
357 * Setting this property to a valid license key unlocks the haptics
358 * subsystem in the device. Setting this property to an invalid
359 * license key locks the haptics in the device (for this client).
360 * The haptics in the device are locked from clients by default.
361 * When haptics is locked, all haptics related operations on the
362 * device, except for setting the license key and closing the device,
364 * Haptics must be unlocked on a per instance basis.
366 EHWRMHapticsLicensekey = 0,
369 * Property used to set/get the priority for effects to played for
370 * the given haptics instance (i.e., for the given client).
372 * Use TInt overloaded version of the methods SetDeviceProperty()and
373 * GetDeviceProperty() to use this property.
375 * Different haptics instances can use different priorities
376 * on the same physical device. The priority determines which haptics
377 * instance's effects are played when multiple haptics instances
378 * are attempting to play effects at the same time.
379 * The default priority is DefaultDevicePriority().
380 * Priority values can range from KHWRMHapticsMinDevicePriority
381 * to KHWRMHapticsMaxDevicePriority.
382 * GetDeviceProperty() returns a value inside
383 * TInt& aDevicePropertyValue in the range of
384 * KHWRMHapticsMinDevicePriority
385 * to KHWRMHapticsMaxDevicePriority. If the client has not set
386 * the EHWRMHapticsPriority property GetDeviceProperty() returns
387 * a value of DefaultDevicePriority().
389 EHWRMHapticsPriority,
392 * Property used to disable effects for the client's haptics instance.
394 * Use TBool overloaded version of the methods SetDeviceProperty() and
395 * GetDeviceProperty() to use this property.
397 * When this property is set to true, any playing effects are
398 * immediately stopped and subsequent requests to play
399 * effects are ignored. Applies to the calling client's
400 * haptics instance only. When this property is set to false,
401 * subsequent requests to play effects are honored.
402 * The default value for this property is false.
404 EHWRMHapticsDisableEffects,
407 * A property that reduces/increases the magnitude of all effects
408 * for a particular haptics instance.
410 * Use TInt overloaded version of the methods SetDeviceProperty()and
411 * GetDeviceProperty() to use this property.
413 * Strength values can vary from KHWRMHapticsMinStrength ("mute")
414 * to KHWRMHapticsMaxStrength.
415 * The default value for EHWRMHapticsStrength is
416 * KHWRMHapticsMaxStrength. If the EHWRMHapticsStrength property is
417 * not set, the default value is used.
418 * When reducing/increasing the magnitude of the effects by setting
419 * the EHWRMHapticsStrength property, it only applies to the haptics
420 * instance of the client which called the function. If there is a
421 * second haptics instance held by the same or a different client,
422 * it is not affected by the setting of the EHWRMHapticsStrength
423 * property of the first client's haptics instance.
425 * Modifying the EHWRMHapticsStrength property of the haptics instance
426 * does not affect currently playing effects, only effects played or
427 * modified after calling the SetDeviceProperty() method using the new
428 * EHWRMHapticsStrength value.
430 EHWRMHapticsStrength,
433 * A property that reduces/increases the magnitude of all effects
434 * for all haptics instances (whole device).
436 * Use TInt overloaded version of the methods SetDeviceProperty()and
437 * GetDeviceProperty() to use this property.
439 * Strength values can vary from KHWRMHapticsMinStrength ("mute")
440 * to KHWRMHapticsMaxStrength.
441 * The default value for Master Strength is KHWRMHapticsMaxStrength.
442 * If the client does not set the EHWRMHapticsMasterStrength property
443 * of the haptics instance, the default value is used.
444 * When reducing/increasing the magnitude of the effects,
445 * EHWRMHapticsMasterStrength property affects all playing effects on
446 * all haptics instances (whole device).
447 * This means that all the haptics instances, held by other
448 * clients are affected by the setting of EHWRMHapticsMasterStrength
449 * property of the first client's haptics instance.
451 * The client which wants to set the EHWRMHapticsMasterStrength
452 * property must have a haptics instance that has a maximum effect
454 * The haptics client instance must set itself to a maximum priority
455 * by calling SetDeviceProperty() using EHWRMHapticsPriority property
456 * type and KMaxDevicePriority value before changing the
457 * EHWRMHapticsMasterStrength property's value.
459 * Note: A licensee license key, provided to licensees only,
460 * changes the EHWRMHapticsMasterStrength property.
461 * A call to SetDeviceProperty( EHWRMHapticsMasterStrength, aValue )
462 * always returns KErrAccessDenied for haptics instances that are
463 * not using a licensee license key.
465 EHWRMHapticsMasterStrength
469 * Device's capability types.
471 * Use TInt& aDeviceCapabilityValue overloaded version of the
472 * method GetDeviceCapability() unless otherwise mentioned.
474 enum THWRMHapticsDeviceCapabilityTypes
477 * Device category. See THWRMHapticsDeviceCategory enumeration defined
478 * later in this API header for possible values.
480 EHWRMHapticsDeviceCategory = 0,
483 * The maximum number of nested repeat bars supported for Timeline effects.
485 * Any repeat bars nested beyond this level are played only once.
487 EHWRMHapticsMaxNestedRepeats,
490 * Number of vibration actuators present in the device.
492 EHWRMHapticsNumActuators,
495 * Actuator type See THWRMHapticsActuatorType enumeration defined
496 * later in this API header for possible values.
498 EHWRMHapticsActuatorType,
501 * Number of effect slots.
503 * The number of effect slots represents the maximum number
504 * of simple effects that can play simultaneously.
505 * If an attempt is made to play more than this number of effects
506 * at the same time, some of the simple effects do not play.
508 EHWRMHapticsNumEffectSlots,
511 * Supported effect styles, stored as a bitfield. See
512 * THWRMHapticsSupportedEffectStyles enumeration defined later in this
513 * API header for possible values.
515 EHWRMHapticsSupportedStyles,
518 * Minimum period for Periodic effects.
520 EHWRMHapticsMinPeriod,
523 * Maximum period for Periodic effects.
525 EHWRMHapticsMaxPeriod,
528 * Maximum duration for MagSweep and Periodic effects measured
531 EHWRMHapticsMaxEffectDuration,
534 * Supported effect types. Stored as a bitfield. See
535 * THWRMHapticsSupportedEffectTypes enumeration defined later in this
536 * API header for possible values.
538 EHWRMHapticsSupportedEffects,
543 * Use TDes8& aDeviceCapabilityValue overloaded version of the
544 * method GetDeviceCapability().
546 EHWRMHapticsDeviceName,
549 * Maximum start time or fade time in milliseconds for
550 * effect envelopes of MagSweep or periodic effects.
552 EHWRMHapticsMaxEnvelopeTime,
555 * Version number of the physical haptics player in the device in
556 * hexadecimal format.
558 * The format is OxMMNNSSBB, where MM is the major
559 * version number, NN is the minor version number,
560 * SS is a special build number and BB is the VTMP build number.
561 * For example, for the hexadecimal format 0x02000053 the version
564 EHWRMHapticsAPIVersionNumber,
567 * Maximum size in bytes of effect data (buffer) that can be played
568 * on a non-tethered device.
570 EHWRMHapticsMaxEffectDataSize = 14
576 enum THWRMHapticsDeviceCategory
578 EHWRMHapticsVirtual = 2,
579 EHWRMHapticsEmbedded = 3,
583 * Bitmask for effect support.
585 * To be used to analyze value returned by GetDeviceCapability().
587 enum THWRMHapticsSupportedEffectTypes
589 EHWRMHapticsSupportPeriodic = 1,
590 EHWRMHapticsSupportMagSweep = 2,
591 EHWRMHapticsSupportTimeline = 4,
592 EHWRMHapticsSupportStreaming = 8
598 enum THWRMHapticsEffectTypes
600 EHWRMHapticsTypePeriodic = 0,
601 EHWRMHapticsTypeMagSweep,
602 EHWRMHapticsTypeTimeline,
603 EHWRMHapticsTypeStreaming
607 * Bitmask for supported effect styles.
609 * To be used to analyze the value returned by GetDeviceCapability().
611 enum THWRMHapticsSupportedEffectStyles
613 EHWRMHapticsSupportSmooth = 1,
614 EHWRMHapticsSupportStrong = 2,
615 EHWRMHapticsSupportSharp = 4
621 * Used to specify Periodic or MagSweep effect style when calling
622 * PlayMagSweepEffect(),
623 * PlayPeriodicEffect(),
624 * ModifyPlayingMagSweepEffect() and
625 * ModifyPlayingPeriodicEffect().
627 enum THWRMHapticsEffectStyles
629 EHWRMHapticsStyleSmooth = 0,
630 EHWRMHapticsStyleStrong,
631 EHWRMHapticsStyleSharp
637 * To be used with GetDeviceCapability().
639 enum THWRMHapticsActuatorTypes
642 * Eccentric Rotating Mass actuator
644 EHWRMHapticsTypeERM = 0,
647 * Linear Resonant actuator
649 EHWRMHapticsTypeLRA = 2
655 * As returned in a call to GetEffectState().
657 enum THWRMHapticsEffectStates
659 EHWRMHapticsEffectNotPlaying = 0,
660 EHWRMHapticsEffectPlaying,
661 EHWRMHapticsEffectPaused
665 * Two-phased constructor.
666 * Use this method for creating a haptics instance with callbacks.
668 * @param aHapticsCallback Pointer to callback instance. Can be NULL.
669 * @param aActuatorCallback Pointer to callback instance. Can be NULL.
671 * @return A pointer to a new instance of the CHWRMHaptics class.
675 IMPORT_C static CHWRMHaptics* NewL(
676 MHWRMHapticsObserver* aHapticsCallback,
677 MHWRMHapticsActuatorObserver* aActuatorCallback );
682 * @param[out] aStatus Request status. On completion contains:
683 * KErrNone, if successful,
684 * otherwise one of the other system-wide error codes.
686 IMPORT_C static CHWRMHaptics* NewL(
687 MHWRMHapticsObserver* aHapticsCallback,
688 MHWRMHapticsActuatorObserver* aActuatorCallback,
689 TRequestStatus& aStatus );
692 * Method for opening a logical actuator for use.
694 * This method must be called before using any other methods of this class,
695 * except when using GetXXX methods.
696 * The Haptics API supports a limited number of instances of CHWRMHaptics
698 * If all instances are currently in use, the next attempt to call
699 * OpenActuatorL() from any client fails.
700 * Applications should not use more instances than necessary as this
701 * may prevent other applications from instantiating the CHWRMHaptics
704 * @param aActuator Enumeration of the type of logical actuator the client
707 * @leave TInt KErrNotSupported, if the used logical actuator is not
708 * supported by the system.
709 * @leave TInt KErrAlreadyExists, if the used logical actuator is already
711 * @leave TInt KErrInUse, if some other actuator is already opened.
712 * @leave TInt KErrArgument, if aActuator is not valid enumeration value.
714 * @see THWRMLogicalActuators for a list of usable actuators.
718 virtual void OpenActuatorL( THWRMLogicalActuators aActuator ) = 0;
721 * Method for getting a bitmask value of supported logical actuators.
723 * Developer needs to evaluate the returned bitmask against
724 * THWRMLogicalActuators enumeration values to know the
725 * supported logical actuators.
727 * @param[out] aActuators Bitmask of supported logical actuators.
729 * @return TInt KErrNone, if successful, otherwise one of the other
730 * system-wide error codes.
732 * @see THWRMLogicalActuators for a list of usable actuators.
736 virtual TInt SupportedActuators( TUint32& aActuators ) = 0;
739 * Reserves haptics feature exclusively for this client.
740 * A higher priority client may cause lower priority client reservation
741 * to be temporarily suspended. The suspended client does not get
742 * any notification about suspension. If haptics is already reserved
743 * by a higher or equal priority client, reserving still succeeds,
744 * but reservation is immediately suspended. When the reservation
745 * is suspended, playing effects do not actually cause the effects to be
747 * Note: Unless the client has instantiated the Haptics API with the status
748 * observer, it does not receive any notifications about the fact that its
749 * effects are not actually played by the physical player when the client
750 * has been suspended by a higher priority reservation.
751 * Note also that even if haptics is reserved by some client, a higher
752 * priority client succeeds in playing its effects.
754 * Calling this method is equal to call ReserveHapticsL(EFalse),
755 * i.e. foreground status is always used to control further reservations.
756 * However, this is a future feature, and not implemented in current version.
758 virtual void ReserveHapticsL() = 0;
761 * Reserves haptics feature exclusively for this client.
762 * A higher priority client may cause lower priority client reservation
763 * to be temporarily suspended. The suspended client does not get
764 * any notifications about suspension. If haptics is already reserved
765 * by a higher or equal priority client, reserving still succeeds,
766 * but reservation is immediately suspended. When the reservation
767 * is suspended, playing effects does not actually cause the effects to be
769 * Note: Unless the client has instantiated the Haptics API with the status
770 * observer, it does not receive any notifications about the fact that its
771 * effects are not actually played by the physical player when the client
772 * has been suspended by a higher priority reservation.
773 * Note also that even if haptics is reserved by some client, a higher
774 * priority client succeeds in playing its effects.
776 * @param aForceNoCCoeEnv (Note: This is a future feature, and not
777 * implemented in current version. You can think of
779 * If EFalse, then reservation requires that
780 * this client has the keyboard focus at the time of
781 * reservation and haptics is automatically
782 * released and re-reserved based on the keyboard
783 * focus status of this client.
784 * This also implies that CCoeEnv::Static() != NULL
786 * If ETrue, the client does not require CCoeEnv to
787 * be present nor does it automatically reserve or
788 * release haptics by depending on the foreground or
789 * background status of the client. Only trusted
790 * clients are allowed to set this flag to ETrue.
791 * The client application is considered trusted if
792 * it has a priority defined in haptics policy file.
793 * The policy files can be modified by S60 licensees.
795 * @leave KErrAccessDenied Parameter aForceNoCCoeEnv is ETrue
796 * and client is not trusted.
797 * @leave KErrBadHandle Parameter aForceNoCCoeEnv is EFalse
798 * and no CCoeEnv present.
799 * @leave KErrNotReady Trying to reserve while on background and parameter
800 * aForceNoCCoeEnv is EFalse.
801 * @leave KErrNoMemory There is a memory allocation failure.
803 virtual void ReserveHapticsL( TBool aForceNoCCoeEnv ) = 0;
806 * Releases haptics feature if it was previously reserved for this client.
808 * If this client has not reserved haptics feature, does nothing.
809 * If haptics is on when it is released and no other client has a suspended
810 * reservation, haptics is stopped.
812 virtual void ReleaseHaptics() = 0;
815 * This method retrieves the current haptics status.
817 * @return THWRMHapticsStatus indicating the current haptics status
819 * @see THWRMHapticsStatus
821 virtual MHWRMHapticsObserver::THWRMHapticsStatus HapticsStatus() const=0;
824 * Sets a property of the haptics.
826 * Some properties affect all haptics instances, some only
827 * the current instance of the haptics. More about that can be found
828 * in THWRMHapticsDevicePropertyTypes.
830 * @param[in] aDevicePropertyType Property type for the
831 * property to be set.
832 * @param[in] aDevicePropertyValue Value of the property to set.
834 * @return TInt KErrNone if successful, otherwise one of the other
835 * system-wide error codes.
837 * @see THWRMHapticsDevicePropertyTypes for a list of valid property types
841 virtual TInt SetDeviceProperty( TInt aDevicePropertyType,
842 TInt aDevicePropertyValue ) = 0;
847 virtual TInt SetDeviceProperty( TInt aDevicePropertyType,
848 const TDesC8& aDevicePropertyValue ) = 0;
851 * Gets a property value of the haptics.
853 * @param[in] aDevicePropertyType Property type for the property to get.
854 * @param[out] aDevicePropertyValue Reference to the variable that
855 * receives the requested property
856 * value of the device.
858 * @return TInt KErrNone if successful, otherwise one of the other
859 * system-wide error codes.
861 * @see THWRMHapticsDevicePropertyTypes for a list of the valid property
866 virtual TInt GetDeviceProperty( TInt aDevicePropertyType,
867 TInt& aDevicePropertyValue ) = 0;
872 * @return KErrNone if successful,
873 * KErrArgument if the length of the given string is less
874 * than MaxPropertyStringLength(),
875 * otherwise one of the other system-wide error codes.
877 virtual TInt GetDeviceProperty( TInt aDevicePropertyType,
878 TDes8& aDevicePropertyValue ) = 0;
881 * Gets a capability value of the haptics.
883 * @param[in] aDeviceCapabilityType Capability type of the
885 * @param[out] aDeviceCapabilityValue Reference to the variable that
886 * receives the requested capability
887 * value of the device.
889 * @return TInt KErrNone if successful,
890 * KErrNotReady if no actuator has been opened,
891 * otherwise one of the other system-wide error codes.
893 * @see THWRMHapticsDeviceCapabilityTypes
897 virtual TInt GetDeviceCapability( TInt aDeviceCapabilityType,
898 TInt& aDeviceCapabilityValue ) = 0;
903 * @return TInt KErrNone if successful,
904 * KErrNotReady if no actuator has been opened,
905 * KErrArgument if the length of the given string is less
906 * than MaxCapabilityStringLength(),
907 * otherwise one of the other system-wide error codes.
909 virtual TInt GetDeviceCapability( TInt aDeviceCapabilityType,
910 TDes8& aDeviceCapabilityValue ) = 0;
913 * Retrieves the status of an effect (playing, not playing, paused).
915 * @param[in] aEffectHandle Handle to the effect which must have been
916 * obtained by calling
917 * PlayMagSweepEffect(),
918 * PlayPeriodicEffect(),
920 * PlayEffectRepeat() or
921 * CreateStreamingEffect()
922 * @param[out] aEffectState Pointer to the variable that receives
923 * the status bits of the effect.
925 * @return TInt KErrNone if successful, otherwise one of the other
926 * system-wide error codes.
928 * @see THWRMHapticsEffectStates for a list of valid effect states.
932 virtual TInt GetEffectState( TInt aEffectHandle, TInt& aEffectState ) = 0;
935 * Creates a streaming effect.
937 * Client calls CreateStreamingEffect() to create a new streaming
938 * effect and gets a new handle for it; it should use that effect handle
939 * to play a streaming sample by calling PlayStreamingSample().
941 * @param[out] aEffectHandle Reference to the variable that receives
942 * a handle to the streaming effect.
944 * @return TInt KErrNone if successful, otherwise one of the other
945 * system-wide error codes.
949 virtual TInt CreateStreamingEffect( TInt& aEffectHandle ) = 0;
952 * Plays a streaming sample given in the parameter defining the effect.
954 * Streaming sample can only be played after calling
955 * CreateStreamingEffect() and by using the effecthandle it returns.
957 * Synchronous method returns when the haptic command has been evaluated
958 * and the return value is valid.
960 * @param[in] aEffectHandle Handle to the streaming effect to play.
961 * @param[in] aStreamingSample Reference to streaming sample data
962 * containing the definition of
963 * the effect to play.
965 * @return TInt KErrNone if successful, otherwise one of the other
966 * system-wide error codes.
967 * @return TInt KErrInUse when haptics is reserved for a higher or
968 * equal priority client.
972 virtual TInt PlayStreamingSample( TInt aEffectHandle,
973 const TDesC8& aStreamingSample ) = 0;
977 * @param[out] aStatus Request status. On completion contains:
978 * KErrNone, if successful,
979 * KErrInUse when haptics is reserved for a higher or
980 * equal priority client,
981 * otherwise one of the other system-wide error codes.
983 virtual void PlayStreamingSample( TInt aEffectHandle,
984 const TDesC8& aStreamingSample,
985 TRequestStatus& aStatus ) = 0;
988 * Plays a streaming sample with a time offset given in the parameters
989 * defining the effect.
991 * Client calls CreateStreamingEffect() to create a new streaming
992 * effect and gets a new handle for it; it should use that effect handle
993 * to play the streaming sample with this method.
995 * Synchronous method returns when the haptic command has been evaluated
996 * and the return value is valid.
998 * @param[in] aEffectHandle Handle to the streaming effect to play.
999 * @param[in] aStreamingSample Reference to streaming sample data
1000 * containing the definition of the
1002 * @param[in] aOffsetTime For aOffsetTime values that are greater than 0,
1003 * playback is delayed for aOffsetTime
1005 * For aOffsetTime values that are less than 0,
1006 * sample playback begins in offset time
1007 * in milliseconds into the current sample.
1009 * @return TInt KErrNone if successful, otherwise one of the other
1010 * system-wide error codes.
1011 * @return TInt KErrInUse when haptics is reserved for a higher or
1012 * equal priority client.
1016 virtual TInt PlayStreamingSampleWithOffset( TInt aEffectHandle,
1017 const TDesC8& aStreamingSample,
1018 TInt aOffsetTime ) = 0;
1023 * @param[out] aStatus Request status. On completion contains:
1024 * KErrNone, if successful,
1025 * KErrInUse when haptics is reserved for a higher or
1026 * equal priority client,
1027 * otherwise one of the other system-wide error codes.
1029 virtual void PlayStreamingSampleWithOffset( TInt aEffectHandle,
1030 const TDesC8& aStreamingSample,
1032 TRequestStatus& aStatus ) = 0;
1035 * Destroys a streaming effect previously created in a successful
1036 * call to CreateStreamingEffect().
1038 * @param[in] aEffectHandle Handle to the streaming effect to destroy.
1040 * @return TInt KErrNone if successful, otherwise one of the other
1041 * system-wide error codes.
1045 virtual TInt DestroyStreamingEffect( TInt aEffectHandle ) = 0;
1048 * Modifies a playing MagSweep effect.
1050 * Synchronous method returns when the haptic command has been evaluated
1051 * and the return value is valid.
1053 * @param[in] aEffectHandle Handle to the playing MagSweep effect
1054 * to modify. The handle to the effect must have
1055 * been obtained by calling
1056 * PlayMagSweepEffect(),
1058 * PlayEffectRepeat().
1059 * @param[in] aEffect Reference to a struct defining the effect parameters.
1061 * @return TInt KErrNone if successful, otherwise one of the other
1062 * system-wide error codes.
1064 * @see THWRMHapticsMagSweepEffect for effect definition.
1068 virtual TInt ModifyPlayingMagSweepEffect( TInt aEffectHandle,
1069 const CHWRMHaptics::THWRMHapticsMagSweepEffect& aEffect ) = 0;
1074 * @param[out] aStatus Request status. On completion contains:
1075 * KErrNone, if successful,
1076 * otherwise one of the other system-wide error codes.
1078 virtual void ModifyPlayingMagSweepEffect( TInt aEffectHandle,
1079 const CHWRMHaptics::THWRMHapticsMagSweepEffect& aEffect,
1080 TRequestStatus& aStatus ) = 0;
1083 * Modifies a playing periodic effect.
1085 * Synchronous method returns when the haptic command has been evaluated
1086 * and the return value is valid.
1088 * @param[in] aEffectHandle Handle to the playing periodic effect
1089 * to modify. The handle to the effect must have
1090 * been obtained by calling
1091 * PlayPeriodicEffect(),
1093 * PlayEffectRepeat().
1094 * @param[in] aEffect Reference to a struct defining the effect parameters.
1096 * @return TInt KErrNone if successful, otherwise one of the other
1097 * system-wide error codes.
1099 * @see THWRMHapticsPeriodicEffect for effect definition.
1103 virtual TInt ModifyPlayingPeriodicEffect( TInt aEffectHandle,
1104 const CHWRMHaptics::THWRMHapticsPeriodicEffect& aEffect ) = 0;
1109 * @param[out] aStatus Request status. On completion contains:
1110 * KErrNone, if successful,
1111 * otherwise one of the other system-wide error codes.
1113 virtual void ModifyPlayingPeriodicEffect( TInt aEffectHandle,
1114 const CHWRMHaptics::THWRMHapticsPeriodicEffect& aEffect,
1115 TRequestStatus& aStatus ) = 0;
1119 * Load effect data defined in effect data buffer (obtained e.g. from a
1120 * file containing the effect data).
1122 * @param[in] aData Reference to allocated effect data buffer.
1124 * @param[out] aFileHandle On return contains a handle to the passed
1125 * effect data. This handle is haptics specific,
1126 * i.e., it is not a file system handle but just
1127 * a handle to the loaded effect data buffer.
1129 * @return TInt KErrNone if successful, otherwise one of the other
1130 * system-wide error codes.
1131 * @return TInt KErrArgument if the effect data is invalid.
1135 virtual TInt LoadEffectData( const TDesC8& aData, TInt& aFileHandle ) = 0;
1138 * Delete loaded effect data referenced by file handle.
1140 * @param[in] aFileHandle Handle to file.
1142 * @return TInt KErrNone if successful, otherwise one of the other
1143 * system-wide error codes.
1147 virtual TInt DeleteEffectData( TInt aFileHandle ) = 0;
1150 * Delete all loaded effect datas.
1152 * @return TInt KErrNone if successful, otherwise one of the other
1153 * system-wide error codes.
1157 virtual TInt DeleteAllEffectData() = 0;
1160 * Plays an effect defined in loaded effect data buffer.
1162 * Synchronous method returns when the haptic command has been evaluated
1163 * and the return value is valid.
1165 * @param[in] aFileHandle Handle to the loaded effect data.
1167 * @param[in] aEffectIndex Index of the effect to play. The index of the
1168 * effect must be greater than or equal to 0 and
1169 * less than the number of effects returned by
1171 * @param[out] aEffectHandle Reference to the variable that receives
1172 * a handle to the playing effect.
1174 * @return TInt KErrNone if successful, otherwise one of the other
1175 * system-wide error codes.
1176 * @return TInt KErrInUse when haptics is reserved for a higher or
1177 * equal priority client.
1181 virtual TInt PlayEffect( TInt aFileHandle,
1183 TInt& aEffectHandle ) = 0;
1188 * @param[out] aStatus Request status. On completion contains:
1189 * KErrNone, if successful,
1190 * KErrInUse when haptics is reserved for a higher or
1191 * equal priority client,
1192 * otherwise one of the other system-wide error codes.
1194 virtual void PlayEffect( TInt aFileHandle,
1196 TInt& aEffectHandle,
1197 TRequestStatus& aStatus ) = 0;
1200 * Repeatedly plays a Timeline effect defined in loaded effect data buffer.
1202 * The current implementation of PlayEffectRepeat() repeats only
1203 * Timeline effects. If the given effect index refers to a simple effect,
1204 * PlayEffectRepeat() ignores the aRepeat parameter and plays the
1205 * simple effect once. In that case, PlayEffectRepeat() behaves
1206 * like PlayEffect(). PlayEffectRepeat() does not return a warning
1207 * when requested to repeat a simple effect.
1209 * Synchronous method returns when the haptic command has been evaluated
1210 * and the return value is valid.
1212 * @param[in] aFileHandle Handle to the loaded effect data.
1213 * @param[in] aEffectIndex Index of the effect to play. The index of the
1214 * effect must be greater than or equal to 0 and
1215 * less than the number of effects returned by
1217 * @param[in] aRepeat Number of times to repeat the effect. To play the
1218 * effect indefinitely, set aRepeat to
1219 * InfiniteRepeat(). To repeat the effect a
1220 * finite number of times, set aRepeat to a value from
1221 * 0 to InfiniteRepeat() - 1.
1222 * The effect can be repeated at most
1223 * InfiniteRepeat() - 1 times.
1224 * Setting aRepeat to 0 plays the effect once (repeats
1225 * the effect zero times) and is equivalent to calling
1227 * To stop the effect before it has
1228 * repeated the requested number of times or to stop
1229 * an effect that is playing indefinitely, call
1230 * StopPlayingEffect() or StopAllPlayingEffects()
1231 * @param[out] aEffectHandle Reference to the variable that receives
1232 * a handle to the playing effect.
1234 * @return TInt KErrNone if successful, otherwise one of the other
1235 * system-wide error codes.
1236 * @return TInt KErrInUse when haptics is reserved for a higher or
1237 * equal priority client.
1241 virtual TInt PlayEffectRepeat( TInt aFileHandle,
1244 TInt& aEffectHandle ) = 0;
1249 * @param[out] aStatus Request status. On completion contains:
1250 * KErrNone, if successful,
1251 * KErrInUse when haptics is reserved for a higher or
1252 * equal priority client,
1253 * otherwise one of the other system-wide error codes.
1255 virtual void PlayEffectRepeat( TInt aFileHandle,
1258 TInt& aEffectHandle,
1259 TRequestStatus& aStatus ) = 0;
1262 * Plays an effect defined in effect data buffer.
1264 * Synchronous method returns when the haptic command has been evaluated
1265 * and the return value is valid.
1267 * @param[in] aData Reference to effect data buffer containing the
1268 * definition of the effect to play.
1269 * @param[in] aEffectIndex Index of the effect to play. The index of the
1270 * effect must be greater than or equal to 0 and
1271 * less than the number of effects returned by
1273 * @param[out] aEffectHandle Reference to the variable that receives
1274 * a handle to the playing effect.
1276 * @return TInt KErrNone if successful, otherwise one of the other
1277 * system-wide error codes.
1278 * @return TInt KErrArgument if the data is invalid.
1279 * @return TInt KErrInUse when haptics is reserved for a higher or
1280 * equal priority client.
1284 virtual TInt PlayEffect( const TDesC8& aData,
1286 TInt& aEffectHandle ) = 0;
1291 * @param[out] aStatus Request status. On completion contains:
1292 * KErrNone, if successful,
1293 * KErrArgument, if the data is invalid,
1294 * KErrInUse when haptics is reserved for a higher or
1295 * equal priority client,
1296 * otherwise one of the other system-wide error codes.
1298 virtual void PlayEffect( const TDesC8& aData,
1300 TInt& aEffectHandle,
1301 TRequestStatus& aStatus ) = 0;
1304 * Repeatedly plays a Timeline effect defined in effect data buffer.
1306 * The current implementation of PlayEffectRepeat() repeats only
1307 * Timeline effects. If the given effect index refers to a simple effect,
1308 * PlayEffectRepeat() ignores the aRepeat parameter and plays the
1309 * simple effect once. In that case, PlayEffectRepeat() behaves
1310 * similarly to PlayEffect(). PlayEffectRepeat() does not return a warning
1311 * when requested to repeat a simple effect.
1313 * Synchronous method returns when the haptic command has been evaluated
1314 * and the return value is valid.
1316 * @param[in] aData Reference to effect data buffer containing the
1317 * definition of the effect to play.
1318 * @param[in] aEffectIndex Index of the effect to play. The index of the
1319 * effect must be greater than or equal to 0 and
1320 * less than the number of effects returned by
1322 * @param[in] aRepeat Number of times to repeat the effect. To play the
1323 * effect indefinitely, set aRepeat to
1324 * InfiniteRepeat(). To repeat the effect a
1325 * finite number of times, set aRepeat to a value from
1326 * 0 to InfiniteRepeat() - 1. The effect can
1327 * be repeated at most InfiniteRepeat() - 1
1329 * Setting aRepeat to 0 plays the effect once (repeats
1330 * the effect zero times) and is equivalent to calling
1332 * To stop the effect before it has
1333 * repeated the requested number of times or to stop
1334 * an effect that is playing indefinitely, call
1335 * StopPlayingEffect() or StopAllPlayingEffects()
1336 * @param[out] aEffectHandle Reference to the variable that receives
1337 * a handle to the playing effect.
1339 * @return TInt KErrNone if successful, otherwise one of the other
1340 * system-wide error codes.
1341 * @return TInt KErrArgument if the data is invalid.
1342 * @return TInt KErrInUse when haptics is reserved for a higher or
1343 * equal priority client.
1347 virtual TInt PlayEffectRepeat( const TDesC8& aData,
1350 TInt& aEffectHandle )=0;
1355 * @param[out] aStatus Request status. On completion contains:
1356 * KErrNone, if successful,
1357 * KErrArgument, if the data is invalid,
1358 * KErrInUse when haptics is reserved for a higher or
1359 * equal priority client,
1360 * otherwise one of the other system-wide error codes.
1362 virtual void PlayEffectRepeat( const TDesC8& aData,
1365 TInt& aEffectHandle,
1366 TRequestStatus& aStatus )=0;
1369 * Plays a MagSweep effect given in the parameters defining the effect.
1371 * Synchronous method returns when the haptic command has been evaluated
1372 * and the return value is valid.
1374 * @param[in] aEffect Reference to a struct defining the effect parameters.
1375 * @param[out] aEffectHandle Reference to the variable that receives
1376 * a handle to the playing effect.
1378 * @return TInt KErrNone if successful, otherwise one of the other
1379 * system-wide error codes.
1380 * @return TInt KErrInUse when haptics is reserved for a higher or
1381 * equal priority client.
1383 * @see THWRMHapticsMagSweepEffect for effect definition.
1387 virtual TInt PlayMagSweepEffect(
1388 const CHWRMHaptics::THWRMHapticsMagSweepEffect& aEffect,
1389 TInt& aEffectHandle ) = 0;
1394 * @param[out] aStatus Request status. On completion contains:
1395 * KErrNone, if successful,
1396 * KErrInUse when haptics is reserved for a higher or
1397 * equal priority client,
1398 * otherwise one of the other system-wide error codes.
1400 virtual void PlayMagSweepEffect(
1401 const CHWRMHaptics::THWRMHapticsMagSweepEffect& aEffect,
1402 TInt& aEffectHandle,
1403 TRequestStatus& aStatus ) = 0;
1406 * Plays a Periodic effect given in the parameters defining the effect.
1408 * Synchronous method returns when the haptic command has been evaluated
1409 * and the return value is valid.
1411 * @param[in] aEffect Reference to a struct defining the effect parameters.
1412 * @param[out] aEffectHandle Reference to the variable that receives
1413 * a handle to the playing effect.
1415 * @return TInt KErrNone if successful, otherwise one of the other
1416 * system-wide error codes.
1417 * @return TInt KErrInUse when haptics is reserved for a higher or
1418 * equal priority client.
1420 * @see THWRMHapticsPeriodicEffect for effect definition.
1424 virtual TInt PlayPeriodicEffect(
1425 const CHWRMHaptics::THWRMHapticsPeriodicEffect& aEffect,
1426 TInt& aEffectHandle ) = 0;
1431 * @param[out] aStatus Request status. On completion contains:
1432 * KErrNone, if successful,
1433 * KErrInUse when haptics is reserved for a higher or
1434 * equal priority client,
1435 * otherwise one of the other system-wide error codes.
1437 virtual void PlayPeriodicEffect(
1438 const CHWRMHaptics::THWRMHapticsPeriodicEffect& aEffect,
1439 TInt& aEffectHandle,
1440 TRequestStatus& aStatus ) = 0;
1443 * Pauses a playing effect.
1445 * @param[in] aEffectHandle Handle to the playing effect to pause.
1446 * The handle to the effect must have been
1447 * obtained by calling
1448 * PlayMagSweepEffect(),
1449 * PlayPeriodicEffect() ,
1451 * PlayEffectRepeat() or
1452 * CreateStreamingEffect().
1454 * @return TInt KErrNone if successful, otherwise one of the other
1455 * system-wide error codes.
1459 virtual TInt PausePlayingEffect( TInt aEffectHandle ) = 0;
1462 * Resumes playback on a paused effect from the point where
1463 * the effect was paused.
1465 * Depending on the available slots, it is possible that all simple
1466 * effects from a paused effect data buffer or streaming sample cannot
1467 * be resumed. The API returns success when it is able to play one of
1468 * these simple effects.
1470 * @param[in] aEffectHandle Handle to the paused effect to resume.
1471 * The handle to the effect must have been
1472 * obtained by calling
1473 * PlayMagSweepEffect(),
1474 * PlayPeriodicEffect(),
1476 * PlayEffectRepeat() or
1477 * CreateStreamingEffect().
1479 * @return TInt KErrNone if successful, otherwise one of the other
1480 * system-wide error codes.
1484 virtual TInt ResumePausedEffect( TInt aEffectHandle ) = 0;
1487 * Stops a playing effect.
1489 * @param[in] aEffectHandle Handle to the playing effect to stop.
1490 * The handle to the effect must have been
1491 * obtained by calling
1492 * PlayMagSweepEffect(),
1493 * PlayPeriodicEffect(),
1495 * PlayEffectRepeat() or
1496 * CreateStreamingEffect().
1498 * @return TInt KErrNone if successful, otherwise one of the other
1499 * system-wide error codes.
1503 virtual TInt StopPlayingEffect( TInt aEffectHandle ) = 0;
1506 * Stops all playing and paused effects of a haptics instance.
1508 * @return TInt KErrNone if successful, otherwise one of the other
1509 * system-wide error codes.
1513 virtual TInt StopAllPlayingEffects() = 0;
1516 * Get a number of effects defined in a loaded effect data buffer.
1518 * @param[in] aFileHandle Handle to the loaded effect data buffer.
1519 * @param[out] aCount Number of effects in the effect data buffer.
1521 * @return TInt KErrNone if successful, otherwise one of the other
1522 * system-wide error codes.
1526 virtual TInt GetEffectCount ( TInt aFileHandle,
1527 TInt& aCount ) const = 0;
1530 * Get the duration of an effect defined in a loaded effect data buffer.
1532 * @param[in] aFileHandle Handle to the loaded effect data buffer.
1533 * @param[in] aEffectIndex Effect for which the duration is wanted.
1534 * @param[out] aEffectDuration Reference to the variable that receives
1535 * the requested effect's duration value.
1536 * Duration is in milliseconds.
1538 * @return TInt KErrNone if successful, otherwise one of the other
1539 * system-wide error codes.
1542 virtual TInt GetEffectDuration ( TInt aFileHandle,
1544 TInt& aEffectDuration ) const = 0;
1547 * Gets the index of an effect defined in a loaded effect data buffer
1548 * from the name of the effect.
1550 * @param[in] aFileHandle Handle to the loaded effect data buffer.
1551 * @param[in] aEffectName Name of the effect for which the index is wanted.
1552 * @param[out] aEffectIndex Reference to the variable that receives
1553 * the requested effect's index value.
1555 * @return TInt KErrNone if successful, otherwise one of the other
1556 * system-wide error codes.
1560 virtual TInt GetEffectIndexFromName ( TInt aFileHandle,
1561 const TDesC8& aEffectName,
1562 TInt& aEffectIndex ) const = 0;
1565 * Gets the type of an effect defined in loaded effect data buffer.
1567 * @param[in] aFileHandle Handle to loaded effect data buffer.
1568 * @param[in] aEffectIndex Index of an effect for which a type is wanted.
1569 * @param[out] aEffectType Reference to the variable that receives
1570 * the requested effect's type value.
1572 * @return TInt KErrNone if successful, otherwise one of the other
1573 * system-wide error codes.
1577 virtual TInt GetEffectType( TInt aFileHandle,
1579 TInt& aEffectType ) const = 0;
1582 * Gets the name of an effect defined in a loaded effect data buffer.
1584 * @param[in] aFileHandle Handle to the loaded effect data buffer.
1585 * @param[in] aEffectIndex Index of an effect for which a name is wanted.
1586 * @param[out] aEffectName Reference to the variable that receives
1587 * the requested effect's name. Note that the
1588 * descriptor's size must be at least the size
1589 * given from MaxPropertyStringLength().
1591 * @return TInt KErrNone if successful, otherwise one of the other
1592 * system-wide error codes.
1596 virtual TInt GetEffectName( TInt aFileHandle,
1598 TDes8& aEffectName ) const = 0;
1601 * Gets the parameters of a MagSweep effect defined in a loaded effect data
1604 * @param[in] aFileHandle Handle to the loaded effect data buffer.
1605 * @param[in] aEffectIndex Index of an effect for which a definition is
1607 * @param[out] aEffect Reference to the variable that receives
1608 * the effect definition.
1610 * @return TInt KErrNone if successful, otherwise one of the other
1611 * system-wide error codes.
1613 * @see THWRMHapticsMagSweepEffect for effect definition.
1617 virtual TInt GetMagSweepEffectDefinition(
1620 CHWRMHaptics::THWRMHapticsMagSweepEffect& aEffect ) const = 0;
1623 * Gets the parameters of a periodic effect defined in a loaded effect data
1626 * @param[in] aFileHandle Handle to the loaded effect data buffer.
1627 * @param[in] aEffectIndex Index of an effect for which a definition is wanted.
1628 * @param[out] aEffect Reference to the variable that receives
1629 * the effect definition.
1631 * @return TInt KErrNone if successful, otherwise one of the other
1632 * system-wide error codes.
1634 * @see THWRMHapticsPeriodicEffect for effect definition.
1638 virtual TInt GetPeriodicEffectDefinition(
1641 CHWRMHaptics::THWRMHapticsPeriodicEffect& aEffect ) const = 0;
1644 * Gets the value that represents infinite repeats. Method may be used
1645 * only after an actuator has been opened successfully.
1647 * @return TInt Value that represents infinite repeats. KErrNotReady, if
1648 * an actuator has not been opened.
1650 virtual TInt InfiniteRepeat() const = 0;
1653 * Gets the value that represents infinite duration. Method may be used
1654 * only after an actuator has been opened successfully.
1656 * @return TInt Value that represents infinite duration. KErrNotReady, if
1657 * an actuator has not been opened.
1659 virtual TInt InfiniteDuration() const = 0;
1662 * Gets the maximum length of an effect name stored in a loaded
1663 * effect data file. Method may be used only after an actuator
1664 * has been opened successfully.
1666 * @return TInt Maximum effect name length. KErrNotReady, if
1667 * an actuator has not been opened.
1669 virtual TInt MaxEffectNameLength() const = 0;
1672 * Gets the maximum device name length. Method may be used
1673 * only after an actuator has been opened successfully.
1675 * @return TInt Maximum device name length. KErrNotReady, if
1676 * an actuator has not been opened.
1678 virtual TInt MaxDeviceNameLength() const = 0;
1681 * Gets the maximum capability string length. Method may be used
1682 * only after an actuator has been opened successfully.
1684 * @return TInt Maximum capability string length. KErrNotReady, if
1685 * an actuator has not been opened.
1687 virtual TInt MaxCapabilityStringLength() const = 0;
1690 * Gets the maximum property string length. Method may be used
1691 * only after an actuator has been opened successfully.
1693 * @return TInt Maximum property string length. KErrNotReady, if
1694 * an actuator has not been opened.
1696 virtual TInt MaxPropertyStringLength() const = 0;
1699 * Gets the maximum streaming sample size. Method may be used
1700 * only after an actuator has been opened successfully.
1702 * @return TInt Maximum streaming sample size. KErrNotReady, if
1703 * an actuator has not been opened.
1705 virtual TInt MaxStreamingSampleSize() const = 0;
1708 * Gets the default device priority. Method may be used
1709 * only after an actuator has been opened successfully.
1711 * @return TInt Default device property. KErrNotReady, if
1712 * an actuator has not been opened.
1714 virtual TInt DefaultDevicePriority() const = 0;