epoc32/include/mw/touchfeedbackspec.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
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.
williamr@4
     1
/*
williamr@4
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     3
* All rights reserved.
williamr@4
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@4
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     8
*
williamr@4
     9
* Initial Contributors:
williamr@4
    10
* Nokia Corporation - initial contribution.
williamr@4
    11
*
williamr@4
    12
* Contributors:
williamr@4
    13
*
williamr@4
    14
* Description:  Container for composit feedback types.
williamr@4
    15
* Part of:      Tactile Feedback.
williamr@4
    16
*
williamr@4
    17
*/
williamr@4
    18
williamr@4
    19
#ifndef C_FEEDBACKSPEC_H
williamr@4
    20
#define C_FEEDBACKSPEC_H
williamr@4
    21
williamr@4
    22
#include <e32base.h>
williamr@4
    23
#include <touchlogicalfeedback.h>
williamr@4
    24
williamr@4
    25
williamr@4
    26
//  Container for one event/feedback type pair 
williamr@4
    27
struct TTactileFbItem
williamr@4
    28
    {
williamr@4
    29
    TTouchEventType       iEventType;
williamr@4
    30
    TTouchLogicalFeedback iFeedback;
williamr@4
    31
    TTouchFeedbackType    iFeedbackType;
williamr@4
    32
    };
williamr@4
    33
williamr@4
    34
/**
williamr@4
    35
 *  Contains feedback types used for setting feedback area
williamr@4
    36
 *
williamr@4
    37
 *  This class acts as container for event/feedback type pairs. These pairs
williamr@4
    38
 *  define what kind of feedback is producent when area is touched.
williamr@4
    39
 *
williamr@4
    40
 *  @lib touchfeedback.lib
williamr@4
    41
 *  @since S60 5.2
williamr@4
    42
 */
williamr@4
    43
class CFeedbackSpec: public CBase
williamr@4
    44
    {
williamr@4
    45
public:
williamr@4
    46
    /**
williamr@4
    47
     * Instantiation method.
williamr@4
    48
     *
williamr@4
    49
     * @since S60 5.2
williamr@4
    50
     * @return New CFeedbackSpec instance.
williamr@4
    51
     */
williamr@4
    52
    IMPORT_C static CFeedbackSpec* New();
williamr@4
    53
williamr@4
    54
    /**
williamr@4
    55
     * Destructor.
williamr@4
    56
     *
williamr@4
    57
     * @since S60 5.2
williamr@4
    58
     */
williamr@4
    59
    virtual ~CFeedbackSpec();
williamr@4
    60
    
williamr@4
    61
    /**
williamr@4
    62
     * Adds event/feedback type pair to feedback spec
williamr@4
    63
     *
williamr@4
    64
     * @since S60 5.2
williamr@4
    65
     * @param aEventType - Touch event type.
williamr@4
    66
     * @param aFeedback  - Logical feedback type.
williamr@4
    67
     * @return KErrNone, or one of standard Symbian OS error codes.
williamr@4
    68
     */
williamr@4
    69
    IMPORT_C TInt AddFeedback( TTouchEventType aEventType, 
williamr@4
    70
                               TTouchLogicalFeedback aFeedback );
williamr@4
    71
    
williamr@4
    72
    /**
williamr@4
    73
     * Gets defined event/feedback type pairs
williamr@4
    74
     *
williamr@4
    75
     * @since S60 5.2
williamr@4
    76
     * @param aArray - Event/feedback type pairs is returned here.
williamr@4
    77
     */
williamr@4
    78
    IMPORT_C void GetFeedbackSpec( RArray<TTactileFbItem>& aArray );
williamr@4
    79
    
williamr@4
    80
    /**
williamr@4
    81
     * Adds event/feedback type pair to feedback spec.
williamr@4
    82
     * Using this overload it is possible to define only one feedback type
williamr@4
    83
     * (vibra/audio) for event.
williamr@4
    84
     *
williamr@4
    85
     * @since S60 5.2
williamr@4
    86
     * @param aEventType - Touch event type.
williamr@4
    87
     * @param aFeedback  - Logical feedback type.
williamr@4
    88
     * @param aFeedbackType - Bitmask to define feedback type (vibra/audio).
williamr@4
    89
     * @return KErrNone, or one of standard Symbian OS error codes.
williamr@4
    90
     */
williamr@4
    91
    IMPORT_C TInt AddFeedback( TTouchEventType aEventType, 
williamr@4
    92
                               TTouchLogicalFeedback aFeedback,
williamr@4
    93
                               TTouchFeedbackType aFeedbackType );    
williamr@4
    94
williamr@4
    95
williamr@4
    96
private:
williamr@4
    97
    /**
williamr@4
    98
     * Constructor.
williamr@4
    99
     */
williamr@4
   100
    CFeedbackSpec();
williamr@4
   101
williamr@4
   102
private: // data
williamr@4
   103
williamr@4
   104
    /**
williamr@4
   105
     * Array for event type/feedback type pairs
williamr@4
   106
     * Own.
williamr@4
   107
     */
williamr@4
   108
    RArray<TTactileFbItem> iFbArray;  
williamr@4
   109
    };
williamr@4
   110
  
williamr@4
   111
#endif //  C_FEEDBACKSPEC_H