uifw/AvKon/inc/AknSignalIcon.h
changeset 0 2f259fa3e83a
child 6 9f56a4e1b8ab
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2004-2007 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 icon indicator on the status pane's
       
    15 *                signal pane.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef AKNSIGNALICON_H
       
    21 #define AKNSIGNALICON_H
       
    22 
       
    23 #include <coecntrl.h>
       
    24 
       
    25 /**
       
    26 * Signal icon control for the status pane's signal pane.
       
    27 * This control is also used in the universal status indicator popup's
       
    28 * signal pane.
       
    29 * The control loads and draws signal icon indicator graphics.
       
    30 *
       
    31 * @lib avkon.lib
       
    32 */
       
    33 NONSHARABLE_CLASS( CAknSignalIcon ) : public CCoeControl
       
    34 	{
       
    35 public:
       
    36   
       
    37     /**
       
    38     * Destructor.
       
    39     */
       
    40     ~CAknSignalIcon();
       
    41     
       
    42     /**
       
    43     * Two-phased constructor.
       
    44     */
       
    45     static CAknSignalIcon* NewL();
       
    46     
       
    47     /**
       
    48     * Two-phased constructor.
       
    49     */
       
    50     static CAknSignalIcon* NewLC();
       
    51     
       
    52     /**
       
    53     * Set a custom signal icon.
       
    54     *
       
    55     * @param  aIcon  The new icon to be set.
       
    56     */
       
    57     void SetSignalIcon( CFbsBitmap* aIcon );
       
    58     
       
    59     /**
       
    60     * Set a mask for the custom signal icon.
       
    61     *
       
    62     * @param  aMask  The new mask to be set.
       
    63     */
       
    64     void SetSignalIconMask( CFbsBitmap* aMask );
       
    65     
       
    66     /**
       
    67     * Set the draw blanker state, which controls whether
       
    68     * or not the icon is drawn.
       
    69     *
       
    70     * @param  aDrawBlank  New draw blanker state,
       
    71     *                     @c EFalse to draw the signal icon,
       
    72     *                     @c ETrue otherwise.
       
    73     */
       
    74     void SetDrawBlank( TBool aDrawBlank );
       
    75     
       
    76     /**
       
    77     * Gets the current draw blanker state.
       
    78     *
       
    79     * @return  The state of draw blanker.
       
    80     */
       
    81     TBool DrawBlank();
       
    82 
       
    83     /**
       
    84     * Sets the offline state.
       
    85     * If offline state is on, then the icon is not drawn,
       
    86     * unless offline icon visiblity is set on with
       
    87     * @c SetOffLineIconDraw().
       
    88     *
       
    89     * @param  aOffLine  New offline state.
       
    90     */
       
    91     void SetOffLine( TBool aOffLine );
       
    92 
       
    93     /**
       
    94     * Gets the current offline state.
       
    95     *
       
    96     * @return  The offline state.
       
    97     */
       
    98     TBool OffLine();
       
    99 
       
   100     /**
       
   101     * Sets the color index to be used when loading
       
   102     * the signal icon.
       
   103     *
       
   104     * @param  aColorIndex  The color index to be set.
       
   105     */
       
   106     void SetColorIndex( TInt aColorIndex );
       
   107     
       
   108     /**
       
   109     * Returns the current signal icon color index.
       
   110     *
       
   111     * @return  The color index.
       
   112     */
       
   113     TInt ColorIndex();
       
   114     
       
   115     /**
       
   116     * Loads the signal icon to be displayed.
       
   117     * 
       
   118     * @param  aIconState       ID of the signal state, @see signal indicator
       
   119     *                          states in @c avkon.hrh.
       
   120     * @param  aIconColorIndex  Color index of the icon.
       
   121     * @param  aForceLoad       Forces the loading of the signal icon,
       
   122     *                          even if it's already loaded.
       
   123     */
       
   124     void LoadIconL( TInt aIconState,
       
   125                     TInt aIconColorIndex,
       
   126                     TBool aForceLoad = EFalse );
       
   127     
       
   128     /**
       
   129     * Sets whether or not a signal icon is drawn
       
   130     * in offline state.
       
   131     *
       
   132     * @param  aOn  @c ETrue to draw offline icon, @c EFalse otherwise.
       
   133     */
       
   134     void SetOffLineIconDraw( TBool aOn );
       
   135     
       
   136 protected: // From base class @c CCoeControl.
       
   137 
       
   138     /**
       
   139     * From @c CCoeControl.
       
   140     * Handles size change events.
       
   141     */
       
   142     void SizeChanged();
       
   143 
       
   144     /**
       
   145     * From @c CCoeControl.
       
   146     * Handles position change events.
       
   147     */
       
   148 	void PositionChanged();
       
   149 
       
   150     /**
       
   151      * From @c CCoeControl.
       
   152 	 * Handles a change to the control's resources of type @c aType,
       
   153 	 * which are shared across the environment.
       
   154 	 *
       
   155 	 * @param  aType  Event type.
       
   156 	 */
       
   157 	void HandleResourceChange( TInt aType );
       
   158 
       
   159           
       
   160 private: // From base class @c CCoeControl.
       
   161     
       
   162     /**
       
   163     * From @c CCoeControl.
       
   164     * Draws the icon.
       
   165     *
       
   166     * @param  aRect  Not used.
       
   167     */
       
   168     virtual void Draw( const TRect& aRect ) const;
       
   169 
       
   170 private:
       
   171 
       
   172     /**
       
   173     * Default constructor.
       
   174     */
       
   175     CAknSignalIcon();
       
   176     
       
   177     /**
       
   178     * Second-phase constructor.
       
   179     */
       
   180     void ConstructL();
       
   181 
       
   182 private:
       
   183     
       
   184     /**
       
   185     * Signal icon.
       
   186     * Own.
       
   187     */
       
   188     CFbsBitmap* iSignalIcon;
       
   189     
       
   190     /**
       
   191     * Signal icon mask.
       
   192     * Own.
       
   193     */
       
   194     CFbsBitmap* iSignalIconMask;
       
   195     
       
   196     /** Signal icon's color index. */
       
   197 	TInt        iColorIndex;
       
   198 	
       
   199 	/** Draw blanker state. */
       
   200     TBool       iDrawBlank;
       
   201     
       
   202     /** Offline state. */
       
   203     TBool       iOffLine;
       
   204     
       
   205     /** Signal state. */
       
   206     TInt        iIconState;
       
   207     
       
   208     /** Flag defining whether or not the offline icon is drawn. */
       
   209     TBool       iShowOffLineIcon;
       
   210     };
       
   211 
       
   212 #endif // AKNSIGNALICON_H