filemanager/src/inc/fmdefine.h
author hgs
Tue, 24 Aug 2010 10:24:14 +0800
changeset 37 15bc28c9dd51
parent 16 ada7962b4308
child 46 d58987eac7e8
permissions -rw-r--r--
201033
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16
ada7962b4308 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 14
diff changeset
     1
/*
14
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description: 
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
#ifndef FMDEFINE_H
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#define FMDEFINE_H
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
// define for filemanager error
37
hgs
parents: 16
diff changeset
    21
#define  FmErrNone                       0  // No Error
hgs
parents: 16
diff changeset
    22
#define  FmErrNotFound                  -1  // General error for things requested is not found 
hgs
parents: 16
diff changeset
    23
#define  FmErrGeneral                   -2  // General error
hgs
parents: 16
diff changeset
    24
#define  FmErrAlreadyExists             -3  // General for already existed. for example if unlock a drive but it has already been unlocked
hgs
parents: 16
diff changeset
    25
#define  FmErrAccessDenied              -4  // General for Access is denied, for example, format a drive but access is denied.
hgs
parents: 16
diff changeset
    26
#define  FmErrCannotRemove              -5  // General error for can not performance remove
hgs
parents: 16
diff changeset
    27
#define  FmErrCannotCopy                -6  // General error for can not performance copy
hgs
parents: 16
diff changeset
    28
#define  FmErrDiskFull                  -7  // Error for disk is full
hgs
parents: 16
diff changeset
    29
#define  FmErrFileUsed                  -8  // Error for file is in use
hgs
parents: 16
diff changeset
    30
#define  FmErrFolderUsed                -9  // Error for folder is in use
hgs
parents: 16
diff changeset
    31
#define  FmErrTypeFormatFailed          -10 // Error reported when format failed
hgs
parents: 16
diff changeset
    32
#define  FmErrTypeFormatFailedUsed      -11 // Error reported when user try to format a drive but it is in use 
hgs
parents: 16
diff changeset
    33
#define  FmErrAlreadyStarted            -12 // General error for operation is already started
hgs
parents: 16
diff changeset
    34
#define  FmErrCancel                    -13 // General error for operation canceled
hgs
parents: 16
diff changeset
    35
#define  FmErrWrongParam                -14 // General error for wrong parameter
hgs
parents: 16
diff changeset
    36
#define  FmErrUnKnown                   -15 // Unknown error
hgs
parents: 16
diff changeset
    37
#define  FmErrIsNotFileOrFolder         -16 // Error for a path which is not a fild or folder.
hgs
parents: 16
diff changeset
    38
#define  FmErrCannotMakeDir             -17 // Error for can not create directory.
hgs
parents: 16
diff changeset
    39
#define  FmErrSrcPathDoNotExist         -18 // Error for source path is not exist.
hgs
parents: 16
diff changeset
    40
#define  FmErrDestPathDoNotExist        -19 // Error for destination path is not exist.
hgs
parents: 16
diff changeset
    41
#define  FmErrCopyDestToSubFolderInSrc  -20 // If user try to copy a folder to its sub folder, error will occur
hgs
parents: 16
diff changeset
    42
#define  FmErrMoveDestToSubFolderInSrc  -21 // If user try to move a folder to its sub folder, error will occur
hgs
parents: 16
diff changeset
    43
#define  FmErrNotSupported              -22 // feature not supported, for example, lock an drive which can not be locked
hgs
parents: 16
diff changeset
    44
#define  FmErrNotReady                  -23 // Error when drive is not ready( means drive is not present )
hgs
parents: 16
diff changeset
    45
#define  FmErrInUse                     -24 // Error for drive is in use.
hgs
parents: 16
diff changeset
    46
#define  FmErrPermissionDenied          -25 // Permission Denied 
hgs
parents: 16
diff changeset
    47
#define  FmErrBadName                   -26 // Bad Drive or file/folder name, currently used when rename drive
hgs
parents: 16
diff changeset
    48
#define  FmErrPathNotFound              -27 // Error for path is not found
hgs
parents: 16
diff changeset
    49
#define  FmErrRemoveDefaultFolder       -28 // Error when user try to remove default folder, such as C:/data/images...
hgs
parents: 16
diff changeset
    50
#define  FmErrLocked                    -29 // Disk is locked
hgs
parents: 16
diff changeset
    51
#define  FmErrCorrupt                   -30 // Disk is corrupt
hgs
parents: 16
diff changeset
    52
#define  FmErrDisMounted                -31 // e.g. If disk dis mounted while backuping.
hgs
parents: 16
diff changeset
    53
#define  FmErrDriveNotAvailable         -32 // e.g. if user want to access MMC but it is not available
hgs
parents: 16
diff changeset
    54
#define  FmErrPathDenied                -33 // if user want to access path but it is denied, e.g c:/private
hgs
parents: 16
diff changeset
    55
#define  FmErrDriveDenied               -34 // if user want to access drive but it is denied, e.g D:/
hgs
parents: 16
diff changeset
    56
#define  FmErrPathNotExist              -35 // path not existed.
14
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
#define FmEstimateUpperLimit 90 // available mem/backup size*100%=90%, User selectable continuation
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
#define FmEstimateLowerLimit 10 // available mem/backup size*100%=10%, Backup will be interrupted
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
#define FmPlaceholderString " " // Placeholder for HbLabel because layout will be wrong when HbLabel is empty
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
37
hgs
parents: 16
diff changeset
    63
#define Drive_C ( QString( "C:" ) + QDir::separator() ) 
hgs
parents: 16
diff changeset
    64
#define Drive_D ( QString( "D:" ) + QDir::separator() )
hgs
parents: 16
diff changeset
    65
#define Drive_Z ( QString( "Z:" ) + QDir::separator() )
hgs
parents: 16
diff changeset
    66
#define Folder_C_Data ( QString( "C:" ) + QDir::separator() + QString( "Data" ) + QDir::separator() )
hgs
parents: 16
diff changeset
    67
hgs
parents: 16
diff changeset
    68
// define  contact data path for view details.
hgs
parents: 16
diff changeset
    69
#define FmViewDetail_Contacts ( "\\private\\10003a73\\SQLite__Contacts.cdb" )
14
1957042d8c7e Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
16
ada7962b4308 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 14
diff changeset
    71
#define FmMaxLengthofDriveName           11
37
hgs
parents: 16
diff changeset
    72
#define FmMaxLengthofDrivePassword       8
hgs
parents: 16
diff changeset
    73
hgs
parents: 16
diff changeset
    74
// used to match un-zeroLength string, empty character such as space is acceptable
hgs
parents: 16
diff changeset
    75
#define Regex_ValidUnZeroLength QString( "^.+$" )
hgs
parents: 16
diff changeset
    76
hgs
parents: 16
diff changeset
    77
// used to match un-empty string, and is not totally empty characters.
hgs
parents: 16
diff changeset
    78
#define Regex_ValidUnEmpty QString( "^.*[^\\s].*$" )
hgs
parents: 16
diff changeset
    79
hgs
parents: 16
diff changeset
    80
// this is regexp for valid file/folder name: no \/:*?"<>| and is not totally empty characters.
hgs
parents: 16
diff changeset
    81
// file name can not end with "." , but it is not include in this RegExp. It should be checked in Regex_ValidNotEndWithDot
hgs
parents: 16
diff changeset
    82
// this expression is composed by two expressions:
hgs
parents: 16
diff changeset
    83
// ^.*[^\\s].*$  used to match un-empty string and is not totally empty characters.
hgs
parents: 16
diff changeset
    84
// [^\\\\/:*?\"<>|] used to math valid file/folder name
hgs
parents: 16
diff changeset
    85
// merge the two regex together:
hgs
parents: 16
diff changeset
    86
// valid file/folder name and is not totally empty.
hgs
parents: 16
diff changeset
    87
#define Regex_ValidFileFolderName QString( "^[^\\\\/:*?\"<>|]*[^\\\\/:*?\"<>|\\s][^\\\\/:*?\"<>|]*$" )
hgs
parents: 16
diff changeset
    88
hgs
parents: 16
diff changeset
    89
// is not end with dot( trim blank characters in the end first )
hgs
parents: 16
diff changeset
    90
#define Regex_ValidNotEndWithDot QString( "^.*[^\\.\\s][\\s]*$" )
16
ada7962b4308 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 14
diff changeset
    91
ada7962b4308 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 14
diff changeset
    92
#endif