Nokia N97 SDK
Example Applications Guide

sensorexampleappui.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : sensorexampleappui.h
00004 *  Part of     : sensorexample
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 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 __SENSOREXAMPLEAPPUI_H__
00017 #define __SENSOREXAMPLEAPPUI_H__
00018 
00019 // INCLUDES
00020 #include <aknappui.h>
00021 #include <sensrvchannelinfo.h>
00022 
00023 
00024 // FORWARD DECLARATIONS
00025 class CSensorExampleAppView;
00026 class CSensrvChannel;
00027 class CSensorExampleDataListener;
00028 
00029 // CLASS DECLARATION
00030 /**
00031 * CSensorExampleAppUi application UI class.
00032 * Interacts with the user through the UI and request message processing
00033 * from the handler class
00034 */
00035 class CSensorExampleAppUi : public CAknAppUi
00036     {
00037     public: // Constructors and destructor
00038 
00039        /**
00040         * ConstructL.
00041         * 2nd phase constructor.
00042         */
00043         void ConstructL();
00044 
00045        /**
00046         * CSensorExampleAppUi.
00047         * C++ default constructor. This needs to be public due to
00048         * the way the framework constructs the AppUi
00049         */
00050         CSensorExampleAppUi();
00051 
00052        /**
00053         * ~CSensorExampleAppUi.
00054         * Virtual Destructor.
00055         */
00056         virtual ~CSensorExampleAppUi();
00057 
00058     private:  // Functions from base classes
00059 
00060         /**
00061         * From CEikAppUi, HandleCommandL.
00062         * Takes care of command handling.
00063         * @param aCommand Command to be handled.
00064         */
00065         void HandleCommandL( TInt aCommand );
00066 
00067        /**
00068         *  HandleStatusPaneSizeChange.
00069         *  Called by the framework when the application status pane
00070         *  size is changed.
00071         */
00072 
00073         void HandleStatusPaneSizeChange();
00074 
00075     private:
00076 
00077        /**
00078         * Open a channel.
00079         *
00080         * @param aChannel On return contains pointer to opened channel.
00081         * @param aChannelTypeId Channel ID for the channel to be open.
00082         */
00083         void OpenChannelL( CSensrvChannel*& aChannel,
00084                            TSensrvChannelTypeId aChannelTypeId );
00085 
00086        /**
00087         * Show a property query
00088         *
00089         * @param aCommand Command to be handled.
00090         */
00091         void HandleQueryL( TInt aCommand );
00092 
00093        /**
00094         * Show information note
00095         *
00096         * @param aNoteText Text to be shown on information note.
00097         */
00098         void ShowNoteL( const TDesC& aNoteText );
00099 
00100        /**
00101         * Show content of aProperty on information note
00102         *
00103         * @param aProperty Property to be shown.
00104         */
00105         void ShowPropertyNoteL( TSensrvProperty& aProperty );
00106 
00107         /**
00108         * Show property's value.
00109         *
00110         * @param aProperty Property which value is shown.
00111         */
00112         void ShowPropertyValueNoteL( TSensrvProperty& aProperty );
00113 
00114        /**
00115         * Query new value for property
00116         *
00117         * @param aProperty Property which value is changed.
00118         * @param aChannel Channel where aProperty belongs to.
00119         */
00120         void HandlePropertyValueQueryL( TSensrvProperty& aProperty,
00121                                         CSensrvChannel* aChannel );
00122 
00123     private: // Data
00124 
00125        /**
00126         * The application view
00127         * Owned by CSensorExampleAppUi
00128         */
00129         CSensorExampleAppView* iAppView;
00130 
00131        /**
00132         * Opened sensor channels.
00133         * Owned by CSensorExampleAppUi
00134         */
00135         CSensrvChannel* iDblTapChannel;
00136         CSensrvChannel* iAccelerometerChannel;
00137         CSensrvChannel* iOrientationChannel;
00138 
00139        /**
00140         * The listener for sensor data
00141         * Owned by CSensorExampleAppUi
00142         */
00143         CSensorExampleDataListener* iDataListener;
00144     };
00145 
00146 #endif // __SENSOREXAMPLEAPPUI_H__
00147 
00148 // End of File

© Nokia 2009

Back to top