Nokia N97 SDK
Example Applications Guide

AudioStreamView.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : AudioStreamView.h
00004 *  Part of     : AudioStream
00005 *  Created     : April 28, 2006 by Forum Nokia
00006 *  Description : Declares the container controller for AudioStream application
00007 *  Version     : 2.0
00008 *
00009 *  Copyright (c) 2006 - 2007 Nokia Corporation.
00010 *  This material, including documentation and any related
00011 *  computer programs, is protected by copyright controlled by
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 #ifndef AUDIOSTREAMVIEW_H
00017 #define AUDIOSTREAMVIEW_H
00018 
00019 // INCLUDES
00020 #include <coecntrl.h>
00021 #include <eiklabel.h>           // for example label control
00022 #include "AudioStreamEngine.h"
00023    
00024 // FORWARD DECLARATIONS
00025 class CAudioStreamEngine;
00026 
00027 // CLASS DECLARATION
00028 
00029 /**
00030 *  CAudioStreamView  container control class.
00031 *  
00032 */
00033 class CAudioStreamView : public CCoeControl, MCoeControlObserver
00034 {
00035 public: 
00036 
00037 /*!
00038  * NewL()
00039  * 
00040  * discussion Create new CAudioStreamView object, being able to draw 
00041  *    itself into aRect
00042  *
00043  * param aRect the rectangle this view will be drawn to
00044  * param aEngine the engine which core logic is used by this simple view
00045  * return a pointer to the created instance of CAudioStreamView
00046  */
00047     static CAudioStreamView* NewL(const TRect& aRect, 
00048                 CAudioStreamEngine* aEngine);
00049 
00050 /*!
00051  * NewLC()
00052  * 
00053  * discussion Create new CAudioStreamView object, being able to draw
00054  *    itself into aRect
00055  *
00056  * param aRect the rectangle this view will be drawn to
00057  * return a pointer to the created instance of CAudioStreamView 
00058  *    which has also been pushed to cleanup stack
00059  */
00060     static CAudioStreamView* NewLC(const TRect& aRect, 
00061                 CAudioStreamEngine* aEngine);
00062 
00063 
00064 /*!
00065  * ~CAudioStreamView()
00066  *
00067  * discussion Destroy the object and release all memory objects
00068  */
00069         ~CAudioStreamView();
00070         
00071 public: // New functions
00072 
00073 /*!
00074  * ShowMessageL()
00075  *
00076  * discussion Displays application messages for user
00077  *
00078  * param aMsg text to be displayed
00079  */
00080         void ShowMessageL(const TDesC& /* aMsg */);
00081 
00082 public: // Functions from base classes
00083 
00084 private: // Basic two-phase EPOC constructors
00085 
00086 /*!
00087  * ConstructL()
00088  *
00089  * discussion Perform the second phase construction of a CAudioStreamView
00090  *    object
00091  *
00092  * param aRect Frame rectangle for container.
00093  */
00094     void ConstructL(const TRect& aRect, CAudioStreamEngine* aEngine);
00095  
00096 /*!
00097  * CAudioStreamView()
00098  *
00099  * discussion Perform the first phase of two phase construction 
00100  */
00101     CAudioStreamView();
00102 
00103 private: // Functions from base classes
00104 
00105    /**
00106     * From CoeControl,SizeChanged.
00107     */
00108     void SizeChanged();
00109 
00110    /**
00111     * From CoeControl,HandleResourceChange.
00112     */
00113         void HandleResourceChange(TInt aType);
00114 
00115    /**
00116     * From CoeControl,CountComponentControls.
00117     */
00118     TInt CountComponentControls() const;
00119 
00120    /**
00121     * From CCoeControl,ComponentControl.
00122     */
00123     CCoeControl* ComponentControl(TInt aIndex) const;
00124 
00125    /**
00126     * From CCoeControl,Draw.
00127     */
00128     void Draw(const TRect& aRect) const;
00129 
00130     
00131         /**
00132         * From MCoeControlObserver
00133         * Acts upon changes in the hosted control's state. 
00134         *
00135         * param aControl the control changing its state
00136         * param aEventType the type of control event 
00137         */
00138     void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
00139     
00140 private: // New functions
00141     
00142         
00143 private: // data members
00144 
00145         // Reference for engine object
00146         CAudioStreamEngine* iEngine;            
00147         // Label displaying the application messages to user
00148         CEikLabel* iLabel;
00149         
00150 };
00151 
00152 #endif
00153 
00154 // End of File
00155 
00156 

© Nokia 2009

Back to top