69
|
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: Search view.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef HSSEARCHVIEW_H
|
|
19 |
#define HSSEARCHVIEW_H
|
|
20 |
|
81
|
21 |
#include <QInputContext>
|
69
|
22 |
#include <QModelIndex>
|
|
23 |
#include <QScopedPointer>
|
|
24 |
#include <HbShrinkingVkbHost>
|
|
25 |
|
|
26 |
#include "hsmenustates_global.h"
|
|
27 |
#include "hsmenuviewbuilder.h"
|
71
|
28 |
#include "hssearchviewbuilder.h"
|
90
|
29 |
#include "hssearchfilterproxymodel.h"
|
69
|
30 |
|
|
31 |
class HsMainWindow;
|
|
32 |
class HbAbstractViewItem;
|
|
33 |
class HbLineEdit;
|
|
34 |
class HbSearchPanel;
|
|
35 |
|
|
36 |
HS_STATES_TEST_CLASS(MenuStatesTest)
|
|
37 |
|
|
38 |
class HsSearchView : public QObject
|
|
39 |
{
|
|
40 |
Q_OBJECT
|
|
41 |
|
|
42 |
HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
|
|
43 |
|
|
44 |
public:
|
|
45 |
|
|
46 |
HsSearchView(
|
|
47 |
HsMenuViewBuilder &builder,
|
|
48 |
HsStateContext stateContext,
|
|
49 |
HsMainWindow &mainWindow);
|
|
50 |
~HsSearchView();
|
|
51 |
|
|
52 |
void setSearchPanelVisible(bool visible);
|
81
|
53 |
bool isActive() const;
|
71
|
54 |
private:
|
|
55 |
|
69
|
56 |
QModelIndex firstVisibleItemIndex(const HbListView *view) const;
|
|
57 |
void searchBegins();
|
|
58 |
|
|
59 |
void connectSearchItemViewsSignals();
|
|
60 |
void disconnectSearchItemViewsSignals();
|
|
61 |
|
|
62 |
void connectSearchPanelSignals();
|
|
63 |
|
|
64 |
void disconnectSearchPanelSignals();
|
|
65 |
|
|
66 |
void searchFinished();
|
81
|
67 |
void sendEvent(const QEvent::Type eventType);
|
|
68 |
void openVkb();
|
69
|
69 |
|
|
70 |
signals:
|
|
71 |
void activated(const QModelIndex &index);
|
|
72 |
void longPressed(HbAbstractViewItem *item, const QPointF &coords);
|
81
|
73 |
void searchComplete(const QModelIndex &firstMatching);
|
69
|
74 |
public slots:
|
|
75 |
void hideSearchPanel();
|
71
|
76 |
|
|
77 |
private slots:
|
69
|
78 |
void activatedProxySlot(const QModelIndex &index);
|
|
79 |
void longPressedProxySlot(
|
|
80 |
HbAbstractViewItem *item, const QPointF &coords);
|
|
81 |
|
|
82 |
private slots:
|
|
83 |
void findItem(QString criteriaStr);
|
71
|
84 |
void setNoResultsVisibility();
|
81
|
85 |
void hideVkb();
|
71
|
86 |
|
69
|
87 |
private:
|
|
88 |
void setOriginatingContext();
|
|
89 |
void initSearchPanel(HbSearchPanel &searchPanel);
|
|
90 |
HbLineEdit *searchPanelLineEdit(HbSearchPanel &searchPanel) const;
|
|
91 |
|
|
92 |
private:
|
|
93 |
|
|
94 |
QModelIndex mSearchViewInitialIndex;
|
|
95 |
QModelIndex mIndexToScrollAfterSearchDone;
|
|
96 |
QModelIndex mSearchViewLongPressedIndex;
|
90
|
97 |
HsSearchFilterProxyModel *mProxyModel; // owned
|
69
|
98 |
HbView *mSearchView;
|
|
99 |
HbListView *mSearchListView;
|
|
100 |
HbSearchPanel *mSearchPanel;
|
|
101 |
const HsStateContext mStateContext;
|
|
102 |
HsOperationalContext mAfterSearchContext;
|
|
103 |
HsMenuViewBuilder &mBuilder;
|
|
104 |
HsMainWindow &mMainWindow;
|
|
105 |
HbListView *mListView;
|
|
106 |
QScopedPointer<HbShrinkingVkbHost> mVkbHost;
|
71
|
107 |
HsSearchViewBuilder mSearchViewBuilder;
|
|
108 |
bool mEmptyResultText;
|
90
|
109 |
QString mCriteria;
|
|
110 |
|
69
|
111 |
};
|
|
112 |
|
|
113 |
#endif /* HSSEARCHVIEW_H_ */
|