emailuis/nmailui/inc/nmmessagesearchlistview.h
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     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 NMMESSAGESEARCHLISTVIEW_H_
       
    19 #define NMMESSAGESEARCHLISTVIEW_H_
       
    20 
       
    21 #include "nmbaseview.h"
       
    22 #include <nmactionobserver.h>
       
    23 #include <QModelIndex>
       
    24 
       
    25 class HbAbstractViewItem;
       
    26 class HbDocumentLoader;
       
    27 class HbGroupBox;
       
    28 class HbLabel;
       
    29 class HbLineEdit;
       
    30 class HbMenu;
       
    31 class HbPushButton;
       
    32 class HbTreeView;
       
    33 
       
    34 class NmActionResponse;
       
    35 class NmApplication;
       
    36 class NmMessageListModel;
       
    37 class NmMessageListModelItem;
       
    38 class NmUiEngine;
       
    39 class NmUiStartParam;
       
    40 
       
    41 
       
    42 class NmMessageSearchListView : public NmBaseView, public NmActionObserver
       
    43 {
       
    44     Q_OBJECT
       
    45 
       
    46 public:
       
    47 
       
    48     NmMessageSearchListView(NmApplication &application,
       
    49                             NmUiStartParam *startParam,
       
    50                             NmUiEngine &uiEngine,
       
    51                             NmMessageListModel &msglistModel,
       
    52                             HbDocumentLoader *documentLoader,
       
    53                             QGraphicsItem *parent = 0);
       
    54     ~NmMessageSearchListView();
       
    55 
       
    56 
       
    57 public: // From NmBaseView
       
    58 
       
    59     NmUiViewId nmailViewId() const;
       
    60     void viewReady();
       
    61 
       
    62 
       
    63 public: // From NmActionObserver
       
    64 
       
    65     void handleActionCommand(NmActionResponse &menuResponse);
       
    66 
       
    67 
       
    68 private: // Data types
       
    69 
       
    70     enum NmSearchInputMode {
       
    71         NmNormalMode = 0,
       
    72         NmHighlightedMode,
       
    73         NmDimmedMode
       
    74     };
       
    75 
       
    76 
       
    77 private:
       
    78 
       
    79     void loadViewLayout();
       
    80     void initTreeView();
       
    81     void setViewTitle();
       
    82     void noMessagesLabelVisibility(bool visible);
       
    83     void updateSearchResultCountInfo();
       
    84     void setSearchInputMode(NmSearchInputMode mode);
       
    85 
       
    86 
       
    87 public slots:
       
    88 
       
    89     void reloadViewContents(NmUiStartParam *startParam);
       
    90 
       
    91 
       
    92 private slots:
       
    93 
       
    94     void criteriaChanged(QString text);
       
    95     void showItemContextMenu(HbAbstractViewItem *index, const QPointF &coords);
       
    96     void itemActivated(const QModelIndex &index);
       
    97     void handleSelection();
       
    98     void itemsAdded(const QModelIndex &parent, int start, int end);
       
    99     void itemsRemoved();
       
   100     void refreshList();
       
   101     void toggleSearch();
       
   102     void handleSearchComplete();
       
   103 
       
   104 
       
   105 private: // Data
       
   106 
       
   107     NmApplication &mApplication;
       
   108     NmUiEngine &mUiEngine;
       
   109     NmMessageListModel &mMsgListModel;
       
   110     HbDocumentLoader *mDocumentLoader; // Owned
       
   111     QObjectList mWidgetList;
       
   112     HbMenu *mItemContextMenu; // Owned
       
   113     HbTreeView *mMessageListWidget; // Not owned
       
   114     HbGroupBox *mInfoLabel; // Not owned
       
   115     HbLabel *mNoMessagesLabel; // Not owned
       
   116     HbLineEdit *mLineEdit; // Not owned
       
   117     HbPushButton *mPushButton; // Not owned
       
   118     NmMessageListModelItem *mLongPressedItem; // Not owned
       
   119 	QModelIndex mActivatedIndex;
       
   120     bool mViewReady;
       
   121     bool mSearchInProgress;
       
   122 };
       
   123 
       
   124 
       
   125 #endif /* NMMESSAGESEARCHLISTVIEW_H_ */
       
   126 
       
   127 // End of file.