idlehomescreen/widgetmanager/inc/wmmaincontainer.h
branchRCL_3
changeset 28 d721605b30d0
parent 26 1b758917cafc
equal deleted inserted replaced
26:1b758917cafc 28:d721605b30d0
    26 #include <coecntrl.h>
    26 #include <coecntrl.h>
    27 #include <AknsUtils.h>
    27 #include <AknsUtils.h>
    28 #include <gulicon.h>
    28 #include <gulicon.h>
    29 #include <eiklbo.h>  // MEikListBoxObserver
    29 #include <eiklbo.h>  // MEikListBoxObserver
    30 #include <aknsfld.h>  // MAdaptiveSearchTextObserver
    30 #include <aknsfld.h>  // MAdaptiveSearchTextObserver
       
    31 #include "wmwidgetloaderao.h"
    31 
    32 
    32 // FORWARD DECLARATIONS
    33 // FORWARD DECLARATIONS
    33 class CWmPlugin;
    34 class CWmPlugin;
    34 class CWmListBox;
    35 class CWmListBox;
    35 class CAknsBasicBackgroundControlContext;
    36 class CAknsBasicBackgroundControlContext;
    36 class CAknViewAppUi;
    37 class CAknViewAppUi;
    37 class CAknSearchField;
    38 class CAknSearchField;
    38 class CCoeControl;
    39 class CCoeControl;
    39 class CAknSearchField;
    40 class CAknSearchField;
    40 class CWmPortalButton;
    41 class CWmPortalButton;
    41 class CWmWidgetLoaderAo;
       
    42 class CWmMainContainerView;
    42 class CWmMainContainerView;
    43 class CWmConfiguration;
    43 class CWmConfiguration;
    44 
    44 
    45 /**
    45 /**
    46  * Container class for WmMainContainer
    46  * Container class for WmMainContainer
    47  * 
    47  * 
    48  * @class	CWmMainContainer WmMainContainer.h
    48  * @class    CWmMainContainer WmMainContainer.h
    49  */
    49  */
    50 NONSHARABLE_CLASS( CWmMainContainer ) : public CCoeControl,
    50 NONSHARABLE_CLASS( CWmMainContainer ) : public CCoeControl,
    51                                         public MEikListBoxObserver,
    51                                         public MEikListBoxObserver,
    52                                         public MAdaptiveSearchTextObserver
    52                                         public MAdaptiveSearchTextObserver,
    53 	{
    53                                         public MWmWidgetloaderObserver
       
    54     {
    54 public: // constructors and destructor
    55 public: // constructors and destructor
    55 	
    56     
    56     /*
    57     /*
    57      * Two-phased constructor.
    58      * Two-phased constructor.
    58      * 
    59      * 
    59      * @param aRect container rect
    60      * @param aRect container rect
    60      * @param aWmPlugin wm plugin
    61      * @param aWmPlugin wm plugin
    61      */
    62      */
    62 	static CWmMainContainer* NewL( 
    63     static CWmMainContainer* NewL( 
    63 		const TRect& aRect,
    64         const TRect& aRect,
    64 		CWmPlugin& aWmPlugin );
    65         CWmPlugin& aWmPlugin );
    65 
    66 
    66     /*
    67     /*
    67      * Two-phased constructor.
    68      * Two-phased constructor.
    68      * 
    69      * 
    69      * @param aRect container rect
    70      * @param aRect container rect
    70      * @param aWmPlugin wm plugin
    71      * @param aWmPlugin wm plugin
    71      */
    72      */
    72 	static CWmMainContainer* NewLC( 
    73     static CWmMainContainer* NewLC( 
    73 		const TRect& aRect,
    74         const TRect& aRect,
    74 		CWmPlugin& aWmPlugin );	
    75         CWmPlugin& aWmPlugin );    
    75 
    76 
    76 	 /** Destructor */
    77     /** Destructor */
    77 	virtual ~CWmMainContainer();
    78     virtual ~CWmMainContainer();
    78 	
    79     
    79 private:
    80 private:
    80     /** constructor */
    81     /** constructor */
    81 	CWmMainContainer(
    82     CWmMainContainer(
    82 	    CWmPlugin& aWmPlugin );
    83         CWmPlugin& aWmPlugin );
    83     
    84     
    84     /** 2nd phase constructor */
    85     /** 2nd phase constructor */
    85     void ConstructL( 
    86     void ConstructL( 
    86             const TRect& aRect );
    87             const TRect& aRect );
    87 
    88 
    88 public: // new functions	
    89 public: // new functions    
    89     
    90     
    90     /** 
    91     /** 
    91      * @return true, if widgets loading operation is ongoing. 
    92      * @return true, if widgets loading operation is ongoing. 
    92      */
    93      */
    93     TBool IsLoadingWidgets();
    94     TBool IsLoadingWidgets();
   141      * executes widget details dialog launch 
   142      * executes widget details dialog launch 
   142      */
   143      */
   143     void LaunchDetailsDialogL();
   144     void LaunchDetailsDialogL();
   144 
   145 
   145     /** 
   146     /** 
   146 	 * executes widget addition to home screen 
   147      * executes widget addition to home screen 
   147 	 */
   148      */
   148 	void AddWidgetToHomeScreenL();
   149     void AddWidgetToHomeScreenL();
   149 	
   150     
   150 	/** 
   151     /** 
   151 	 * executes widget launch 
   152      * executes widget launch 
   152 	 */
   153      */
   153 	void LaunchWidgetL();
   154     void LaunchWidgetL();
   154 	
   155     
   155 	/** 
   156     /** 
   156 	 * executes findbox activation 
   157      * executes findbox activation 
   157 	 */
   158      */
   158 	void ActivateFindPaneL( TBool aActivateAdaptive = EFalse );
   159     void ActivateFindPaneL( TBool aActivateAdaptive = EFalse );
   159 
   160 
   160     /** 
   161     /** 
   161 	 * executes findbox deactivation 
   162      * executes findbox deactivation 
   162 	 */
   163      */
   163     void DeactivateFindPaneL(TBool aLayout = ETrue);
   164     void DeactivateFindPaneL(TBool aLayout = ETrue);
   164 	
   165     
   165     /** 
   166     /** 
   166      * sorts the widget list in alphabetical order
   167      * sorts the widget list in alphabetical order
   167      */
   168      */
   168     void SortListAlphabeticallyL();
   169     void SortListAlphabeticallyL();
   169 
   170 
   170 	/** 
   171     /** 
   171 	 * executes widget uninstall 
   172      * executes widget uninstall 
   172 	 */
   173      */
   173 	void UninstallWidgetL();
   174     void UninstallWidgetL();
   174 
   175 
   175     /**
   176     /**
   176      * opens currently selected portal
   177      * opens currently selected portal
   177      */
   178      */
   178     void OpenPortalL();
   179     void OpenPortalL();
   190     /** 
   191     /** 
   191      * handles situation when widget list has changed.
   192      * handles situation when widget list has changed.
   192      * in practice reloads the widget list from the widgets API
   193      * in practice reloads the widget list from the widgets API
   193      * and redraws the screen.
   194      * and redraws the screen.
   194      */
   195      */
   195 	void HandleWidgetListChanged();
   196     void HandleWidgetListChanged();
   196 
   197 
   197 public:
   198 public:
   198 
   199 
   199 	/**
   200     /**
   200      * Handles focus changed events.
   201      * Handles focus changed events.
   201      *
   202      *
   202      * @see CCoeControl::FocusChanged
   203      * @see CCoeControl::FocusChanged
   203      */    
   204      */    
   204     void FocusChanged( TDrawNow aDrawNow );    
   205     void FocusChanged( TDrawNow aDrawNow );    
   205 	
   206     
   206     /**
   207     /**
   207      * Handles key events.
   208      * Handles key events.
   208      * 
   209      * 
   209      * @see CCoeControl::OfferKeyEventL
   210      * @see CCoeControl::OfferKeyEventL
   210      */
   211      */
   211 	TKeyResponse OfferKeyEventL( 
   212     TKeyResponse OfferKeyEventL( 
   212 			const TKeyEvent& aKeyEvent, 
   213             const TKeyEvent& aKeyEvent, 
   213 			TEventCode aType );
   214             TEventCode aType );
   214 	
   215     
   215 	/**
   216     /**
   216 	 * Handles a change to the control's resources
   217      * Handles a change to the control's resources
   217 	 * 
   218      * 
   218 	 * @see CCoeControl::HandleResourceChange
   219      * @see CCoeControl::HandleResourceChange
   219 	 */
   220      */
   220 	void HandleResourceChange( TInt aType );
   221     void HandleResourceChange( TInt aType );
   221 	
   222     
   222 	/**
   223     /**
   223 	 * Handles pointer events.
   224      * Handles pointer events.
   224 	 * 
   225      * 
   225 	 * @see CCoeControl::HandlePointerEventL
   226      * @see CCoeControl::HandlePointerEventL
   226 	 */
   227      */
   227 	void HandlePointerEventL( const TPointerEvent& aPointerEvent );
   228     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
   228 	
   229     
   229 	/**
   230     /**
   230 	 * Moves focus to the OVI button
   231      * Moves focus to the OVI button
   231 	 * @param aIndex 0=first button, 1=second (if it exists)
   232      * @param aIndex 0=first button, 1=second (if it exists)
   232 	 */
   233      */
   233     void SetFocusToPortalButton( TInt aIndex );
   234     void SetFocusToPortalButton( TInt aIndex );
   234 
   235 
   235     /**
   236     /**
   236      * Moves focus to the widgets list, alternatively also setting the currently
   237      * Moves focus to the widgets list, alternatively also setting the currently
   237      * selected item.
   238      * selected item.
   334     TKeyResponse HandleSearchKeyEventL( 
   335     TKeyResponse HandleSearchKeyEventL( 
   335             const TKeyEvent& aKeyEvent, 
   336             const TKeyEvent& aKeyEvent, 
   336             TEventCode aType );
   337             TEventCode aType );
   337     TInt OperatorButtonHigherPriority( TInt aIndex );
   338     TInt OperatorButtonHigherPriority( TInt aIndex );
   338     
   339     
       
   340 public: // from MWmWidgetloaderObserver
       
   341     void LoadDoneL( TBool aWidgetListChanged );
       
   342     
   339 private:
   343 private:
   340 
   344 
   341     /**
   345     /**
   342      * the plugin root
   346      * the plugin root
   343      */
   347      */
   347      * the widgets list
   351      * the widgets list
   348      */
   352      */
   349     CWmListBox*             iWidgetsList;
   353     CWmListBox*             iWidgetsList;
   350 
   354 
   351     /**
   355     /**
   352 	 * search filed
   356      * search filed
   353 	 */
   357      */
   354     CAknSearchField* 		iFindbox;
   358     CAknSearchField*         iFindbox;
   355     
   359     
   356     /**
   360     /**
   357 	 * search filed visibility switch
   361      * search filed visibility switch
   358 	 */
   362      */
   359     TBool            		iFindPaneIsVisible;
   363     TBool                    iFindPaneIsVisible;
   360     
   364     
   361     /**
   365     /**
   362      * background
   366      * background
   363      */
   367      */
   364     CAknsBasicBackgroundControlContext* iBgContext;
   368     CAknsBasicBackgroundControlContext* iBgContext;