widgetmanager/inc/wmwidgetloaderao.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2009 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 * CWmIconFileProvider declaration
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef WMWIDGETLOADERAO_H_
       
    20 #define WMWIDGETLOADERAO_H_
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CWmPlugin;
       
    27 class CWmListBox;
       
    28 class CHsContentInfo;
       
    29 class CWmWidgetData;
       
    30 class CWmPersistentWidgetOrder;
       
    31 class RWidgetRegistryClientSession;
       
    32 
       
    33 // CLASS DECLARATIONS
       
    34 
       
    35 /**
       
    36  * CWmWidgetLoaderAo
       
    37  */
       
    38 NONSHARABLE_CLASS( CWmWidgetLoaderAo ) : public CAsyncOneShot
       
    39     {
       
    40     
       
    41 public:
       
    42 	/**
       
    43      * Static constructor
       
    44      */
       
    45 	static CWmWidgetLoaderAo* NewL(
       
    46 	        CWmPlugin& aWmPlugin,
       
    47 	        CWmListBox& aTargetList );
       
    48 	
       
    49     /**
       
    50      * Destructor.
       
    51      */
       
    52 	~CWmWidgetLoaderAo();
       
    53 
       
    54     /**
       
    55      * Starts the load process by activating the AO
       
    56      */
       
    57     void StartLoading();
       
    58     
       
    59 private:
       
    60     
       
    61     /**
       
    62      * Constructor
       
    63      */
       
    64     CWmWidgetLoaderAo(
       
    65             CWmPlugin& aWmPlugin,
       
    66             CWmListBox& aTargetList );
       
    67     
       
    68     /**
       
    69      * 2nd phase constructor
       
    70      */
       
    71     void ConstructL();
       
    72 
       
    73 protected: // from CActive
       
    74     
       
    75     /**
       
    76      * AO body
       
    77      */
       
    78     void RunL();
       
    79 
       
    80     /**
       
    81      * AO error handler
       
    82      */
       
    83     TInt RunError( TInt aError );
       
    84 
       
    85 private:
       
    86 
       
    87     /**
       
    88      * loads widgets into the listbox
       
    89      */
       
    90     void DoLoadWidgetsL();
       
    91 
       
    92     /**
       
    93      * finds a widget data entry from iWidgetsList that matches
       
    94      * given content info. returns a pointer to the data found,
       
    95      * or NULL if not found
       
    96      */
       
    97     CWmWidgetData* FindWidgetData( CHsContentInfo& aContentInfo );
       
    98     
       
    99     /**
       
   100      * adds a widget data entry to iWidgetsList
       
   101      */
       
   102     void AddWidgetDataL( CHsContentInfo& aContentInfo );
       
   103     
       
   104     /**
       
   105      * cleanup resources allocated runing one single run
       
   106      */
       
   107     void Cleanup();
       
   108     
       
   109 private: // data
       
   110 
       
   111     /** reference to the widget manager root */
       
   112     CWmPlugin& iWmPlugin;
       
   113 
       
   114     /** target where widgets are to be loaded */
       
   115     CWmListBox& iWidgetsList;
       
   116     
       
   117     /** widget registry */
       
   118     RWidgetRegistryClientSession* iWidgetRegistry;
       
   119     
       
   120     /** persistent widget order */
       
   121     CWmPersistentWidgetOrder* iWidgetOrder;
       
   122     
       
   123     };
       
   124 
       
   125 #endif // WMWIDGETLOADERAO_H_