Nokia N97 SDK
Example Applications Guide

shapelistmanager.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : shapelistmanager.h
00004 *  Part of     : GuiEngine
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 2004 - 2006 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 
00017 #ifndef __SHAPELISTMANAGER_H
00018 #define __SHAPELISTMANAGER_H
00019 
00020 
00021 // INCLUDES
00022 #include <e32std.h>
00023 #include <w32std.h>
00024 #include "shape.h"
00025 
00026 
00027 // CLASS DECLARATION
00028 
00029 /**
00030 * CShapeListManager
00031 * An instance of this class is an engine that manages a list of shapes.
00032 */
00033 class CShapeListManager : public CBase
00034     {
00035     public: // Constructors and destructor
00036 
00037         /**
00038         * NewL
00039         * Creates a new instance of the engine.
00040         * @return Returns the engine
00041         */
00042         IMPORT_C static CShapeListManager* NewL();
00043 
00044         /**
00045         * NewLC
00046         * Creates a new instance of the engine.
00047         * @return Returns the engine
00048         */
00049         IMPORT_C static CShapeListManager* NewLC();
00050 
00051 
00052         /**
00053         * ~CShapeListManager.
00054         * Virtual destructor.
00055         */
00056         IMPORT_C virtual ~CShapeListManager();
00057 
00058     public: // New functions
00059 
00060         /**
00061         * Clear
00062         * Clear the list of shapes.
00063         */
00064         IMPORT_C void Clear();
00065 
00066 
00067          /**
00068         * AddShapeL
00069         * Add a shape to the list
00070         * @param aShape the object to add to the list.
00071         */
00072         IMPORT_C void AddShapeL( NShapes::TShape* aShape );
00073 
00074 
00075         /**
00076         * GetNextShape
00077         * Returns the next shape in the list and increments
00078         * the next shape index.
00079         * @return If there is no such shape, then it returns NULL,
00080         * and resets the next shape index.
00081         */
00082         IMPORT_C NShapes::TShape* GetNextShape();
00083 
00084 
00085         /**
00086         * StoreL
00087         * Store the instance to the specified store
00088         * @param aStore the store to stream the object to
00089         * @return Returns the id of the store within the stream.
00090         */
00091         IMPORT_C TStreamId StoreL( CStreamStore& aStore ) const;
00092 
00093         /**
00094         * ExternalizeL
00095         * Virtual method that writes the shape to the specified
00096         * write stream.
00097         * @param aStream the stream to write the shape to.
00098         */
00099         IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
00100 
00101          /**
00102         * RestoreL
00103         * Restore the instance from the specified stream within
00104         * the specified store
00105         * @param aStore the store containing the data
00106         * @param aStreamId the id of the stream within the store
00107         */
00108         IMPORT_C void RestoreL( const CStreamStore& aStore,
00109                                 const TStreamId& aStreamId );
00110 
00111         /**
00112         * InternalizeL
00113         * Restore the instance from the specified stream
00114         * @param aStream the stream to stream the object from
00115         */
00116         IMPORT_C void InternalizeL( RReadStream& aStream );
00117 
00118 
00119     protected: // Constructors and destructor
00120 
00121         /**
00122         * CShapeListManager
00123         * C++ default constructor.
00124         */
00125         IMPORT_C CShapeListManager();
00126 
00127         /**
00128         * ConstructL
00129         * 2nd phase constructor.
00130         */
00131         IMPORT_C void ConstructL();
00132 
00133 
00134     private:    // Data
00135 
00136         /** iNextShapeIndex The index of the next shape **/
00137         TInt iNextShapeIndex;
00138 
00139         /** iShapeList The list of shapes   **/
00140         RPointerArray<NShapes::TShape> iShapeList;
00141     };
00142 
00143 #endif  //  __SHAPELISTMANAGER_H
00144 
00145 
00146 // End of File

© Nokia 2009

Back to top