homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsaddmodeproxymodel.h
changeset 71 1db7cc813a4e
child 81 7dd137878ff8
equal deleted inserted replaced
69:87476091b3f5 71:1db7cc813a4e
       
     1 /*
       
     2  * Copyright (c) 2009 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 view in add to homescreen mode.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef HSADDMODEPROXYMODEL_H
       
    19 #define HSADDMODEPROXYMODEL_H
       
    20 
       
    21 #include <QSortFilterProxyModel>
       
    22 #include <caquery.h>
       
    23 #include <caentry.h>
       
    24 
       
    25 #include "hsmenustates_global.h"
       
    26 
       
    27 class CaNotifier;
       
    28 
       
    29 class HsAddModeProxyModel : public QSortFilterProxyModel
       
    30 {
       
    31     Q_OBJECT
       
    32 
       
    33     HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
       
    34     
       
    35 public:
       
    36 
       
    37     HsAddModeProxyModel(QObject *parent = 0);
       
    38     ~HsAddModeProxyModel();
       
    39     void initilizeCwrtWidgetCache();
       
    40 
       
    41 private slots:
       
    42 
       
    43     void updateCacheOnAddWidget(const QString &uri, const QVariantHash &preferences);
       
    44     void updateCacheOnRemoveWidget(const QString &uri, const QVariantHash &preferences);
       
    45     void updateEntryStatus(const CaEntry &entry, ChangeType changeType);
       
    46 
       
    47 private:
       
    48     
       
    49     virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
       
    50     static int findCwrtWidgetEntryId(const QVariantHash &preferences);
       
    51 
       
    52     QHash<int,bool> mCwrtWidgetCache;
       
    53     CaQuery mQuery;
       
    54     QScopedPointer<CaNotifier> mNotifier;
       
    55 };
       
    56 
       
    57 #endif //HSADDMODEPROXYMODEL_H
       
    58