hwrmhaptics/examples/hapticstestapp/inc/hapticstestappview.h
changeset 76 cb32bcc88bad
equal deleted inserted replaced
73:d38941471f1c 76:cb32bcc88bad
       
     1 /*
       
     2 * Copyright (c) 2007 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 the License "Symbian Foundation License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  AppView class definition.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __HAPTICSTEST_APPVIEW_H__
       
    20 #define __HAPTICSTEST_APPVIEW_H__
       
    21 
       
    22 #include <coecntrl.h>
       
    23 
       
    24 class CRichText;
       
    25 class CParaFormatLayer;
       
    26 class CCharFormatLayer;
       
    27 class CEikRichTextEditor;
       
    28 
       
    29 /**
       
    30  * An instance of the Application View object for the hapticstest 
       
    31  * example application
       
    32  */
       
    33 class CHapticsTestAppView : public CCoeControl
       
    34     {
       
    35 public:
       
    36 
       
    37    /**
       
    38     * Create a ChapticstestAppView object, which will draw itself to aRect
       
    39     *
       
    40     * @param aRect the rectangle this view will be drawn to
       
    41     * @return a pointer to the created instance of ChapticstestAppView
       
    42     */
       
    43     static CHapticsTestAppView* NewL( const TRect& aRect );
       
    44 
       
    45    /**
       
    46     * Create a ChapticstestAppView object, which will draw itself to aRect
       
    47     *
       
    48     * @param aRect the rectangle this view will be drawn to
       
    49     * @return a pointer to the created instance of ChapticstestAppView
       
    50     */
       
    51     static CHapticsTestAppView* NewLC( const TRect& aRect );
       
    52 
       
    53    /**
       
    54     * Destroy the object and release all memory objects
       
    55     */
       
    56     ~CHapticsTestAppView();
       
    57 
       
    58    /**
       
    59     * Output the given line of text to the user.
       
    60     *
       
    61     * @param aOutputLine Text to be added to the end of the output.
       
    62     * @param aLineBreak Whether or not to add line break to the end
       
    63     *  of the print. By default the break is inserted.
       
    64     */
       
    65     void InsertOutput( const TDesC& aOutputLine, 
       
    66                        TBool aLineBreak = ETrue ) const;
       
    67 
       
    68    /**
       
    69     * Clears the output view.
       
    70     */
       
    71     void ClearOutput() const;
       
    72 
       
    73 public:  // from CCoeControl
       
    74 
       
    75    /**
       
    76     * Draw this ChapticstestAppView to the screen
       
    77     *
       
    78     * @param aRect the rectangle of this view that needs updating
       
    79     */
       
    80     void Draw(const TRect& aRect) const;
       
    81 
       
    82    /**
       
    83     * @see CCoeControl
       
    84     */
       
    85     virtual void SizeChanged();
       
    86 
       
    87 private:
       
    88 
       
    89    /**
       
    90     * Perform the second phase construction of a ChapticstestAppView object
       
    91     *
       
    92     * @param aRect the rectangle this view will be drawn to
       
    93     */
       
    94     void ConstructL(const TRect& aRect);
       
    95 
       
    96    /**
       
    97     * Perform the first phase of two phase construction 
       
    98     */
       
    99     CHapticsTestAppView();
       
   100 
       
   101 private:
       
   102 
       
   103     CParaFormatLayer*   iParaFormat;
       
   104     CCharFormatLayer*   iCharFormat;
       
   105     CRichText*          iRichText;
       
   106     CEikRichTextEditor* iOutputWindow;
       
   107     };
       
   108 
       
   109 
       
   110 #endif // __HAPTICSTEST_APPVIEW_H__