locationlandmarksrefappfors60/Inc/LandmarksContainerBase.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2004-2005 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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *     See class description below
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __LANDMARKS_CONTAINER_BASE_H__
       
    21 #define __LANDMARKS_CONTAINER_BASE_H__
       
    22 
       
    23 
       
    24 #include "LandmarksOperationObserver.h"
       
    25 #include "LandmarksDbObserver.h"
       
    26 #include <coecntrl.h>
       
    27 
       
    28 
       
    29 class CAknView;
       
    30 class CLandmarksApplicationEngine;
       
    31 class CLandmarksListBox;
       
    32 class CAknSearchField;
       
    33 
       
    34 
       
    35 
       
    36 /**
       
    37 *  CLandmarksContainerBase is an abstrct class that contains functions and data
       
    38 *  common for all view containers in this application.
       
    39 */
       
    40 class CLandmarksContainerBase :
       
    41     public CCoeControl,
       
    42     public MLandmarksDbObserver,
       
    43     public MLandmarksOperationObserver
       
    44     {
       
    45     public: // Constructors and destructor
       
    46 
       
    47         /**
       
    48         *  Destructor
       
    49         */
       
    50         ~CLandmarksContainerBase();
       
    51 
       
    52     public: // New functions
       
    53 
       
    54         /**
       
    55         * Indicates whether a listbox item is selected or not.
       
    56         */
       
    57         TBool IsItemSelected();
       
    58 
       
    59     public: // from CoeControl
       
    60 
       
    61         /**
       
    62         * Gets the number of controls contained in a compound control
       
    63         *
       
    64         * @return Number of component controls
       
    65         */
       
    66         TInt CountComponentControls() const;
       
    67 
       
    68         /**
       
    69         * Gets the specified component
       
    70         *
       
    71         * @param aIndex specification for component pointer
       
    72         * @return Pointer to component control
       
    73         */
       
    74         CCoeControl* ComponentControl(TInt aIndex) const;
       
    75 
       
    76         /**
       
    77         * Called by framework when the view size is changed.
       
    78         */
       
    79         void SizeChanged();
       
    80         
       
    81         /** Reacts to screen size change */
       
    82         void HandleResourceChange( TInt aType );
       
    83 
       
    84     public: // From MLandmarksDbObserver
       
    85 
       
    86         /**
       
    87         * Notifies that an event has occurred in the default
       
    88         * landmark database.
       
    89         *
       
    90         * @param aEvent contains info about the event.
       
    91         * @param aErrorCode possible error codes if reporting the event was
       
    92         * not successful.
       
    93         */
       
    94         void NotifyDbEventL(TPosLmEvent& aEvent, TInt aErrorCode) = 0;
       
    95 
       
    96     public: // From MLandmarksOperationObserver
       
    97 
       
    98         /**
       
    99         * Notifies the progress and status of an
       
   100         * asynchronous operation.
       
   101         *
       
   102         * @param aOperation the type of operation that is reported.
       
   103         * @param aProgress the progress of the operation.
       
   104         * @param aErrorCode the status of the operation.
       
   105         */
       
   106         void NotifyOperationProgressL(
       
   107             TOperation aOperation,
       
   108             TInt aProgress,
       
   109             TInt aErrorCode) = 0;
       
   110 
       
   111     protected: // Constructors
       
   112 
       
   113         /**
       
   114         * C++ default constructor.
       
   115         *
       
   116         * @param aView The parent view.
       
   117         * @param aEngine The application engine.
       
   118         */
       
   119         CLandmarksContainerBase(
       
   120             CAknView& aView,
       
   121             CLandmarksApplicationEngine& aEngine);
       
   122 
       
   123         /**
       
   124         * Performs the second phase construction of a
       
   125         * CLandmarksContainerBase object. Should be called by subclasses.
       
   126         *
       
   127         * @param aRect Frame rectangle for container.
       
   128         */
       
   129         void ConstructL(const TRect& aRect);
       
   130 
       
   131     private:
       
   132 
       
   133         /**
       
   134         * Creates the find box.
       
   135         */
       
   136         void CreateFindBoxL();
       
   137 
       
   138         /**
       
   139         * Creates the listbox.
       
   140         */
       
   141         void CreateListBoxL();
       
   142 
       
   143     protected: // Data
       
   144 
       
   145         //! the control used to display icons and descriptors.
       
   146         CLandmarksListBox* iListBox;
       
   147 
       
   148         //! the control used to display a search field.
       
   149         CAknSearchField* iFindBox;
       
   150 
       
   151         //! parent view
       
   152         CAknView& iView;
       
   153 
       
   154         //! the application engine used for accessing landmarks
       
   155         CLandmarksApplicationEngine& iEngine;
       
   156 
       
   157         //! a buffer containing the last descriptor in the find box.
       
   158         HBufC* iOldFilter;
       
   159 
       
   160     };
       
   161 
       
   162 #endif // __LANDMARKS_CONTAINER_BASE_H__
       
   163