remotestoragefw/gsplugin/inc/rsfwgsremotedrivesettingscontainer.h
branchRCL_3
changeset 20 1aa8c82cb4cb
parent 0 3ad9d5175a89
equal deleted inserted replaced
19:88ee4cf65e19 20:1aa8c82cb4cb
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  The control container (view) of the settings list view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CRSFWGSPLUGINDRIVESETTINGSCONTAINER_H
       
    20 #define CRSFWGSPLUGINDRIVESETTINGSCONTAINER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include    <akncheckboxsettingpage.h>
       
    24 //#include    "rsfwgsplugin.h"
       
    25 
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 //class CGSListBoxItemTextArray;
       
    29 class CRsfwGsPluginSettingsList;
       
    30 class CRsfwGsSettingsData;
       
    31 class CRsfwMountMan;
       
    32 class CAknView;
       
    33 class CRsfwMountEntry;
       
    34 
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  CRsfwGsPluginDriveSettingsContainer container class
       
    40 *  container class for Remote drive settings view
       
    41 *
       
    42 *  @lib rsfwgsplugin.dll
       
    43 *  @since Series 60 3.1
       
    44 */
       
    45 class CRsfwGsPluginDriveSettingsContainer : public CCoeControl, 
       
    46                                             MEikListBoxObserver,
       
    47                                             MCoeForegroundObserver
       
    48                                             
       
    49     {
       
    50     public: // Constructors and destructor
       
    51 
       
    52          /**
       
    53         * Constructor.
       
    54         */
       
    55         CRsfwGsPluginDriveSettingsContainer(CAknView* aView);
       
    56 
       
    57 
       
    58         /**
       
    59         * By default Symbian 2nd phase constructor is private.
       
    60         * @param aRect gives the correct TRect for construction
       
    61         * @param aModel for the model
       
    62         */
       
    63         void ConstructL( const TRect& aRect, 
       
    64                          CRsfwMountMan* aMountMan );
       
    65 
       
    66 
       
    67         /**
       
    68         * Destructor.
       
    69         */
       
    70         ~CRsfwGsPluginDriveSettingsContainer();
       
    71 
       
    72     public: // From CCoeControl
       
    73     
       
    74         /**
       
    75         * See CCoeControl.
       
    76         */
       
    77         TInt CountComponentControls() const;
       
    78         
       
    79         /**
       
    80         * See CCoeControl.
       
    81         */
       
    82         CCoeControl* ComponentControl( TInt aIndex ) const;
       
    83         
       
    84         /**
       
    85         * See CCoeControl.
       
    86         */
       
    87         TKeyResponse OfferKeyEventL( 
       
    88             const TKeyEvent& aKeyEvent, TEventCode aType );
       
    89             
       
    90         /**
       
    91         * See CCoeControl.
       
    92         */
       
    93         void SizeChanged();
       
    94         
       
    95         /**
       
    96         * See CCoeControl.
       
    97         */
       
    98         void Draw(const TRect& aRect) const;
       
    99        
       
   100         /**
       
   101         * See CCoeControl
       
   102         */
       
   103         void HandleResourceChange( TInt aType );
       
   104 
       
   105         /**
       
   106          * Gets help context
       
   107          */
       
   108         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   109 
       
   110         /**
       
   111          * See CCoeControl
       
   112          */
       
   113         void FocusChanged(TDrawNow aDrawNow);
       
   114         
       
   115     public: // MCoeForegroundObserver
       
   116 
       
   117         /** Handles the drive list view coming to the foreground. */
       
   118         void HandleGainingForeground();
       
   119         /** Handles the drive list view going into the background. */
       
   120         void HandleLosingForeground();
       
   121      
       
   122         
       
   123     public:
       
   124     
       
   125         /**
       
   126         * Edit currently focused item on settings list. called from UI
       
   127         */
       
   128         void EditCurrentItemL();
       
   129         
       
   130         /**
       
   131         * See MEikListBoxObserver
       
   132         */
       
   133         void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   134         
       
   135         /**
       
   136         * Prepare a Remote drive with given name for editing
       
   137         * @param aRemoteDriveName reference to the remote drive to be edited
       
   138         */
       
   139         void PrepareRemoteDriveForEditingL(const TDesC& aRemoteDriveName);
       
   140         
       
   141         /**
       
   142         * Prepare the a new remote drive with default values with given name
       
   143         * @param aRemoteDrive name reference to the new remote drive name
       
   144         */
       
   145         void PrepareRemoteDriveNewDefaultL(TDesC& aRemoteDriveName);
       
   146         
       
   147               
       
   148         /**
       
   149         * Called by the UI when back button is pressed, to perform needed steps
       
   150         * @return ETrue if settings list is allowed to close
       
   151         */
       
   152         TBool IsExitProcessingOKL(); 
       
   153         
       
   154         /**
       
   155         * Save current drive settings
       
   156         */        
       
   157         void SaveSettingsL();
       
   158         
       
   159         /*
       
   160         * Return the name of current set in iData
       
   161         * @return TDes reference to current set
       
   162         */
       
   163         TDes& GetCurrentRemoteDriveName();
       
   164 
       
   165       
       
   166         void HandleResourceChangeManual(TInt aType);
       
   167       
       
   168     private: // Most of these methods perform operations using iData
       
   169     
       
   170         /**
       
   171         * Sets the title pane text with given discriptor
       
   172         * @param aTitleText text to be shown on title pane
       
   173         */
       
   174         void SetTitlePaneTextL( const TDesC& aTitleText ) const;
       
   175         
       
   176         /**
       
   177         * Finds out whether compulsory items are filled
       
   178         * @return ETrue if compulsory items are filled
       
   179         */
       
   180         TBool AreCompulsoryItemsFilled();
       
   181         
       
   182         /**
       
   183         * Display a query dialog to user that compulsory settings are not
       
   184         * filled, and if user wants to delete the settings
       
   185         * @return ETrue if user wants to delete the settings
       
   186         */
       
   187         TBool DisplayDeleteOrDontSaveDialogL();
       
   188         
       
   189         /**
       
   190         * Update a remote drive if it already exist or create it if it doesnt exist
       
   191         * @param aShowDialog if false then possible error notes won't be shown
       
   192         * @return ETrue if save procedure goes ok
       
   193         */
       
   194         TBool SaveOrCreateAndSaveRemoteDriveL(TBool aShowDialog);
       
   195         
       
   196         /**
       
   197         * Deletes the remote drive if it exist in the Central Repository
       
   198         */
       
   199         void DeleteRemoteDriveIfExistL();
       
   200         
       
   201         /**
       
   202         * Load Remote drive names with trap, useful when list doesnt have anything
       
   203         * @param Reference to setting ids
       
   204         * @return CDesCArray remote drives
       
   205         */
       
   206       	CDesCArray* LoadRemoteDriveNamesL();  
       
   207    
       
   208         /**
       
   209         * See if the remote drive setting under edit was changed
       
   210         * @param Reference to the current mount conf 
       
   211         * @return ETrue if something has been changed
       
   212         */   	
       
   213       	TBool DataChanged(const CRsfwMountEntry* aCurrentData);   
       
   214       	
       
   215       	/**
       
   216         * Check whether some other drive (some other drive letter) already uses this name
       
   217         * @param aRemoteDriveNamereference the remote drive name
       
   218         * @param aDriveLetter the drive letter
       
   219         * @return ETrue if remote drive exist with given name
       
   220         */
       
   221         TBool IsRemoteDriveNameConflictL(TDesC& aRemoteDriveName, const TDesC& aDriveLetter);
       
   222 
       
   223         /**
       
   224         * Returns ETrue if the address (URL) for a remote drive is valid
       
   225         * Calls RsfwMountUtils API
       
   226         * @since S60 3.2
       
   227         * @param aFriendlyName remote drive friendly name
       
   228         */
       
   229         TBool IsDriveAddressValidL(const TDesC& aDriveAddress);
       
   230             
       
   231     private: // data
       
   232         
       
   233         // CRsfwGsPluginSettingsList owned
       
   234       	CRsfwGsPluginSettingsList* iSettingList;        
       
   235   
       
   236       	// Pointer to settings data owned
       
   237       	CRsfwGsSettingsData* iData;
       
   238       	
       
   239       	  // Pointer to the application view, not owned
       
   240      	 CAknView* iView; // not owned
       
   241       	    	
       
   242     	// model, not owned	
       
   243       	CRsfwMountMan*           iMountMan; 
       
   244     };
       
   245 
       
   246 
       
   247 #endif  // CRSFWGSPLUGINDRIVESETTINGSCONTAINER_H
       
   248 
       
   249 // End of File