uifw/AvKon/inc/aknindicatorpopup.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Interface for controlling the universal status
       
    15 *                indicator popup.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef C_AKNINDICATORPOPUP_H
       
    21 #define C_AKNINDICATORPOPUP_H
       
    22 
       
    23 // INCLUDES
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <coecobs.h> // MCoeControlObserver
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 
       
    30 class CAknPreviewPopUpController;
       
    31 class MAknPreviewPopUpObserver;
       
    32 class CAknIndicatorPopupContent;
       
    33 class CAknIndicatorPlugin;
       
    34 
       
    35 /**
       
    36 *  Universal status indicator popup.
       
    37 *
       
    38 *  A floating popup containing information about the active status
       
    39 *  indicators and possibly links associated with the indicators.
       
    40 *  Links are activated via touch UI.
       
    41 *
       
    42 *  @lib avkon.lib
       
    43 *  @since 5.0
       
    44 */
       
    45 NONSHARABLE_CLASS( CAknIndicatorPopup ) : public CBase,
       
    46                                           public MCoeControlObserver
       
    47     {
       
    48 public:
       
    49 
       
    50     /**
       
    51     * Two-phased constructor.
       
    52     *
       
    53     * @return New instance of @c CAknIndicatorPopup.
       
    54     */
       
    55     static CAknIndicatorPopup* NewL();
       
    56 
       
    57     /**
       
    58     * Two-phased constructor, which leaves the created instance
       
    59     * on the cleanup stack.
       
    60     *
       
    61     * @return New instance of @c CAknIndicatorPopup.
       
    62     */
       
    63     static CAknIndicatorPopup* NewLC();
       
    64 
       
    65     /**
       
    66     * Destructor.
       
    67     */
       
    68     ~CAknIndicatorPopup();
       
    69 
       
    70     /**
       
    71     * Shows the popup.
       
    72     * If it's already visible nothing happens.
       
    73     */
       
    74     void ShowPopup();
       
    75 
       
    76     /**
       
    77     * Hides the popup.
       
    78     */
       
    79     void HidePopup();
       
    80 
       
    81     /**
       
    82     * Sets the position of the popup.
       
    83     *
       
    84     * @param  aPoint  Top-right position of the popup.
       
    85     */
       
    86     void SetPosition( const TPoint& aPoint );
       
    87     /**
       
    88     * Sets the bottom-right position of the popup.
       
    89     *
       
    90     * This method should be used instead of @c SetPosition to set the popup
       
    91     * position in layouts in which the universal indicator popup is populated
       
    92     * from bottom up (i.e. when the universal indicator pane and small digital
       
    93     * clock pane are located on the bottom of the screen and the universal
       
    94     * indicator popup grows upwards when indicators are added to it.
       
    95     *
       
    96     * @param  aPoint  Bottom-right position of the popup.
       
    97     */
       
    98     void SetBottomPosition( const TPoint& aPoint );
       
    99 
       
   100     /**
       
   101     * Sets the signal icon of the popup to correspond 
       
   102     * the signal state.
       
   103     *
       
   104     * @param  aState  New signal indicator state.
       
   105     */
       
   106     void SetSignalStateL( TInt aState );
       
   107     
       
   108     /**
       
   109     * Sets the battery icon of the popup to correspond 
       
   110     * the battery state.
       
   111     *
       
   112     * @param  aState  New battery indicator state.
       
   113     */
       
   114     void SetBatteryStateL( TInt aState );
       
   115     
       
   116     /**
       
   117     * Adds an indicator item to the popup.
       
   118     *
       
   119     * @param  aIndicatorUid  UID of the indicator to be added.
       
   120     * @param  aText          Text to be displayed with the indicator icon.
       
   121     * @param  aTextType      Type of the text (link or description).
       
   122     * @param  aIcon          Indicator icon, default icon used if @c NULL.
       
   123     * @param  aPlugin        Pointer to the indicator's ECOM plugin.
       
   124     * @param  aPriority      Priority of the item. Items of lowest priority
       
   125     *                        value will be shown in the popup if all
       
   126     *                        of them do not fit.
       
   127     */
       
   128     void AddItemL( TInt aIndicatorUid,
       
   129                    const TDesC& aText,
       
   130                    TInt aTextType,
       
   131                    const CGulIcon* aIcon,
       
   132                    CAknIndicatorPlugin* aPlugin,
       
   133                    TInt aPriority );
       
   134 
       
   135     /**
       
   136     * Removes an indicator item from the popup.
       
   137     *
       
   138     * @param  aIndicatorUid  UID of the indicator to be removed.
       
   139     */
       
   140     void RemoveItem( TInt aIndicatorUid );
       
   141 
       
   142     /**
       
   143     * Informs the popup content about visibility change.
       
   144     *
       
   145     * @param  aVisible  @c ETrue if the popup is visible,
       
   146     *                   @c EFalse otherwise.
       
   147     */
       
   148     void SetContentVisible( TBool aVisible );
       
   149 
       
   150     /**
       
   151     * Sets the observer which handles the events received from
       
   152     * the preview popup controller of this popup.
       
   153     *
       
   154     * @param  aObserver  Reference to the observer.
       
   155     */
       
   156     void SetObserverL( const MAknPreviewPopUpObserver& aObserver );
       
   157 
       
   158     /**
       
   159     * Removes the observer of the preview popup controller.
       
   160     *
       
   161     * @param  aObserver  Reference to the observer.
       
   162     */
       
   163     void RemoveObserver( const MAknPreviewPopUpObserver& aObserver );
       
   164 
       
   165     /**
       
   166     * Gets pointer to the preview popup controller.
       
   167     *
       
   168     * @return  The preview popup controller.
       
   169     */
       
   170     const CAknPreviewPopUpController* Controller() const;
       
   171 
       
   172     /**
       
   173     * Updates the data shown on the popup for the specified indicator.
       
   174     *
       
   175     * @param aIndicatorUid  UID of the indicator to be updated.
       
   176     */
       
   177     void UpdatePopupIndicatorL( TInt aIndicatorUid );
       
   178 
       
   179     /**
       
   180     * Updates the data shown on the popup for all active indicators.
       
   181     */
       
   182     void UpdateAllPopupIndicatorsL();
       
   183 
       
   184 public: // From base class @c MCoeControlObserver.
       
   185 
       
   186     /**
       
   187     * Handles events received from the content.
       
   188     *
       
   189     * @param  aControl    The control that sent the event.
       
   190     * @param  aEventType  The event type.
       
   191     */
       
   192     virtual void HandleControlEventL( CCoeControl* aControl,
       
   193                                       TCoeEvent aEventType );
       
   194 
       
   195 private:
       
   196 
       
   197     /**
       
   198     * Default constructor.
       
   199     */
       
   200     CAknIndicatorPopup();
       
   201 
       
   202     /**
       
   203     * 2nd phase constructor.
       
   204     */
       
   205     void ConstructL();
       
   206 
       
   207 private: // Member data
       
   208 
       
   209     /** Top-left corner of the popup. */
       
   210     TPoint iPosition;
       
   211 
       
   212     /**
       
   213     * Controller for the actual popup.
       
   214     * Own.
       
   215     */
       
   216     CAknPreviewPopUpController* iController;
       
   217 
       
   218     /**
       
   219     * Content of the popup.
       
   220     * Own.
       
   221     */
       
   222     CAknIndicatorPopupContent* iContent;
       
   223     };
       
   224 
       
   225 #endif // C_AKNINDICATORPOPUP_H