homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchfilterproxymodel.h
changeset 90 3ac3aaebaee5
equal deleted inserted replaced
86:e4f038c420f7 90:3ac3aaebaee5
       
     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: Proxy model for search and highlight items view.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef HSSEARCHFILETRPROXYMODEL_H_
       
    19 #define HSSEARCHFILETRPROXYMODEL_H_
       
    20 
       
    21 #include <QSortFilterProxyModel>
       
    22 
       
    23 #define TAG_START "<span style=\"background-color:%1;color:%2\">"
       
    24 #define TAG_END   "</span>"
       
    25 
       
    26 class HsSearchFilterProxyModel : public QSortFilterProxyModel
       
    27 {
       
    28     Q_OBJECT
       
    29  
       
    30 public:
       
    31     HsSearchFilterProxyModel(QObject *parent = 0);
       
    32     virtual ~HsSearchFilterProxyModel();
       
    33  
       
    34 public:
       
    35     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole ) const;
       
    36     void setFilterString(const QString &filterCriteria);
       
    37     QString filterString() const;
       
    38     bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const;
       
    39  
       
    40 private:
       
    41     QString mFilterCriteria;
       
    42     bool mInSettingFilterString;
       
    43 };
       
    44 
       
    45 #endif /* HSSEARCHFILETRPROXYMODEL_H_ */