511 * @param aAudioEnabled - Give ETrue as parameter for enabling audio |
518 * @param aAudioEnabled - Give ETrue as parameter for enabling audio |
512 * feedback, and EFalse for disabling audio |
519 * feedback, and EFalse for disabling audio |
513 * feedback for this application. |
520 * feedback for this application. |
514 */ |
521 */ |
515 virtual void SetFeedbackEnabledForThisApp( TBool aVibraEnabled, |
522 virtual void SetFeedbackEnabledForThisApp( TBool aVibraEnabled, |
516 TBool aAudioEnabled ) = 0; |
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 |
517 }; |
699 }; |
518 |
700 |
519 |
701 |
520 |
702 |
521 #endif // M_TOUCHFEEDBACK_H |
703 #endif // M_TOUCHFEEDBACK_H |