wlanutilities/wlanplugin/inc/wlanplugin.h
branchRCL_3
changeset 54 63be7eb3fc78
parent 52 b852595f5cbe
child 55 f28ada11abbf
equal deleted inserted replaced
52:b852595f5cbe 54:63be7eb3fc78
     1 /*
       
     2 * Copyright (c) 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: 
       
    15 *        Header file for CWlanPlugin class.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef __C_WLANPLUGIN_H__
       
    20 #define __C_WLANPLUGIN_H__
       
    21 
       
    22 // System includes
       
    23 #include <gsplugininterface.h>
       
    24 #include <ConeResLoader.h>
       
    25 #include <AknServerApp.h>
       
    26 
       
    27 //forward declarations
       
    28 class CAknNavigationDecorator;
       
    29 class CAknViewAppUi;
       
    30 class CAknNullService;
       
    31 class CGSParentPlugin;
       
    32 class CWlanPluginWlanState;
       
    33 
       
    34 /**
       
    35 * WLAN plugin's UID
       
    36 */
       
    37 const TUid KWlanPluginUid = { 0x10281BCA };
       
    38 
       
    39 /**
       
    40 * WlanSniffer applicatoin's UID
       
    41 */
       
    42 const TUid KSnifferAppUid = { 0x10281CAA };
       
    43 
       
    44 /**
       
    45 * WLAN plugin class.
       
    46 */
       
    47 class CWlanPlugin : public CGSPluginInterface,
       
    48                     public MAknServerAppExitObserver 
       
    49     {
       
    50     public://Constructors & destructors
       
    51 
       
    52         /**
       
    53         * First phase constructor
       
    54         * Creates new instance of CWlanPlugin 
       
    55         * @param aInitParams Initialising parameters
       
    56         * @return a plugin instance
       
    57         */ 
       
    58         static CWlanPlugin* NewL( TAny* aInitParams );
       
    59                         
       
    60         /**
       
    61         * Destructor
       
    62         */
       
    63         ~CWlanPlugin();
       
    64         
       
    65     public: // Functions from base class
       
    66         
       
    67         /**
       
    68         * From CAknView
       
    69         */
       
    70         
       
    71         /**
       
    72         * Returns the Plugin's UID
       
    73         * @return UID of the plugin
       
    74         */
       
    75         TUid Id() const;
       
    76              
       
    77         /*
       
    78         * Funtion called when This is activated.
       
    79         * @param aPrevViewId The previous View Id
       
    80         * @param aCustomMessageId Id of a custom message
       
    81         * @param aCustomMessage Content of the custom message
       
    82         */
       
    83         void DoActivateL( const TVwsViewId& aPrevViewId, 
       
    84                           TUid aCustomMessageId, 
       
    85                           const TDesC8& aCustomMessage );
       
    86         
       
    87         /*
       
    88         * Funtion called when this is deactivated.
       
    89         */
       
    90         void DoDeactivate();
       
    91 
       
    92     public:
       
    93         
       
    94         /**
       
    95         * from CGSPluginInterface
       
    96         */
       
    97 
       
    98         /*
       
    99         * Called by the CP framework. This returns the
       
   100         * caption of the plugin, the first line of the listbox
       
   101         * element of it, shown in the Control Panel UI.
       
   102         * @param aCaption The caption is copied here
       
   103         */
       
   104         void GetCaptionL( TDes& aCaption ) const;
       
   105 
       
   106         /*
       
   107         * Returns if it has bitmap.
       
   108         * @return The logical value of having birmap
       
   109         */
       
   110         TBool HasBitmap() const;
       
   111         
       
   112         /*
       
   113         * Returns a bitmap.
       
   114         * @param aBitmap the returned bitmap
       
   115         * @param aMask the returned mask of the bitmap
       
   116         */
       
   117         void GetBitmapL( CFbsBitmap* aBitmap, CFbsBitmap* aMask ) const;
       
   118         
       
   119         
       
   120         /*
       
   121         * Returns a the plugin provider's cathegory
       
   122         * @return The id of the cathegory
       
   123         */
       
   124         TInt PluginProviderCategory() const;
       
   125         
       
   126         /*
       
   127         * This function is called, when the plugin is selected.
       
   128         * In this case it starts sniffer application
       
   129         * @param aSelectionType The type of the selection
       
   130         */
       
   131         void HandleSelection( const TGSSelectionTypes aSelectionType );
       
   132           
       
   133         /*
       
   134         * Returns the type of the item.
       
   135         * @return The type of the item
       
   136         */
       
   137         TGSListboxItemTypes ItemType();
       
   138         
       
   139         /*
       
   140         * Creates the asked type icon (main icon or D column icon)
       
   141         * and returns a pointer to it.
       
   142         * @param aIconType Type of the icon
       
   143         * @return the asked icon
       
   144         */
       
   145         CGulIcon* CreateIconL( const TUid aIconType );
       
   146         
       
   147         /**
       
   148         * Method for checking, if plugin should be visible and used in GS FW.
       
   149         * (for example shown in listbox of the parent view).
       
   150         *
       
   151         * On default plugin is visible. Overwrite this function to enable or
       
   152         * disable your plugin dynamically.
       
   153         *
       
   154         * @return ETrue if plugin should be visible in GS.
       
   155         * @return EFalse if plugin should not be visible in GS.
       
   156         */
       
   157         virtual TBool Visible() const;
       
   158         
       
   159         /*
       
   160         * The aKey identified value is given back by it. Actually
       
   161         * the the second line of the listbox element of this plugin
       
   162         * is given by this function.
       
   163         * @param aKey The id of the asked value.
       
   164         * @param aValue The returned value.
       
   165         */
       
   166         void GetValue( const TGSPluginValueKeys aKey,
       
   167                           TDes& aValue );  
       
   168         
       
   169         
       
   170         void HandleServerAppExit(TInt aReason);
       
   171         
       
   172         
       
   173     protected:
       
   174     
       
   175         /**
       
   176         * Constructor
       
   177         */
       
   178         CWlanPlugin();
       
   179 
       
   180     private:
       
   181         
       
   182         /**
       
   183         * Second phase constructor
       
   184         */
       
   185         TAny ConstructL();
       
   186                
       
   187         /**
       
   188         * Opens the localized resource file 
       
   189         */
       
   190         void OpenLocalizedResourceFileL();
       
   191         
       
   192         /**
       
   193         * Launches Sniffer application 
       
   194         */
       
   195         void LaunchSnifferAppL();
       
   196               
       
   197         /**
       
   198         * Queries if wlan is supported
       
   199         * @return if the wlan is supported
       
   200         */
       
   201         TBool GetWlanSupported() const;
       
   202         
       
   203         /**
       
   204         * Shows an error note in case of error. 
       
   205         * @param aErrorCode The error code.
       
   206         */
       
   207         void ShowErrorNote(TInt aErrorCode);
       
   208 
       
   209         /**
       
   210         * Shows the error note and resolves the error.
       
   211         * @param aErrorCode The error code.
       
   212         */
       
   213         TBool ShowErrorNoteL(TInt aErrorCode);
       
   214     
       
   215         /**
       
   216         * Shows a general error note
       
   217         */
       
   218         void ShowGeneralErrorNoteL();
       
   219          
       
   220     private: //data
       
   221         
       
   222         /*
       
   223         * @var resource loader
       
   224         */
       
   225         RConeResourceLoader iResources;
       
   226         
       
   227         /*
       
   228         * @var null service
       
   229         */
       
   230         CAknNullService* iNullService;
       
   231         
       
   232         /*    
       
   233         * @var stores the present status line    
       
   234         */
       
   235         HBufC* iStatusLine;
       
   236 
       
   237         /*
       
   238         * @var wlan state handler/observer
       
   239         */
       
   240         CWlanPluginWlanState* iWlanState;       
       
   241         
       
   242     };
       
   243 
       
   244 #endif //__C_WLANPLUGIN_H__
       
   245 
       
   246 //End of file