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.
     1 /*
     2 * Copyright (c) 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:  Container for composit feedback types.
    15 * Part of:      Tactile Feedback.
    16 *
    17 */
    18 
    19 #ifndef C_FEEDBACKSPEC_H
    20 #define C_FEEDBACKSPEC_H
    21 
    22 #include <e32base.h>
    23 #include <touchlogicalfeedback.h>
    24 
    25 
    26 //  Container for one event/feedback type pair 
    27 struct TTactileFbItem
    28     {
    29     TTouchEventType       iEventType;
    30     TTouchLogicalFeedback iFeedback;
    31     TTouchFeedbackType    iFeedbackType;
    32     };
    33 
    34 /**
    35  *  Contains feedback types used for setting feedback area
    36  *
    37  *  This class acts as container for event/feedback type pairs. These pairs
    38  *  define what kind of feedback is producent when area is touched.
    39  *
    40  *  @lib touchfeedback.lib
    41  *  @since S60 5.2
    42  */
    43 class CFeedbackSpec: public CBase
    44     {
    45 public:
    46     /**
    47      * Instantiation method.
    48      *
    49      * @since S60 5.2
    50      * @return New CFeedbackSpec instance.
    51      */
    52     IMPORT_C static CFeedbackSpec* New();
    53 
    54     /**
    55      * Destructor.
    56      *
    57      * @since S60 5.2
    58      */
    59     virtual ~CFeedbackSpec();
    60     
    61     /**
    62      * Adds event/feedback type pair to feedback spec
    63      *
    64      * @since S60 5.2
    65      * @param aEventType - Touch event type.
    66      * @param aFeedback  - Logical feedback type.
    67      * @return KErrNone, or one of standard Symbian OS error codes.
    68      */
    69     IMPORT_C TInt AddFeedback( TTouchEventType aEventType, 
    70                                TTouchLogicalFeedback aFeedback );
    71     
    72     /**
    73      * Gets defined event/feedback type pairs
    74      *
    75      * @since S60 5.2
    76      * @param aArray - Event/feedback type pairs is returned here.
    77      */
    78     IMPORT_C void GetFeedbackSpec( RArray<TTactileFbItem>& aArray );
    79     
    80     /**
    81      * Adds event/feedback type pair to feedback spec.
    82      * Using this overload it is possible to define only one feedback type
    83      * (vibra/audio) for event.
    84      *
    85      * @since S60 5.2
    86      * @param aEventType - Touch event type.
    87      * @param aFeedback  - Logical feedback type.
    88      * @param aFeedbackType - Bitmask to define feedback type (vibra/audio).
    89      * @return KErrNone, or one of standard Symbian OS error codes.
    90      */
    91     IMPORT_C TInt AddFeedback( TTouchEventType aEventType, 
    92                                TTouchLogicalFeedback aFeedback,
    93                                TTouchFeedbackType aFeedbackType );    
    94 
    95 
    96 private:
    97     /**
    98      * Constructor.
    99      */
   100     CFeedbackSpec();
   101 
   102 private: // data
   103 
   104     /**
   105      * Array for event type/feedback type pairs
   106      * Own.
   107      */
   108     RArray<TTactileFbItem> iFbArray;  
   109     };
   110   
   111 #endif //  C_FEEDBACKSPEC_H