filemanager/GFLM/inc/CGflmFileFinder.h
branchRCL_3
changeset 39 65326cf895ed
parent 0 6a9f87576119
equal deleted inserted replaced
38:491b3ed49290 39:65326cf895ed
       
     1 /*
       
     2 * Copyright (c) 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:  Searches items matching with given string in given file system
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CGFLMITEMFINDER_H
       
    20 #define CGFLMITEMFINDER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <f32file.h>
       
    25 #include <collate.h>
       
    26 #include "GFLM.hrh"
       
    27 #include "MGflmItemGroup.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CGflmItemLocalizer;
       
    31 class CGflmDriveResolver;
       
    32 class MGflmItemFilter;
       
    33 class CGflmGroupItem;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37 *  Finds the items matching with given string in given folder
       
    38 *
       
    39 *  @lib GFLM.lib
       
    40 *  @since 3.2
       
    41 */
       
    42 NONSHARABLE_CLASS(CGflmFileFinder) : public CBase,
       
    43                                      public MGflmItemGroup
       
    44     {
       
    45     public:
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         */
       
    49         static CGflmFileFinder* NewL(
       
    50             RFs& aFss,
       
    51             CGflmItemLocalizer& aLocalizer,
       
    52             CGflmDriveResolver& aResolver,
       
    53             const TBool& aCancelIndicator );
       
    54 
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         ~CGflmFileFinder();
       
    59 
       
    60     public:
       
    61         /**
       
    62         * Sets search folder
       
    63         * @since 3.2
       
    64         * @param aSearchFolder Given search folder
       
    65         */
       
    66         void SetSearchFolderL( const TDesC& aSearchFolder );
       
    67 
       
    68         /**
       
    69         * Sets search string. Wild cards are allowed.
       
    70         * @since 3.2
       
    71         * @param aSearchString Given search string
       
    72         */
       
    73         void SetSearchStringL( const TDesC& aSearchString );
       
    74 
       
    75         /**
       
    76         * Refreshes the model
       
    77         * @since 3.2
       
    78         * @param aFilter Pointer to filter. NULL if not used.
       
    79         * @param aSortMethod Sort method
       
    80         * @param aRefreshMode Refresh mode
       
    81         */
       
    82         void RefreshL(
       
    83             MGflmItemFilter* aFilter,
       
    84             TGflmSortMethod aSortMethod,
       
    85             TGflmRefreshMode aRefreshMode );
       
    86 
       
    87     public: // From MGflmItemGroup
       
    88 
       
    89 		TInt Id() const;
       
    90 
       
    91         TInt ItemCount() const;
       
    92 
       
    93 		CGflmGroupItem* Item( TInt aIndex );
       
    94 
       
    95 		void AddSourceL( const TDesC& aDirectory );
       
    96 
       
    97 		void ResetSources();
       
    98 
       
    99 		void AddActionItemL( TInt aId, const TDesC& aCaption );
       
   100 
       
   101 		void SetInclusion( TUint aInclusion );
       
   102 
       
   103         const TCollationMethod* CollationMethod();
       
   104 
       
   105     private:
       
   106         /**
       
   107         * C++ default constructor.
       
   108         */
       
   109 		CGflmFileFinder(
       
   110 		    RFs& aFss,
       
   111             CGflmItemLocalizer& aLocalizer,
       
   112             CGflmDriveResolver& aResolver,
       
   113             const TBool& aCancelIndicator );
       
   114 
       
   115         void ConstructL();
       
   116 
       
   117         void DoSearchL( MGflmItemFilter* aFilter );
       
   118 
       
   119 	private: // Data
       
   120         // Ref: An open shareable file server session
       
   121 		RFs& iFss;
       
   122 
       
   123         // Ref: Item localizer
       
   124         CGflmItemLocalizer& iItemLocalizer;
       
   125 
       
   126         // Ref: Drive resolver
       
   127         CGflmDriveResolver& iDriveResolver;
       
   128 
       
   129         // Own: Read only cancel indicator
       
   130         const TBool& iCancelIndicator;
       
   131 
       
   132         // Own: Contains folder string
       
   133 		HBufC* iSearchFolder;
       
   134 
       
   135         // Own: Contains folder path with search string with wild cards
       
   136 		HBufC* iSearchFolderWild;
       
   137 
       
   138         // Own: Contains search string
       
   139 		HBufC* iSearchString;
       
   140 
       
   141         // Own: Contains search string with wild cards
       
   142 		HBufC* iSearchStringWild;
       
   143 
       
   144         // Own: Contains found items
       
   145 		RPointerArray< CGflmGroupItem > iSearchResults;
       
   146 
       
   147         // Own: Buffer for full path handling
       
   148         TFileName iFullPath;
       
   149 
       
   150         // Own: Used collation method
       
   151 		TCollationMethod iSortCollationMethod;
       
   152     };
       
   153 
       
   154 #endif      // CGFLMITEMFINDER_H
       
   155             
       
   156 // End of File
       
   157