filebrowser/ui/inc/searchview.h
changeset 17 4f2773374eff
child 19 4b22a598b890
equal deleted inserted replaced
15:e11368ed4880 17:4f2773374eff
       
     1 /*
       
     2 * Copyright (c) 2010 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef SEARCHVIEW_H
       
    19 #define SEARCHVIEW_H
       
    20 
       
    21 #include <hbview.h>
       
    22 #include <hbmainwindow.h>
       
    23 
       
    24 #include <qdatetime.h>
       
    25 
       
    26 class QDir;
       
    27 class EngineWrapper;
       
    28 class QStringList;
       
    29 class HbDataForm;
       
    30 class HbDataFormModelItem;
       
    31 
       
    32 /**
       
    33   * Settings class that is used for 
       
    34   */
       
    35 class SearchAttributes
       
    36 {
       
    37 public:
       
    38     QString   mSearchDir;
       
    39     QString   mWildCards;
       
    40     QString   mTextInFile;
       
    41     int       mMinSize;
       
    42     int       mMaxSize;
       
    43     QDate     mMinDate;
       
    44     QDate     mMaxDate;
       
    45     bool      mRecurse;
       
    46 };
       
    47 
       
    48 /**
       
    49  * search results class.
       
    50  */
       
    51 class SearchResults
       
    52 {
       
    53 public:
       
    54     int         mNumberOfFoundFiles;
       
    55     QStringList* mFoundFilesList;
       
    56 };
       
    57 
       
    58 class SearchView : public HbView
       
    59 {
       
    60     Q_OBJECT
       
    61 
       
    62 public:
       
    63     SearchView(HbView &mainView, HbMainWindow &mainWindow, EngineWrapper &engineWrapper);
       
    64     ~SearchView();
       
    65     void open(const QString &path);
       
    66 
       
    67 
       
    68 private slots:
       
    69     void backButtonClicked();
       
    70     void startFileSearch();
       
    71     void loadAttributes();
       
    72     void readFormItems();
       
    73     
       
    74 private:
       
    75     void fileSearchResults();
       
    76 
       
    77     /* Main Window of folderbrowser */
       
    78     HbMainWindow &mMainWindow;
       
    79     /* Main View of folderbrowser*/
       
    80     HbView &mMainView;
       
    81     /* EngineWrapper */
       
    82     EngineWrapper &mEngineWrapper;  
       
    83 
       
    84     /* Search attributes */
       
    85     SearchAttributes mAttributes;    
       
    86     /* Search results */
       
    87     SearchResults mResults;
       
    88 
       
    89     HbDataForm *mForm;
       
    90     HbDataFormModelItem *mSearchFileNameItem;
       
    91     HbDataFormModelItem *mWildCardItem;
       
    92     HbDataFormModelItem *mHasString;
       
    93     HbDataFormModelItem *mRecurse;
       
    94     HbDataFormModelItem *mMinSize;
       
    95     HbDataFormModelItem *mMaxSize;
       
    96     HbDataFormModelItem *mMinDate;
       
    97     HbDataFormModelItem *mMaxDate;
       
    98 
       
    99     QString mPath;
       
   100 };
       
   101 
       
   102 #endif // SEARCHVIEW_H