epoc32/include/mw/touchfeedback.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Interface for using area registry and direct feedback from
    15 *                applications and UI controls.
    16 * Part of:      Tactile Feedback.
    17 *
    18 */
    19 
    20 
    21 
    22 #ifndef M_TOUCHFEEDBACK_H
    23 #define M_TOUCHFEEDBACK_H
    24 
    25 #include <e32std.h>
    26 #include <e32base.h>
    27 #include <coemain.h>
    28 
    29 #include <touchlogicalfeedback.h>
    30 #include <touchfeedbackspec.h>
    31 
    32 class CCoeControl;
    33 
    34 /**
    35  *  This is the Tactile Feedback interface for UI Controls.
    36  *
    37  *  Provides an interface to add, modify and remove feedback areas
    38  *  in the registry. There is also an option to trigger direct feedback, 
    39  *  hence bypassing the registry.
    40  *
    41  *  Feedback areas must always be related to some UI Control (derived
    42  *  from CCoeControl). Areas are distinguished from each other based on
    43  *  control's address and an index number (so that it is possible
    44  *  to register and maintain multiple areas for same control).
    45  *
    46  *  Clients must add, maintain and remove their feedback areas using this
    47  *  API according to the state changes of the application / control, and
    48  *  according to for e.g. device wide layout changes.
    49  *
    50  *  There are two cases when tactile framework automatically updates the
    51  *  feedback areas for control: Feedback is always disabled when control
    52  *  becomes dimmed and re-enabled when control becomes undimmed again.
    53  *  If control becomes invisible, then feedback areas are (temporarily)
    54  *  removed, and they will be automatically added again when control
    55  *  becomes visible again.
    56  *
    57  *  This class is not intended for derivation outside the library.
    58  *
    59  *  @lib touchfeedback.lib
    60  *  @since S60 v5.0
    61  */
    62 class MTouchFeedback
    63     {
    64 public:
    65 
    66     /**
    67      * Used for acquiring a pointer to touch feedback instance.
    68      *
    69      * Pointer is retrieved from thread local storage, and thus it is best
    70      * to store the returned pointer as member variable in case it will
    71      * be needed frequently.
    72      *
    73      * NULL is returned in case there is no instance. In that case 
    74      * CreateInstanceL -function can be used for creating a new instance.
    75      *
    76      * @since S60 5.0
    77      * @return Pointer to touch feedback instance created for this
    78      *         application process.
    79      */
    80     IMPORT_C static MTouchFeedback* Instance();
    81 
    82     /**
    83      * Creates a new touch feedback instance. The usage of
    84      * this function should only be necessary from processes which
    85      * are not GUI applications, but which still have user interface
    86      * (or want to play direct feedback).
    87      *
    88      * DestroyInstance -function must be called for deleting the instance
    89      * when it is no longer needed.
    90      *
    91      * @since S60 5.0
    92      * @return Pointer to new touch feedback instance.
    93      */
    94     IMPORT_C static MTouchFeedback* CreateInstanceL();
    95 
    96     /**
    97      * Destroys the touch feedback instance and clears pointer in 
    98      * thread local storage.
    99      *
   100      * This function must only be used in case touch feedback has been
   101      * created with CreateInstanceL -function. I.e. normal GUI applications
   102      * should never call this function.
   103      *
   104      * @since S60 5.0
   105      */
   106     IMPORT_C static void DestroyInstance();
   107 
   108     /**
   109      * This function can be used to check, whether touch feedback is
   110      * supported at all in the device.
   111      *
   112      * All the API functions can be called safely even if touch feedback
   113      * is not enabled (for e.g. in devices without touch screen). But in
   114      * some situations registry updates can require complex calculations, 
   115      * which can be skipped if touch feedback is not enabled at all.
   116      *
   117      * Notice that the settings related to touch feedback have no effect
   118      * on the behavior of this function. I.e. even if user turns touch
   119      * feedback OFF from settings, this function still returns 
   120      * ETrue. The reason for this is that registry updates must be done
   121      * anyway even if the feedback is not on for the moment, because 
   122      * user can turn it on at anytime, and it is not possible to force
   123      * an update for all applications in that case.
   124      *
   125      * @since S60 5.0
   126      * @return ETrue if touch feedback is supported in this device.
   127      */
   128     virtual TBool TouchFeedbackSupported() = 0;
   129 
   130     /**
   131      * Used for disabling or enabling feedback in the application.
   132      *
   133      * Tactile feedback is enabled by default, and thus standard 
   134      * S60 components (such as CBA, lists and options menu) automatically 
   135      * give feedback even if the application itself would make no effort 
   136      * for producing feedback.
   137      * 
   138      * For some applications (such as games) feedback might not be
   139      * wanted at all. In addition some applications may need to disable
   140      * feedback in some specific situations. For example: A camera 
   141      * application may need to disable feedback during video recording,
   142      * because otherwise feedbacks may cause disturbing sounds that 
   143      * will be recorded into the video clip.
   144      *
   145      * Notice that this function only affects direct feedback and 
   146      * area registry based feedback for this application. I.e. if this 
   147      * application is taken to background, other applications can still 
   148      * produce feedback.
   149      *
   150      * Also notice that enabling feedback doesn't still mean that feedback
   151      * would necessarily be generated, because user may have disabled the
   152      * feedback for whole device from the settings.
   153      *
   154      * @since S60 5.0
   155      * @param aEnabled - Give ETrue as parameter for enabling feedback, and
   156      *                   EFalse for disabling feedback.
   157      */
   158     virtual void SetFeedbackEnabledForThisApp( TBool aEnabled ) = 0;
   159 
   160     /**
   161      * Used to check whether feedback is enabled for this application.
   162      *
   163      * Notice that this function only returns what was given as parameter
   164      * to SetFeedbackEnabledForThisApp -function. I.e. this function
   165      * can return ETrue even if  feedback would be currently disabled
   166      * from settings.
   167      *
   168      * If only vibra or audio feedback is enabled, this function still
   169      * returns ETrue.
   170      *
   171      * @since S60 5.0
   172      * @return ETrue if feedback is enabled for this application.
   173      */
   174     virtual TBool FeedbackEnabledForThisApp() = 0;
   175 
   176     /**
   177      * Sets or updates rectangular feedback area to registry.
   178      *
   179      * If this is new area (i.e. there is not yet area with given control
   180      * address and area index in the registry), then this area will be 
   181      * added as the top priority area for its window, i.e. this
   182      * area will be hit test first when pointer event arrives. 
   183      *
   184      * Notice however, that this area will remain as top priority area only
   185      * until the next new area is added to the registry, or until 
   186      * MoveFeedbackAreaToFirstPriority -function is called. I.e. new areas
   187      * are always put on top priority, but they will only remain on top
   188      * until they will be overridden by next area.
   189      *
   190      * The control that is given as parameter should usually be the one
   191      * that is responsible of handling the pointer events on the 
   192      * corresponding feedback area.
   193      *
   194      * The area can later be identified by passing control pointer and
   195      * index as parameters to the other functions (for modifying or 
   196      * removing the feedback area). In case control only
   197      * registers one area, then index 0 can always be used. Usually most
   198      * sensible approach is to use indexes 1, 2, 3 etc. for additional 
   199      * feedback areas, but in practice any desired index values can be
   200      * used.
   201      *
   202      * Notice that if given control is dimmed, then feedback type will
   203      * be set to "None". If given control is not visible, then feedback
   204      * area will not be added to registry at all (for now). However, 
   205      * registry is automatically updated when control's dimming or 
   206      * visibility changes, so one can call this function also for
   207      * dimmed and invisible control.
   208      *
   209      * When the control given as parameter to this function is destroyed,
   210      * then the RemoveFeedbackForControl -function must be called while
   211      * giving the same control as parameter again. This is necessary
   212      * for removing all the feedback areas, and also for resetting the
   213      * state information stored by the API implementation.
   214      *
   215      * @since S60 5.0
   216      * @param aControl      - The control handling pointer events on this
   217                               feedback area.
   218      * @param aIndex        - The index number of the area to be added.
   219      * @param aRect         - The feedback area rectangle.
   220      * @param aFeedbackType - The logical feedback type given
   221      * @param aEventType    - The pointer event type that triggers the 
   222      *                        feedback (currently only ETouchEventStylusDown
   223      *                        is supported).
   224      * @return KErrNone, or one of standard Symbian OS error codes
   225      *         if setting of area to registry failed. 
   226      *         Some specific error codes:
   227      *         KErrArgument - A NULL pointer was given as first parameter, or
   228      *                        the given control does not have any window
   229      *                        associated to it.
   230      *         KErrNotSupported - Unsupported logical feedback type or
   231      *                            event type was given as parameter.
   232      */
   233     virtual TInt SetFeedbackArea( const CCoeControl* aControl, 
   234                                   TUint32 aIndex,
   235                                   TRect aRect, 
   236                                   TTouchLogicalFeedback aFeedbackType, 
   237                                   TTouchEventType aEventType ) = 0;
   238     
   239     /**
   240      * Removes feedback area from the registry.
   241      *
   242      * This function is designed to be used in case feedback areas
   243      * need to be removed elsewhere than in control's destructor. In 
   244      * control's destructor RemoveFeedbackForControl -function must be 
   245      * used instead.
   246      *
   247      * @since S60 5.0
   248      * @param aControl - The control, who has registered the area.
   249      * @param aIndex   - The index of the area to be removed.
   250      */
   251     virtual void RemoveFeedbackArea( const CCoeControl* aControl, 
   252                                      TUint32 aIndex ) = 0;
   253     
   254     /**
   255      * Removes all feedback areas of specified control from registry.
   256      *
   257      * This function also clears all related data that has been cached
   258      * by the API implementation, and thus it must always be called from 
   259      * control's destructor in case control has used any of the following 
   260      * functions:
   261      *   - SetFeedbackArea
   262      *   - EnableFeedbackForControl 
   263      *
   264      * Especially notice that it is not enough to remove all feedback areas 
   265      * individually by using RemoveFeedbackArea -function.
   266      *
   267      * The difference between this function and EnableFeedbackForControl
   268      * -function is that this function really removes all areas related
   269      * to this control from registry, whereas EnableFeedbackForControl
   270      * (when EFalse if given as parameter) only temporarily disables 
   271      * those areas.
   272      *
   273      * @since S60 5.0
   274      * @param aControl - Pointer to the control, whose area registry 
   275      *                   entries and cached information will be removed.
   276      */
   277     virtual void RemoveFeedbackForControl( const CCoeControl* aControl ) = 0;
   278 
   279     /**
   280      * Changes feedback area in the registry.
   281      *
   282      * The area must have been originally added to the registry with 
   283      * SetFeedbackArea -function, or otherwise this function will
   284      * do nothing.
   285      *
   286      * This function is intended to be used especially in 
   287      * portrait / landscape changes.
   288      *
   289      * If given CCoeControl pointer is NULL, then this function call
   290      * does nothing.
   291      *
   292      * @since S60 5.0
   293      * @param aControl - The control, who has registered the area.
   294      * @param aIndex   - The index number of the area, that will be changed.
   295      * @param aNewRect - New area rectangle for given feedback area.
   296      */
   297     virtual void ChangeFeedbackArea( const CCoeControl* aControl, 
   298                                      TUint32 aIndex, 
   299                                      TRect aNewRect ) = 0;
   300 
   301     /**
   302      * Changes feedback type in the registry.
   303      *
   304      * Feedback can be temporarily disabled by giving ETouchFeedbackNone
   305      * as parameter (although using EnableFeedbackForControl function with
   306      * parameter EFalse is usually better for this functionality).
   307      *
   308      * The area must have been originally added to the registry with 
   309      * SetFeedbackArea -function, or otherwise this function will
   310      * do nothing.
   311      *
   312      * If given control pointer is NULL, then this function call
   313      * is ignored.
   314      *
   315      * This function only changes feedback type for down event.
   316      * To change feedback types for all the events in the feedback area use
   317      * function SetFeedbackArea with CFeedbackSpec container class 
   318      * definion instead.
   319      *
   320      * @since S60 5.0
   321      * @param aControl - The control, who has registered the area.
   322      * @param aIndex   - The index number of the area, that will be changed.
   323      * @param aNewType - New feedback type for the area.
   324      */
   325     virtual void ChangeFeedbackType( const CCoeControl* aControl, 
   326                                      TUint32 aIndex, 
   327                                      TTouchLogicalFeedback aNewType ) = 0;
   328 
   329     
   330     /**
   331      * Makes the given feedback area the first priority area in the window
   332      * where it is located.
   333      *
   334      * In practice this means that this will be the first area that is 
   335      * hit tested when a pointer event arrives.
   336      *
   337      * Notice however, that this area will only keep its top priority status
   338      * until the next area is added to the registry, or until 
   339      * this function is called again for some other area. I.e. there is no 
   340      * way for giving any area a permanent status as top priority area
   341      * (Registry works as a stack, and new items are added on top).
   342      *
   343      * If given control pointer is NULL, this function call does nothing.
   344      *
   345      * @since S60 5.0
   346      * @param aControl - The control, who has registered the area.
   347      * @param aIndex   - The index number of the area, which 
   348      *                   will be prioritized.
   349      */
   350     virtual void MoveFeedbackAreaToFirstPriority( const CCoeControl* aControl, 
   351                                                   TUint32 aIndex ) = 0;
   352 
   353     /**
   354      * This function forces all registry changes made on client side to be
   355      * sent to server side immediately.
   356      *
   357      * This operation causes always immediate and synchronous client-server 
   358      * transaction, and can possibly also cause flushing of window server
   359      * client side buffer. Hence this function should only be used in case 
   360      * there is a synchronization problem so that feedback triggered from 
   361      * area registry does not correspond to the areas defined by application.
   362      *
   363      * This function is only likely to help in such situation, where this
   364      * application's active objects are running all the time for several seconds,
   365      * because in that case updates won't be transferred to server immediately.
   366      *
   367      * Calling this function has no effect in case there are no pending 
   368      * area registry updates.
   369      *
   370      * @since S60 5.0
   371      */
   372     virtual void FlushRegistryUpdates( ) = 0;
   373     
   374     /**
   375      * Gives direct feedback.
   376      *
   377      * Notice that the feedback might not be actually played, if 
   378      * for example user has disabled the feedback from the settings.
   379      *
   380      * This function always causes a synchronous client-server transaction, 
   381      * and potentially flushing of window server client-side buffer.
   382      *
   383      * @since S60 5.0
   384      * @param aType - The logical feedback type to play.
   385      */
   386     virtual void InstantFeedback( TTouchLogicalFeedback aType ) = 0;
   387 
   388     /**
   389      * Gives direct feedback if given control has not disabled it.
   390      *
   391      * This function only gives feedback, if EnableFeedbackForControl
   392      * function has NOT been called on given control with second
   393      * parameter EFalse.
   394      * 
   395      * This overload is recommended when
   396      * feedback is triggered from UI controls, because then the owner
   397      * of the control can decide whether both area registry based and
   398      * direct feedback should be enabled or not.
   399      *
   400      * If feedback is enabled for the given control, then this function 
   401      * causes a synchronous client-server transaction, 
   402      * and potentially flushing of window server client-side buffer.
   403      *
   404      * @since S60 5.0
   405      * @param aControl - The control, who wishes to play feedback.
   406      * @param aType    - The logical feedback type to play.
   407      */
   408     virtual void InstantFeedback( const CCoeControl* aControl,
   409                                   TTouchLogicalFeedback aType ) = 0;
   410                                   
   411     
   412     /**
   413      * Can be used for querying, whether given control has any feedback
   414      * areas registered.
   415      *
   416      * It does not matter whether the areas are disabled or enabled for
   417      * the moment.
   418      *
   419      * Notice that one should not usually call this function, as it
   420      * is always allowed to call for example RemoveFeedbackArea
   421      * -function without checking if the area really exists (this
   422      * is done internally in the API implementation anyway).
   423      *
   424      * @since S60 5.0
   425      * @param aControl - Pointer to the control, whose feedback is
   426      *                   queried.
   427      * @return ETrue if the given control has at least one feedback
   428      *         area defined. EFalse otherwise.
   429      */
   430     virtual TBool ControlHasFeedback( const CCoeControl* aControl ) = 0;
   431     
   432     /**
   433      * Can be used for querying, whether given control has a feedback
   434      * area defined with given index number.
   435      *
   436      * It does not matter whether the areas are disabled or enabled for
   437      * the moment.
   438      *
   439      * Notice that one should not usually call this function, as it
   440      * is always allowed to call for example RemoveFeedbackArea
   441      * -function without checking if the area really exists (this
   442      * is done internally in the API implementation anyway).
   443      *
   444      * @since S60 5.0
   445      * @param aControl - Pointer to the control, whose feedback is
   446      *                   queried.
   447      * @param aIndex   - The index number of the area which is queried.
   448      * @return ETrue if the given control has a feedback area defined
   449      *         with given index number. EFalse otherwise.
   450      */
   451     virtual TBool ControlHasFeedback( const CCoeControl* aControl, 
   452                                       TUint32 aIndex ) = 0;
   453             
   454     /**
   455      * This function enables or disables all feedback areas registered for 
   456      * the given control. Disabling also affects to the overloaded version
   457      * of InstantFeedback -function, so that feedback is not played if
   458      * the control given as parameter has its feedback disabled.
   459      *
   460      * This function can be used for temporarily disabling
   461      * the feedback for some given control. Calling with second parameter 
   462      * ETrue re-enables feedback areas, but it still does not
   463      * guarantee any feedback (control can be dimmed, invisible, of may not
   464      * even have any feedback areas registered).
   465      *
   466      * This function affects both vibra- and audio feedback.
   467      *
   468      * Any control that uses this function must call RemoveFeedbackForControl
   469      * -function in its destructor.
   470      *
   471      * @since S60 5.0
   472      * @param aControl - Pointer to control, whose feedback will be 
   473      *                   enabled or disabled according to second parameter.
   474      * @param aEnable  - Use EFalse for temporary disabling the feedback for
   475      *                   this control, and ETrue for restoring the situation
   476      *                   to normal.
   477      */
   478     virtual void EnableFeedbackForControl( const CCoeControl* aControl,
   479                                            TBool aEnable ) = 0;       
   480                                            
   481     /**
   482      * This function can be used for separately enabling or disabling audio-
   483      * and vibra feedback for the given control.
   484      *
   485      * Otherwise the function behaves in the same way as the overload with
   486      * only one TBool parameter.
   487      *
   488      * Any control that uses this function must call RemoveFeedbackForControl
   489      * -function in its destructor.
   490      *
   491      * @since S60 5.0
   492      * @param aControl - Pointer to control, whose audio- and vibra 
   493      *                   feedback will be enabled or disabled according 
   494      *                   to given parameters.
   495      * @param aEnableVibra  - Use EFalse for temporary disabling the vibra 
   496      *                        feedback for this control, and ETrue for 
   497      *                        restoring the situation to normal.
   498      * @param aEnableAudio  - Use EFalse for temporary disabling the audio 
   499      *                        feedback for this control, and ETrue for 
   500      *                        restoring the situation to normal.
   501      */
   502     virtual void EnableFeedbackForControl( const CCoeControl* aControl,
   503                                            TBool aEnableVibra,
   504                                            TBool aEnableAudio ) = 0; 
   505                                            
   506     /**
   507      * Used for disabling/enabling audio/vibra feedback in
   508      * the application.
   509      *
   510      * This is identical with the overload which has only one parameter, 
   511      * with the exception that one can disable audio and vibra feedback 
   512      * separately with this version.
   513      *
   514      * @since S60 5.0
   515      * @param aVibraEnabled - Give ETrue as parameter for enabling vibra 
   516      *                        feedback, and EFalse for disabling vibra 
   517      *                        feedback for this application.
   518      * @param aAudioEnabled - Give ETrue as parameter for enabling audio 
   519      *                        feedback, and EFalse for disabling audio
   520      *                        feedback for this application.
   521      */
   522     virtual void SetFeedbackEnabledForThisApp( TBool aVibraEnabled,
   523                                                TBool aAudioEnabled ) = 0;
   524 
   525 
   526     /**
   527      * Used to check whether audio or vibra feedback is enabled for this application.
   528      *
   529      * Notice that this function only returns what was given as parameter
   530      * to SetFeedbackEnabledForThisApp -function. I.e. this function
   531      * can return ETrue even if  feedback would be currently disabled
   532      * from settings.
   533      *
   534      * @since S60 5.2
   535      * @param aFeedbackType - Feedback type.
   536      * @return ETrue if asked feedback type is enabled for this application.
   537      */
   538     virtual TBool FeedbackEnabledForThisApp( TTouchFeedbackType aFeedbackType ) = 0;
   539     
   540     /**
   541      * Starts continuous feedback if given control has not disabled it.
   542      *
   543      * Only one continuous feedback per control can be played simultaneously.
   544      * Started feedback will be stopped automatically if application loses 
   545      * key focus or application crashes or some other control starts
   546      * continuous feedback.     
   547      * 
   548      * If StartFeedback is called again for the same control, then feedback
   549      * type and intensity are modified accordingly. This may cause a break
   550      * in the feedback effect in case feedback type changes.          
   551      *
   552      * EnableFeedbackForControl also affects to this function so that
   553      * feedback is not given if EnableFeedbackForControl
   554      * function has been called with second and third parameter EFalse.
   555      * 
   556      * @since S60 5.2
   557      * @param aControl      - The control, who wishes to play feedback.
   558      * @param aType         - The continuous feedback type to play.
   559      * @param aPointerEvent - Pointer event which triggered this feedback
   560      *                        (give NULL as parameter if no related pointer
   561      *                         event available)     
   562      * @param aIntensity    - Feedback intensity to begin with. range 0-100%. 
   563      *                        Use 50% if no reason to use other value.     
   564      * @param aTimeout      - Timeout value to automatically stop continuous 
   565      *                        feedback if there's no new Start call within the
   566      *                        timeout. Use value 0 if timeout is not used.
   567      */
   568     virtual void StartFeedback( const CCoeControl* aControl,
   569                                 TTouchContinuousFeedback aType,
   570                                 const TPointerEvent* aPointerEvent,
   571                                 TInt aIntensity,
   572                                 TTimeIntervalMicroSeconds32 aTimeout ) = 0;
   573 
   574                                 
   575     /**
   576      * This function modifies intensity of continuous feedback on the fly.
   577      *
   578      * @since S60 5.2
   579      * @param aControl      - The control which continuous feedback is modified.
   580      * @param aIntensity    - New intensity value. range 0-100%
   581      */
   582     virtual void ModifyFeedback( const CCoeControl* aControl,
   583                                  TInt aIntensity ) = 0;
   584 
   585                                  
   586     /**
   587      * This function stops continuous feedback.
   588      *
   589      * @since S60 5.2
   590      * @param aControl - The control which continuous feedback is stopped.
   591      */
   592     virtual void StopFeedback( const CCoeControl* aControl ) = 0;
   593 
   594 
   595     /**
   596      * This function enables or disables audio or/and vibra feedback in
   597      * whole device.
   598      * 
   599      * Tactile feedback is enabled by default, and thus standard 
   600      * S60 components (such as CBA, lists and options menu) automatically 
   601      * give feedback even if the application itself would make no effort 
   602      * for producing feedback.
   603      *
   604      * Requires WriteDeviceData capability
   605      *
   606      * @since S60 5.2
   607      * @param aFeedbackType - Feedback types to be enabled/disabled defined as
   608      *                        a bitmask combination of enumeration items from
   609      *                        TTouchFeedbackType
   610      * @return KErrNone, or one of standard Symbian OS error codes
   611      *         if user has not WriteDeviceData capability. 
   612      */
   613     virtual TInt SetFeedbackEnabledForDevice( TTouchFeedbackType aFeedbackType ) = 0;
   614 
   615 
   616     /**
   617      * Used to check enabled feedback types for the device.
   618      *
   619      * Notice that this function only returns what was given as parameter
   620      * to SetFeedbackEnabledForDevice -function. I.e. this function
   621      * can return ETrue even if  feedback would be currently disabled
   622      * from settings.
   623      *
   624      * @since S60 5.2
   625      * @return Enabled/disabled feedback types as bitmask combination.
   626      */
   627     virtual TTouchFeedbackType FeedbackEnabledForDevice() = 0;
   628 
   629 
   630     /**
   631      * Gives direct feedback if given control has not disabled it.
   632      *
   633      * This overload is recommended when triggered feedback is related
   634      * to pointer event. System uses aPointerEvent to avoiding
   635      * two (or more) direct feedbacks for the same pointer event.
   636      *
   637      * @since S60 5.2
   638      * @param aControl      - The control, who wishes to play feedback.
   639      * @param aType         - The logical feedback type to play.
   640      * @param aPointerEvent - pointer event which triggered this feedback.
   641      */
   642     virtual void InstantFeedback( const CCoeControl* aControl,
   643                                   TTouchLogicalFeedback aType,
   644                                   const TPointerEvent& aPointerEvent ) = 0;
   645 
   646 
   647     /**
   648      * Sets or updates rectangular feedback area to registry.
   649      *
   650      * This overload allows user to set more than one touch event types to
   651      * one feedback area. Otherwise the function behaves in the same way
   652      * as the overload with separated feedback type and event type parameters.
   653      *
   654      * @since S60 5.2
   655      * @param aControl        - The control handling pointer events on this
   656      *                          feedback area.
   657      * @param aIndex          - The index number of the area to be added.
   658      * @param aRect           - The feedback area rectangle.
   659      * @param aFeedbackSpec   - The specification how this feedback area 
   660      *                          triggers feedback for different touch events.     
   661      * @return KErrNone, or one of standard Symbian OS error codes
   662      *         if setting of area to registry failed. 
   663      *         Some specific error codes:
   664      *         KErrArgument - A NULL pointer was given as first parameter, or
   665      *                        the given control does not have any window
   666      *                        associated to it.
   667      *         KErrNotSupported - Unsupported predefined feedback profile
   668      *                            was given as parameter.
   669      */
   670     virtual TInt SetFeedbackArea( const CCoeControl* aControl, 
   671                                   TUint32 aIndex,
   672                                   TRect aRect, 
   673                                   CFeedbackSpec* aFeedbackSpec ) = 0;
   674 
   675     /**
   676      * Gives direct feedback if given control has not disabled it.
   677      *
   678      * This overload is recommended when triggered feedback is related
   679      * to pointer event. System uses aPointerEvent to avoiding
   680      * two (or more) direct feedbacks for the same pointer event. Using this 
   681      * overload it is also possible to disable unwanted feedback (vibra/audio)
   682      * by giving only wanted feedback type as parameter.
   683      *
   684      * @since S60 5.2
   685      * @param aControl      - The control, who wishes to play feedback.
   686      * @param aType         - The logical feedback type to play.
   687      * @param aFeedbackType - Feedback types to be played as a bitmask 
   688      *                        combination of enumeration items from
   689      *                        TTouchFeedbackType
   690      * @param aPointerEvent - Pointer event, which triggered this feedback.
   691      */
   692     virtual void InstantFeedback( const CCoeControl* aControl,
   693                                   TTouchLogicalFeedback aType,
   694                                   TTouchFeedbackType aFeedbackType,
   695                                   const TPointerEvent& aPointerEvent ) = 0;
   696 
   697 
   698 
   699     };
   700 
   701 
   702 
   703 #endif //  M_TOUCHFEEDBACK_H