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