filemanager/Engine/inc/CFileManagerBackupSettings.h
branchRCL_3
changeset 38 491b3ed49290
parent 36 95243422089a
child 39 65326cf895ed
equal deleted inserted replaced
36:95243422089a 38:491b3ed49290
     1 /*
       
     2 * Copyright (c) 2006-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:  Backup settings
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_FILEMANAGERBACKUPSETTINGS_H
       
    20 #define C_FILEMANAGERBACKUPSETTINGS_H
       
    21 
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <e32base.h>
       
    25 #include <badesca.h>
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CFileManagerEngine;
       
    30 class CRepository;
       
    31 
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35  *  This class is used for storing backup settings
       
    36  *
       
    37  *  @lib FileManagerEngine.lib
       
    38  *  @since S60 3.1
       
    39  */
       
    40 NONSHARABLE_CLASS(CFileManagerBackupSettings) : public CBase,
       
    41                                                 public MDesCArray
       
    42     {
       
    43 
       
    44 public:
       
    45     /**  Backup setting type */
       
    46     enum TSettingType
       
    47         {
       
    48         ENone = 0,
       
    49         EContents,
       
    50         EScheduling,
       
    51         EWeekday,
       
    52         ETime,
       
    53         ETarget
       
    54         };
       
    55 
       
    56     /**
       
    57      * Two-phased constructor.
       
    58      */
       
    59     static CFileManagerBackupSettings* NewL(
       
    60         CFileManagerEngine& aEngine );
       
    61 
       
    62     /**
       
    63      * Destructor
       
    64      */
       
    65     ~CFileManagerBackupSettings();
       
    66 
       
    67     /**
       
    68      * Sets backup contents
       
    69      *
       
    70      * @since S60 3.1
       
    71      * @param aContent Content bitmask
       
    72      */
       
    73     IMPORT_C void SetContent( const TUint32 aContent );
       
    74 
       
    75     /**
       
    76      * Sets backup scheduling
       
    77      *
       
    78      * @since S60 3.1
       
    79      * @param aScheduling Scheduling type
       
    80      */
       
    81     IMPORT_C void SetScheduling( const TInt aScheduling );
       
    82 
       
    83     /**
       
    84      * Sets backup weekday
       
    85      *
       
    86      * @since S60 3.1
       
    87      * @param aDay Backup weekday (See TDay)
       
    88      */
       
    89     IMPORT_C void SetDay( const TInt aDay );
       
    90 
       
    91     /**
       
    92      * Sets backup time
       
    93      *
       
    94      * @since S60 3.1
       
    95      * @param aTime Time from 00:00
       
    96      */
       
    97     IMPORT_C void SetTime( const TTime& aTime );
       
    98 
       
    99     /**
       
   100      * Sets backup target drive
       
   101      *
       
   102      * @since S60 3.1
       
   103      * @param aDrive Target drive (See TDriveNumber)
       
   104      */
       
   105     IMPORT_C void SetTargetDrive( const TInt aDrive );
       
   106 
       
   107     /**
       
   108      * Gets backup contents
       
   109      *
       
   110      * @since S60 3.1
       
   111      * @return Content bitmask
       
   112      */
       
   113     IMPORT_C TUint32 Content() const;
       
   114 
       
   115     /**
       
   116      * Gets backup scheduling
       
   117      *
       
   118      * @since S60 3.1
       
   119      * @return Scheduling type
       
   120      */
       
   121     IMPORT_C TInt Scheduling() const;
       
   122 
       
   123     /**
       
   124      * Gets backup weekday
       
   125      *
       
   126      * @since S60 3.1
       
   127      * @return Backup weekday (See TDay)
       
   128      */
       
   129     IMPORT_C TInt Day() const;
       
   130 
       
   131     /**
       
   132      * Gets backup time
       
   133      *
       
   134      * @since S60 3.1
       
   135      * @return Backup time
       
   136      */
       
   137     IMPORT_C const TTime& Time() const;
       
   138 
       
   139     /**
       
   140      * Gets backup target drive
       
   141      *
       
   142      * @since S60 3.1
       
   143      * @return Backup time
       
   144      */
       
   145     IMPORT_C TInt TargetDrive() const;
       
   146 
       
   147     /**
       
   148      * Saves backup settings
       
   149      *
       
   150      * @since S60 3.1
       
   151      */
       
   152     IMPORT_C void SaveL();
       
   153 
       
   154     /**
       
   155      * Gets setting type at position
       
   156      *
       
   157      * @since S60 3.1
       
   158      * @param aIndex Position
       
   159      * @return Setting type
       
   160      */
       
   161     IMPORT_C TInt SettingAt( const TInt aIndex );
       
   162 
       
   163     /**
       
   164      * Refreshes backup settings
       
   165      *
       
   166      * @since S60 3.1
       
   167      */
       
   168     IMPORT_C void RefreshL();
       
   169 
       
   170     /**
       
   171      * Gets textid from content bit
       
   172      *
       
   173      * @since S60 3.1
       
   174      * @param aContent content bit
       
   175      * @return Textid
       
   176      */
       
   177     static TInt ContentToTextId( const TUint32 aContent );
       
   178 
       
   179     /**
       
   180      * Gets allowed drive attribute match mask
       
   181      *
       
   182      * @since S60 3.1
       
   183      * @return drive attribute mask
       
   184      */
       
   185     IMPORT_C TUint32 AllowedDriveAttMatchMask() const;
       
   186 
       
   187 public: // From MDesCArray
       
   188     TInt MdcaCount() const;
       
   189 
       
   190     TPtrC MdcaPoint( TInt aIndex ) const;
       
   191 
       
   192 private:
       
   193     /**  Backup setting entry */
       
   194     NONSHARABLE_CLASS(CEntry) : public CBase
       
   195         {
       
   196     public:
       
   197         ~CEntry();
       
   198 
       
   199         HBufC* iText;
       
   200         TSettingType iType;
       
   201         };
       
   202 
       
   203 private:
       
   204     /**
       
   205      * Constructors
       
   206      */
       
   207     CFileManagerBackupSettings( CFileManagerEngine& aEngine );
       
   208 
       
   209     void ConstructL();
       
   210 
       
   211     /**
       
   212      * Gets the count of contents selected
       
   213      */
       
   214     TInt ContentsSelected() const;
       
   215 
       
   216     /**
       
   217      * Creates backup setting entry
       
   218      */
       
   219     CEntry* CreateEntryLC(
       
   220         const TSettingType aType,
       
   221         const TInt aTitleId,
       
   222         const TInt aTextId,
       
   223         const TInt aValue = 0 );
       
   224 
       
   225     /**
       
   226      * Creates backup setting entry
       
   227      */
       
   228     CEntry* CreateEntryLC(
       
   229         const TSettingType aType,
       
   230         const TInt aTitleId,
       
   231         const TDesC& aText );
       
   232 
       
   233     /**
       
   234      * Creates backup setting content entry
       
   235      */
       
   236     CEntry* CreateContentsEntryLC();
       
   237 
       
   238     /**
       
   239      * Creates backup setting time entry
       
   240      */
       
   241     CEntry* CreateTimeEntryLC();
       
   242 
       
   243     /**
       
   244      * Loads saved backup settings
       
   245      */
       
   246     void LoadL();
       
   247 
       
   248     /**
       
   249      * Refreshes backup setting list entries
       
   250      */
       
   251     void RefreshListL();
       
   252 
       
   253     /**
       
   254      * Creates backup setting target drive entry
       
   255      */
       
   256     CEntry* CreateTargetDriveEntryLC();
       
   257 
       
   258     /**
       
   259      * Checks for multiple backup targets
       
   260      */
       
   261     TBool HasMultipleBackupTargets();
       
   262 
       
   263 private: // Data
       
   264     /**
       
   265      * Reference to file manager engine
       
   266      * Not own.
       
   267      */
       
   268     CFileManagerEngine& iEngine;
       
   269 
       
   270     /**
       
   271      * Content bitmask
       
   272      */
       
   273     TUint32 iContent;
       
   274 
       
   275     /**
       
   276      * Scheduling type
       
   277      */
       
   278     TInt iScheduling;
       
   279 
       
   280     /**
       
   281      * Scheduled backup weekday
       
   282      */
       
   283     TInt iDay;
       
   284 
       
   285     /**
       
   286      * Scheduled backup time from 00:00
       
   287      */
       
   288     TTime iTime;
       
   289 
       
   290     /**
       
   291      * Backup target drive
       
   292      */
       
   293     TInt iTargetDrive;
       
   294 
       
   295     /**
       
   296      * Backup setting list items
       
   297      */
       
   298     RPointerArray< CEntry > iList;
       
   299 
       
   300     /**
       
   301      * Allowed drive match mask
       
   302      */
       
   303     TUint32 iAllowedDriveMatchMask;
       
   304 
       
   305     /**
       
   306      * Pointer to CenRep
       
   307      * Own.
       
   308      */
       
   309 	CRepository* iCenRep;
       
   310 
       
   311     /**
       
   312      * Feature configuration
       
   313      */
       
   314     TInt iFileManagerFeatures;
       
   315 
       
   316     };
       
   317 
       
   318 #endif // C_FILEMANAGERBACKUPSETTINGS_H
       
   319 
       
   320 // End of File