S60 3rd Edition SDK for Symbian OS
Example Applications Guide

LandmarksContainerBase.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : LandmarksContainerBase.h
00004 *  Part of     : Landmark Reference Application
00005 *  Interface   : -
00006 *  Description : See class description below
00007 *  Version     : 1.0
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 #ifndef __LANDMARKS_CONTAINER_BASE_H__
00017 #define __LANDMARKS_CONTAINER_BASE_H__
00018 
00019 // INCLUDES
00020 #include "LandmarksOperationObserver.h"
00021 #include "LandmarksDbObserver.h"
00022 #include <coecntrl.h>
00023 
00024 // FORWARD DECLARATIONS
00025 class CAknView;
00026 class CLandmarksApplicationEngine;
00027 class CLandmarksListBox;
00028 class CAknSearchField;
00029 
00030 // CLASS DECLARATION
00031 
00032 /**
00033 *  CLandmarksContainerBase is an abstrct class that contains functions and data
00034 *  common for all view containers in this application.
00035 */
00036 class CLandmarksContainerBase :
00037     public CCoeControl,
00038     public MLandmarksDbObserver,
00039     public MLandmarksOperationObserver
00040     {
00041     public: // Constructors and destructor
00042 
00043         /**
00044         *  Destructor
00045         */
00046         ~CLandmarksContainerBase();
00047 
00048     public: // New functions
00049 
00050         /**
00051         * Indicates whether a listbox item is selected or not.
00052         */
00053         TBool IsItemSelected();
00054 
00055     public: // from CoeControl
00056 
00057         /**
00058         * Gets the number of controls contained in a compound control
00059         *
00060         * @return Number of component controls
00061         */
00062         TInt CountComponentControls() const;
00063 
00064         /**
00065         * Gets the specified component
00066         *
00067         * @param aIndex specification for component pointer
00068         * @return Pointer to component control
00069         */
00070         CCoeControl* ComponentControl(TInt aIndex) const;
00071 
00072         /**
00073         * Called by framework when the view size is changed.
00074         */
00075         void SizeChanged();
00076         
00077         /** Reacts to screen size change */
00078         void HandleResourceChange(TInt aType);
00079 
00080     public: // From MLandmarksDbObserver
00081 
00082         /**
00083         * Notifies that an event has occurred in the default
00084         * landmark database.
00085         *
00086         * @param aEvent contains info about the event.
00087         * @param aErrorCode possible error codes if reporting the event was
00088         * not successful.
00089         */
00090         void NotifyDbEventL(TPosLmEvent& aEvent, TInt aErrorCode) = 0;
00091 
00092     public: // From MLandmarksOperationObserver
00093 
00094         /**
00095         * Notifies the progress and status of an
00096         * asynchronous operation.
00097         *
00098         * @param aOperation the type of operation that is reported.
00099         * @param aProgress the progress of the operation.
00100         * @param aErrorCode the status of the operation.
00101         */
00102         void NotifyOperationProgressL(
00103             TOperation aOperation,
00104             TInt aProgress,
00105             TInt aErrorCode) = 0;
00106 
00107     protected: // Constructors
00108 
00109         /**
00110         * C++ default constructor.
00111         *
00112         * @param aView The parent view.
00113         * @param aEngine The application engine.
00114         */
00115         CLandmarksContainerBase(
00116             CAknView& aView,
00117             CLandmarksApplicationEngine& aEngine);
00118 
00119         /**
00120         * Performs the second phase construction of a
00121         * CLandmarksContainerBase object. Should be called by subclasses.
00122         *
00123         * @param aRect Frame rectangle for container.
00124         */
00125         void ConstructL(const TRect& aRect);
00126 
00127     private:
00128 
00129         /**
00130         * Creates the find box.
00131         */
00132         void CreateFindBoxL();
00133 
00134         /**
00135         * Creates the listbox.
00136         */
00137         void CreateListBoxL();
00138 
00139     protected: // Data
00140 
00141         //! the control used to display icons and descriptors.
00142         CLandmarksListBox* iListBox;
00143 
00144         //! the control used to display a search field.
00145         CAknSearchField* iFindBox;
00146 
00147         //! parent view
00148         CAknView& iView;
00149 
00150         //! the application engine used for accessing landmarks
00151         CLandmarksApplicationEngine& iEngine;
00152 
00153         //! a buffer containing the last descriptor in the find box.
00154         HBufC* iOldFilter;
00155 
00156     };
00157 
00158 #endif // __LANDMARKS_CONTAINER_BASE_H__
00159 
00160 // End of File
00161 

© Nokia 2006

Back to top