emailuis/nmailui/src/nmbaseview.cpp
branchGCC_SURGE
changeset 55 cdd802add233
parent 54 997a02608b3a
equal deleted inserted replaced
28:011f79704660 55:cdd802add233
    24 */
    24 */
    25 
    25 
    26 /*!
    26 /*!
    27     Constructor
    27     Constructor
    28 */
    28 */
    29 NmBaseView::NmBaseView(NmUiStartParam* startParam,
    29 NmBaseView::NmBaseView(NmUiStartParam *startParam,
       
    30                        NmApplication &application,
    30                        QGraphicsItem *parent)
    31                        QGraphicsItem *parent)
    31 : HbView(parent),
    32 : HbView(parent),
    32 mStartParam(startParam)
    33 mStartParam(startParam),
       
    34 mApplication(application)
    33 {
    35 {
       
    36     NM_FUNCTION;
    34 }
    37 }
    35 
    38 
    36 /*!
    39 /*!
    37     Destructor
    40     Destructor
    38 */
    41 */
    39 NmBaseView::~NmBaseView()
    42 NmBaseView::~NmBaseView()
    40 {
    43 {
       
    44     NM_FUNCTION;
       
    45     
    41     delete mStartParam;
    46     delete mStartParam;
    42 }
    47 }
    43 
    48 
    44 /*!
    49 /*!
    45     Is it ok to exit current view. Function is called when exiting the view. 
    50     Is it ok to exit current view. Function is called when exiting the view.
    46     Views can override this function and return false to stay in current view. 
    51     Views can override this function and deside are they going to signal popView
       
    52     or not. For example based on the user query. 
    47 */
    53 */
    48 bool NmBaseView::okToExitView()
    54 void NmBaseView::okToExitView()
    49 {
    55 {
    50     return true;
    56 	NM_FUNCTION;
       
    57 	
       
    58 	mApplication.popView();
    51 }
    59 }
    52 
    60 
    53 /*!
    61 /*!
    54     About to exit view. Function is called before view is removed from
    62     About to exit view. Function is called before view is removed from
    55     view stack and deleted. Views can override this function and do pre-exit
    63     view stack and deleted. Views can override this function and do pre-exit
    56     functions. For example editor can store message to drafts at this stage.
    64     functions. For example editor can store message to drafts at this stage.
    57 */
    65 */
    58 void NmBaseView::aboutToExitView()
    66 void NmBaseView::aboutToExitView()
    59 {
    67 {
       
    68     NM_FUNCTION;
    60 }
    69 }
    61 
    70 
    62 /*!
    71 /*!
    63     view ready. Function is called after mainwindow has received viewReady
    72     view ready. Function is called after mainwindow has received viewReady
    64     lazy loading signal. Views can choose to implement this function
    73     lazy loading signal. Views can choose to implement this function
    65     if it makes sense to construct items after main view is shown. 
    74     if it makes sense to construct items after main view is shown. 
    66 */
    75 */
    67 void NmBaseView::viewReady()
    76 void NmBaseView::viewReady()
    68 {    
    77 {
       
    78     NM_FUNCTION;
    69 }
    79 }
    70 
    80 
    71 /*!
    81 /*!
    72     About to change orientation. View can override this function if special
    82     About to change orientation. View can override this function if special
    73     handling is needed for the view when orientation is about to change.
    83     handling is needed for the view when orientation is about to change.
    74 */
    84 */
    75 void NmBaseView::aboutToChangeOrientation()
    85 void NmBaseView::aboutToChangeOrientation()
    76 {
    86 {
       
    87     NM_FUNCTION;
    77 }
    88 }
    78 
    89 
    79 /*!
    90 /*!
    80     Orientation changed. View can override this function if special
    91     Orientation changed. View can override this function if special
    81     handling is needed for the view when orientation is changed.
    92     handling is needed for the view when orientation is changed.
    82 */
    93 */
    83 void NmBaseView::orientationChanged(Qt::Orientation orientation)
    94 void NmBaseView::orientationChanged(Qt::Orientation orientation)
    84 {
    95 {
       
    96     NM_FUNCTION;
       
    97     
    85     Q_UNUSED(orientation);
    98     Q_UNUSED(orientation);
    86 }
    99 }
    87 
   100 
    88 /*!
   101 /*!
    89     Mouse release event. View can override this function if special
   102     Mouse release event. View can override this function if special
    90     handling is required because of  overlaying scroll area (viewer and editor)
   103     handling is required because of  overlaying scroll area (viewer and editor)
    91 */
   104 */
    92 void NmBaseView::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
   105 void NmBaseView::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
    93 {
   106 {
       
   107     NM_FUNCTION;
       
   108     
    94     Q_UNUSED(event);
   109     Q_UNUSED(event);
    95 }
   110 }
    96 
   111 
    97 /*!
   112 /*!
    98     Mouse press event. View can override this function if special
   113     Mouse press event. View can override this function if special
    99     handling is required because of  overlaying scroll area (viewer and editor)
   114     handling is required because of  overlaying scroll area (viewer and editor)
   100 */
   115 */
   101 void NmBaseView::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
   116 void NmBaseView::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
   102 {
   117 {
       
   118     NM_FUNCTION;
       
   119     
   103     Q_UNUSED(event);
   120     Q_UNUSED(event);
   104 }
   121 }
   105 
   122 
   106 
   123 
   107 /*!
   124 /*!
   108     Mouse move event. View can override this function if special
   125     Mouse move event. View can override this function if special
   109     handling is required because of overlaying scroll area (viewer and editor)
   126     handling is required because of overlaying scroll area (viewer and editor)
   110 */
   127 */
   111 void NmBaseView::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
   128 void NmBaseView::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
   112 {
   129 {
       
   130     NM_FUNCTION;
       
   131     
   113     Q_UNUSED(event);
   132     Q_UNUSED(event);
   114 }
   133 }
   115 
   134 
   116 
   135