1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/touchfeedbackspec.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,111 @@
1.4 +/*
1.5 +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: Container for composit feedback types.
1.18 +* Part of: Tactile Feedback.
1.19 +*
1.20 +*/
1.21 +
1.22 +#ifndef C_FEEDBACKSPEC_H
1.23 +#define C_FEEDBACKSPEC_H
1.24 +
1.25 +#include <e32base.h>
1.26 +#include <touchlogicalfeedback.h>
1.27 +
1.28 +
1.29 +// Container for one event/feedback type pair
1.30 +struct TTactileFbItem
1.31 + {
1.32 + TTouchEventType iEventType;
1.33 + TTouchLogicalFeedback iFeedback;
1.34 + TTouchFeedbackType iFeedbackType;
1.35 + };
1.36 +
1.37 +/**
1.38 + * Contains feedback types used for setting feedback area
1.39 + *
1.40 + * This class acts as container for event/feedback type pairs. These pairs
1.41 + * define what kind of feedback is producent when area is touched.
1.42 + *
1.43 + * @lib touchfeedback.lib
1.44 + * @since S60 5.2
1.45 + */
1.46 +class CFeedbackSpec: public CBase
1.47 + {
1.48 +public:
1.49 + /**
1.50 + * Instantiation method.
1.51 + *
1.52 + * @since S60 5.2
1.53 + * @return New CFeedbackSpec instance.
1.54 + */
1.55 + IMPORT_C static CFeedbackSpec* New();
1.56 +
1.57 + /**
1.58 + * Destructor.
1.59 + *
1.60 + * @since S60 5.2
1.61 + */
1.62 + virtual ~CFeedbackSpec();
1.63 +
1.64 + /**
1.65 + * Adds event/feedback type pair to feedback spec
1.66 + *
1.67 + * @since S60 5.2
1.68 + * @param aEventType - Touch event type.
1.69 + * @param aFeedback - Logical feedback type.
1.70 + * @return KErrNone, or one of standard Symbian OS error codes.
1.71 + */
1.72 + IMPORT_C TInt AddFeedback( TTouchEventType aEventType,
1.73 + TTouchLogicalFeedback aFeedback );
1.74 +
1.75 + /**
1.76 + * Gets defined event/feedback type pairs
1.77 + *
1.78 + * @since S60 5.2
1.79 + * @param aArray - Event/feedback type pairs is returned here.
1.80 + */
1.81 + IMPORT_C void GetFeedbackSpec( RArray<TTactileFbItem>& aArray );
1.82 +
1.83 + /**
1.84 + * Adds event/feedback type pair to feedback spec.
1.85 + * Using this overload it is possible to define only one feedback type
1.86 + * (vibra/audio) for event.
1.87 + *
1.88 + * @since S60 5.2
1.89 + * @param aEventType - Touch event type.
1.90 + * @param aFeedback - Logical feedback type.
1.91 + * @param aFeedbackType - Bitmask to define feedback type (vibra/audio).
1.92 + * @return KErrNone, or one of standard Symbian OS error codes.
1.93 + */
1.94 + IMPORT_C TInt AddFeedback( TTouchEventType aEventType,
1.95 + TTouchLogicalFeedback aFeedback,
1.96 + TTouchFeedbackType aFeedbackType );
1.97 +
1.98 +
1.99 +private:
1.100 + /**
1.101 + * Constructor.
1.102 + */
1.103 + CFeedbackSpec();
1.104 +
1.105 +private: // data
1.106 +
1.107 + /**
1.108 + * Array for event type/feedback type pairs
1.109 + * Own.
1.110 + */
1.111 + RArray<TTactileFbItem> iFbArray;
1.112 + };
1.113 +
1.114 +#endif // C_FEEDBACKSPEC_H