classicui_plat/signal_pane_api/inc/aknsignal.h
changeset 0 2f259fa3e83a
child 38 c52421ed5f07
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  Control to show signal strength indicator on the
       
    15 *                status pane's signal pane.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef AKNSIGNAL_H
       
    21 #define AKNSIGNAL_H
       
    22 
       
    23 #include <coecntrl.h>
       
    24 
       
    25 class CEikImage;
       
    26 class CAknSignalPaneExtension;
       
    27 class CAknSignalIcon;
       
    28 class CAknSignalStrength;
       
    29 class CAknSignalDataObserver;
       
    30 
       
    31 /**
       
    32 * A default control in the status pane's signal pane
       
    33 * The control draws signal strength indicator graphics.
       
    34 */
       
    35 
       
    36 class CAknSignalPane : public CCoeControl
       
    37 	{
       
    38 public:
       
    39     /**
       
    40     * Standard constructor
       
    41     */
       
    42     IMPORT_C CAknSignalPane();
       
    43 
       
    44     /**
       
    45     * Destructor
       
    46     */
       
    47     IMPORT_C ~CAknSignalPane();
       
    48 
       
    49     /**
       
    50     * Resource constructor.
       
    51     * @param aReader Resource reader.
       
    52     */
       
    53     IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
       
    54 
       
    55     /**
       
    56     * Sets signal strength value to the signal indicator.
       
    57     * @param aLevel Signal strength value ( 0 - 7 ).
       
    58     */
       
    59     IMPORT_C void SetSignalLevel(TInt aLevel);
       
    60 
       
    61     /**
       
    62     * Gets signal strength value from the signal indicator.
       
    63     * @return Signal strength value ( 0 - 7 ).
       
    64     */
       
    65     TInt SignalLevel();
       
    66 
       
    67     /**
       
    68     * Gets signal state value from the signal indicator.
       
    69     * @return Signal state value.
       
    70     */
       
    71     TInt SignalState();
       
    72 
       
    73     /**
       
    74     * Disables possible icon animation.
       
    75     */
       
    76     void DisableAnimation();
       
    77     
       
    78     /** 
       
    79     * Set GPRS state. Available GRRS state are:
       
    80     * EAknSignalGprsIndicatorOff, EAknSignalGprsIndicatorAvailable,
       
    81     * EAknSignalGprsIndicatorContext, EAknSignalGprsIndicatorSuspended,
       
    82     * EAknSignalGprsIndicatorMultipdp.
       
    83     * 
       
    84     * @param aGprsIconState GPRS state.
       
    85     */
       
    86     IMPORT_C void ShowGprsIcon(TInt aGprsIconState);
       
    87 
       
    88     /**
       
    89     * Set common packet data state. Available states are:
       
    90     * EAknSignalCommonPacketDataIndicatorOff,
       
    91     * EAknSignalCommonPacketDataIndicatorAvailable,
       
    92     * EAknSignalCommonPacketDataIndicatorContext,
       
    93     * EAknSignalCommonPacketDataIndicatorSuspended,
       
    94     * EAknSignalCommonPacketDataIndicatorMultipdp.
       
    95     * 
       
    96     * @param aCommonPacketDataIconState Common packet data state.
       
    97     * @since 2.6
       
    98     */
       
    99     IMPORT_C void ShowCommonPacketDataIcon(TInt aCommonPacketDataIconState);
       
   100 
       
   101     /**
       
   102     * Set WCDMA state. Available WCDMA states are:
       
   103     * EAknSignalWcdmaIndicatorOff,
       
   104     * EAknSignalWcdmaIndicatorAvailable,
       
   105     * EAknSignalWcdmaIndicatorAttached,
       
   106     * EAknSignalWcdmaIndicatorEstablishingContext,
       
   107     * EAknSignalWcdmaIndicatorContext,
       
   108     * EAknSignalWcdmaIndicatorMultipdp
       
   109     * 
       
   110     * @param aWcdmaIconState WCDMA state.
       
   111     * @since 2.6
       
   112     */
       
   113     IMPORT_C void ShowWcdmaIcon(TInt aWcdmaIconState);
       
   114 
       
   115     /**
       
   116     * Set HSDPA state. Available HSDPA states are:
       
   117     * EAknSignalHsdpaIndicatorOff,
       
   118     * EAknSignalHsdpaIndicatorAvailable,
       
   119     * EAknSignalHsdpaIndicatorAttached,
       
   120     * EAknSignalHsdpaIndicatorEstablishingContext,
       
   121     * EAknSignalHsdpaIndicatorContext,
       
   122     * EAknSignalHsdpaIndicatorMultipdp
       
   123     * 
       
   124     * @param aHsdpaIconState HSDPA state.
       
   125     * @since 3.1
       
   126     */
       
   127     IMPORT_C void ShowHsdpaIcon(TInt aHsdpaIconState);
       
   128 
       
   129     /**
       
   130     * Set CDMA state. Available CDMA states are:
       
   131     * EAknSignalCdmaIndicatorOff,
       
   132     * EAknSignalCdmaIndicatorNoService,
       
   133     * EAknSignalCdmaIndicatorAvailable,
       
   134     * EAknSignalCdmaIndicatorNotAvailable, 
       
   135     * EAknSignalCdmaIndicatorActive,
       
   136     * EAknSignalCdmaIndicatorDormant,
       
   137     * EAknSignalCdmaIndicatorSending,
       
   138     * EAknSignalCdmaIndicatorReceiving
       
   139     *
       
   140     * @param aCdmaIconState CDMA state.
       
   141     * @since 2.7
       
   142     */
       
   143     IMPORT_C void ShowCdmaIcon(TInt aCdmaIconState);
       
   144 
       
   145     /**
       
   146     * Set EDGE (egprs) state. Available EDGE states are:
       
   147     * EAknSignalEdgeIndicatorOff,
       
   148     * EAknSignalEdgeIndicatorAvailable,
       
   149     * EAknSignalEdgeIndicatorAttached,
       
   150     * EAknSignalEdgeIndicatorEstablishingContext,
       
   151     * EAknSignalEdgeIndicatorContext,
       
   152     * EAknSignalEdgeIndicatorMultipdp
       
   153     * 
       
   154     * @param aEdgeIconState EDGE state.
       
   155     * @since 3.0
       
   156     */
       
   157     IMPORT_C void ShowEdgeIcon(TInt aEdgeIconState);
       
   158 
       
   159 
       
   160     /**
       
   161     * @deprecated
       
   162     *
       
   163     * Set the background type. This method is used by the UI framework for 
       
   164     * for syncronizing this components background type with navipane 
       
   165     * background type.
       
   166     *
       
   167     * Available backgroud types are:
       
   168     *      EAknNaviPaneBackgroundTypeNotDefined
       
   169     *      EAknNaviPaneBackgroundTypeWipe
       
   170     *      EAknNaviPaneBackgroundTypeSolid
       
   171     *
       
   172     * @param aType Background type.
       
   173     * @since 2.1
       
   174     */
       
   175     IMPORT_C void SetNaviPaneBackgroundType(TInt aType);
       
   176 
       
   177 public:
       
   178     /**
       
   179     * From CCoeControl. Handles pointer event
       
   180     * @param aPointerEvent Pointer event to be handled
       
   181     */
       
   182     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   183 
       
   184 private:
       
   185     /**
       
   186     * From CAknControl
       
   187     */
       
   188     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   189 
       
   190 protected: // From CCoeControl
       
   191 
       
   192     /**
       
   193     * From CCoeControl. Handle the size change events.
       
   194     */
       
   195     IMPORT_C void SizeChanged();
       
   196 
       
   197     /**
       
   198     * From CCoeControl. Handles the position change events.
       
   199     */
       
   200 	IMPORT_C void PositionChanged();
       
   201 
       
   202     /**
       
   203 	 * Handles a change to the control's resources of type aType
       
   204 	 * which are shared across the environment.
       
   205 	 * @param aType Event type.
       
   206 	 */
       
   207 	IMPORT_C void HandleResourceChange( TInt aType );
       
   208 
       
   209     /**
       
   210     * From CCoeControl. Returns number of controls inside the context pane control.
       
   211     * @return Number of component controls.
       
   212     */
       
   213     IMPORT_C TInt CountComponentControls() const;
       
   214 
       
   215     /**
       
   216     * From CCoeControl. Returns a control determined by control id.
       
   217     * @param anIndex Index of a control to be returned.
       
   218     * @return Pointer to control
       
   219     */
       
   220     IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
       
   221 
       
   222 private:
       
   223     IMPORT_C void ConstructL();
       
   224 
       
   225 private: // From CCoeControl
       
   226     IMPORT_C virtual void Draw(const TRect& aRect) const;
       
   227 
       
   228 private:
       
   229    	static TInt TickerCallback(TAny* aThis);
       
   230     TInt DoTick();
       
   231     void DrawInNormalStatusPane(const TRect& aRect) const;
       
   232     void DrawInSmallStatusPane(const TRect& aRect) const;
       
   233     void DrawInFlatStatusPane(const TRect& aRect) const;
       
   234     void DrawInStaconPane(const TRect& aRect) const;
       
   235     CFbsBitmap* SignalIconBitmap() const;
       
   236     CFbsBitmap* SignalIconBitmapMask() const;
       
   237     void SetContainerWindowNonFading(TBool aNonFading);    
       
   238 	void LoadSignalIconL(TInt aIconState, TInt aColorIndex);
       
   239 
       
   240 private:
       
   241     // Private flags for internal statemachines, iSpare taken into use
       
   242     TInt iPrivateFlags;
       
   243     CAknSignalIcon* iSignalIconControl;
       
   244     CAknSignalStrength* iSignalStrengthControl;
       
   245    	CPeriodic* iTicker;
       
   246     CAknSignalDataObserver* iDataObserver;
       
   247     TInt iSignalState;
       
   248 	CAknSignalPaneExtension* iExtension;
       
   249     };
       
   250 
       
   251 #endif // AKNSIGNAL_H