photosgallery/viewframework/views/cloudview/inc/glxcloudviewimp.h
branchRCL_3
changeset 60 5b3385a43d68
child 75 01504893d9cb
equal deleted inserted replaced
59:8e5f6eea9c9f 60:5b3385a43d68
       
     1 /*
       
     2 * Copyright (c) 2008-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:    Cloud view implementation
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_GLXCLOUDVIEWIMP_H
       
    22 #define C_GLXCLOUDVIEWIMP_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <AknLayout2Def.h>
       
    26 #include <alf/alfanchorlayout.h>
       
    27 #include "mglxcloudviewmskobserver.h"
       
    28 #include "mglxenterkeyeventobserver.h"
       
    29 
       
    30 #include "glxcloudview.h"  //base class
       
    31 #include "mglxcloudviewlayoutobserver.h"
       
    32 
       
    33 #include "glxtagscontextmenucontrol.h"  // MGlxItemMenuObserver
       
    34 #include "glxmmcnotifier.h"
       
    35 #include <alf/alfcompositionutility.h> // MAlfEffectObserver
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class CGlxCloudViewControl;
       
    39 
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44  *  CGlxCloudViewImp
       
    45  *  Implementation class for Cloud control
       
    46  */
       
    47 namespace Alf
       
    48 {
       
    49 class IAlfScrollBarWidget;
       
    50 class IAlfScrollBarDefaultBaseElement;
       
    51 
       
    52  
       
    53 NONSHARABLE_CLASS(CGlxCloudViewImp): public CGlxCloudView,
       
    54 									public MGlxCloudViewMskObserver,				
       
    55 									public MGlxEnterKeyEventObserver,
       
    56 									public MGlxCloudViewLayoutObserver,
       
    57 									public MGlxItemMenuObserver,
       
    58 									public MStorageNotifierObserver,
       
    59 									public CAlfEffectObserver::MAlfEffectObserver
       
    60 	{
       
    61 public:
       
    62 
       
    63 	/** 	
       
    64 	 *  @since S60 3.2
       
    65 	 *  Perform the two phase construction
       
    66 	 *  @param aMediaListFactory - Handle to the medialist provider
       
    67 	 *  @param aViewResId - Resource id of the View
       
    68 	 *  @param aTitleResId - Resource id for the Title text
       
    69 	 *  @param aEmptyListResId - Resource id for the empty listbox text
       
    70 	 *  @param aSoftKeyResId - Resource id for the softkey texts       
       
    71 	 *  @param aSoftkeyMskDisabledId -Respource id for Msk Disabled
       
    72 	 *  @return Pointer to newly created object
       
    73 	 */
       
    74 	IMPORT_C static CGlxCloudViewImp *NewL(MGlxMediaListFactory
       
    75 			*aMediaListFactory, const TDesC &aFileName, TInt aViewResId, 
       
    76 			TInt aEmptyListResId, TInt aSoftKeyResId, TInt aSoftkeyMskDisabledId);
       
    77 
       
    78 	/** 	
       
    79 	 *  @since S60 3.2
       
    80 	 *  Perform the two phase construction
       
    81 	 *  @param aMediaListFactory - Handle to the medialist provider
       
    82 	 *  @param aViewResId - Resource id of the View
       
    83 	 *  @param aTitleResId - Resource id for the Title text
       
    84 	 *  @param aEmptyListResId - Resource id for the empty listbox text
       
    85 	 *  @param aSoftKeyResId - Resource id for the softkey texts
       
    86 	 *  @param aSoftkeyMskDisabledId -Respource id for Msk Disabled
       
    87 	 *  @return Pointer to newly created object
       
    88 	 */
       
    89 	IMPORT_C static CGlxCloudViewImp *NewLC(MGlxMediaListFactory
       
    90 			*aMediaListFactory, const TDesC &aFileName, TInt aViewResId,
       
    91 			 TInt aEmptyListResId, TInt aSoftKeyResId, TInt aSoftkeyMskDisabledId);
       
    92 
       
    93 	/**
       
    94 	 * Destructor.
       
    95 	 */
       
    96 	virtual ~CGlxCloudViewImp();
       
    97 
       
    98 public: // MGlxCloudViewMskObserver
       
    99 
       
   100     /**
       
   101      * Called when msk status change is required
       
   102      * @param aDirection The direction of the focus change
       
   103      */
       
   104     void HandleMskChangedL(TBool aMskEnabled);
       
   105 public: //  MGlxEnterKeyEventObserver   
       
   106     /**
       
   107      * Called when Key Event is handled.
       
   108      */
       
   109     
       
   110     void HandleEnterKeyEventL(TInt aCommand);
       
   111     
       
   112 public: 
       
   113 		//  MGlxCloudViewLayoutObserver   
       
   114     /**
       
   115      * Called when layout is changed
       
   116      */
       
   117 	void HandleLayoutChanged();
       
   118 public:
       
   119 	//MGlxItemMenuObserver
       
   120 	/**
       
   121 	 * To Handle menu items in Grid layout
       
   122 	 * @param aCommand command to be handled
       
   123 	 */
       
   124 	void HandleGridMenuListL(TInt aCommand);
       
   125 public://From MAlfEffectObserver
       
   126 	void HandleEffectCallback(TInt aType, TInt aHandle, TInt aStatus);
       
   127 	
       
   128 public:    
       
   129     void HandleForegroundEventL(TBool aForeground); 
       
   130 	
       
   131 public:
       
   132    /**
       
   133      * Derived classes should use this to initialize the menus if required
       
   134      * @param aResourceId The menu resource
       
   135      * @param aMenuPane The menu pane to edit
       
   136      */
       
   137     void ViewDynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane);
       
   138 
       
   139 protected:
       
   140 	// From CGlxViewBase
       
   141 
       
   142 	/** 	
       
   143 	 *  @since S60 3.2
       
   144 	 *  @param aCommand command to be handled
       
   145 	 */
       
   146 	virtual TBool HandleViewCommandL(TInt aCommand);
       
   147 	
       
   148 	
       
   149 private:
       
   150 
       
   151 	/** 	
       
   152 	 *  @function C++ default constructor
       
   153 	 *  @since S60 3.2
       
   154 	 */
       
   155 	CGlxCloudViewImp(TInt aSoftKeyResId,TInt aSoftkeyMskDisabledId);
       
   156 
       
   157 	/** 	
       
   158 	 *  @function ControlGroupId
       
   159 	 *  @since S60 3.2
       
   160 	 *  @returns Control group id
       
   161 	 */
       
   162 	TInt ControlGroupId()const;
       
   163 
       
   164 	/** 	
       
   165 	 *  @since S60 3.2
       
   166 	 *  Perform the two phase construction
       
   167 	 *  @param aMediaListFactory - Handle to the medialist provider
       
   168 	 *  @param aViewResId - Resource id of the View
       
   169 	 *  @param aTitleResId - Resource id for the Title text
       
   170 	 *  @param aEmptyListResId - Resource id for the empty listbox text
       
   171 	 *  @param aSoftKeyResId - Resource id for the softkey texts
       
   172 	 */
       
   173 	void ConstructL(MGlxMediaListFactory *aMediaListFactory, const TDesC
       
   174 			&aFileName, TInt aViewResId, TInt aEmptyListResId, TInt aSoftKeyResId);
       
   175 
       
   176 	// from base class CAknView
       
   177 
       
   178 	/** 
       
   179 	 *  @since S60 3.2
       
   180 	 *  Returns the unique identifier of the view
       
   181 	 *  @return Unique identifier
       
   182 	 */
       
   183 	TUid Id()const;
       
   184 
       
   185 	/**
       
   186 	 *  @since S60 3.2
       
   187 	 *  This will be called when the view is activated
       
   188 	 *  @param aPrevViewId Specifies the view previously active.
       
   189 	 *  @param aCustomMessageId Specifies the message type.
       
   190 	 *  @param aCustomMessage The activation message.
       
   191 	 */
       
   192 	void DoMLViewActivateL(const TVwsViewId &aPrevViewId, TUid
       
   193 			aCustomMessageId, const TDesC8 &aCustomMessage);
       
   194 
       
   195 	/**
       
   196 	 *  @since S60 3.2
       
   197 	 *  This will be called when the view is deactivated
       
   198 	 */
       
   199 	void DoMLViewDeactivate();
       
   200 
       
   201 	/**
       
   202 	 * Cleanup the visuals: called after deactivate animation is complete,
       
   203 	 * and when the view is destroyed
       
   204 	 */
       
   205     void CleanupVisuals();
       
   206 
       
   207 private:
       
   208 
       
   209 //added for scrollbar widget implementation
       
   210     void ConstructCloudControlL();
       
   211     
       
   212     //set the rect for scrollbar
       
   213     void SetScrollBarRect();
       
   214 
       
   215 private:
       
   216     /**
       
   217      * handle mmc insertion event
       
   218      */
       
   219     void HandleMMCInsertionL();
       
   220     /**
       
   221      * handle mmc removal event
       
   222      */
       
   223     void HandleMMCRemovalL();
       
   224 
       
   225 private:
       
   226 	// Data
       
   227 	/**used for resource fetching */
       
   228 	TInt iResourceOffset;
       
   229 	
       
   230 	/**For Cloud View Control */
       
   231 	CGlxCloudViewControl *iCloudControl;
       
   232 	
       
   233 	/**variable for Alf display*/
       
   234 	CAlfDisplay* iDisplay;
       
   235 	
       
   236 	/** Empty listbox text */
       
   237 	HBufC* iEmptyListText;
       
   238 	
       
   239 	/** The animation being applied to the view */
       
   240 	MGlxAnimation* iViewAnimation;
       
   241 		
       
   242 	/**Resource id for MSk */
       
   243 	TInt iSoftKeyResId;
       
   244 	
       
   245 	/**Resource id for MSk Disabled */
       
   246 	TInt iSoftkeyMskDisabledId;
       
   247 	
       
   248 	//view widget
       
   249 	IAlfViewWidget *iViewWidget; 
       
   250 	
       
   251 	//scrollbar widget
       
   252 	IAlfScrollBarWidget* iScrollWidget;
       
   253 	
       
   254 	IAlfScrollBarDefaultBaseElement* iScrollbarDefaultBaseElement;
       
   255 	
       
   256 	//scrollpane layout
       
   257 	TAknWindowLineLayout iScrollPaneHandle;
       
   258 	
       
   259 	//anchor layout from the view widget
       
   260 	CAlfAnchorLayout* iAnchorlayout;
       
   261 
       
   262 	//mmc notifier
       
   263 	CGlxMMCNotifier* iMMCNotifier;
       
   264 	
       
   265 	TBool iMMCState;
       
   266 	
       
   267 	//For Alf Effects
       
   268 	CAlfEffectObserver* iAlfEffectObs;
       
   269 	TInt iEffectHandle;
       
   270 		
       
   271 	};
       
   272 }
       
   273 #endif // C_GLXTESTTILEVIEWIMP_H
       
   274 
       
   275 // End of File