calendarui/views/inc/calenagendaview.h
changeset 45 b6db4fd4947b
child 51 0b38fc5b94c6
equal deleted inserted replaced
23:fd30d51f876b 45:b6db4fd4947b
       
     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: Class declaration for the agenda view
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CALENAGENDAVIEW_H
       
    19 #define CALENAGENDAVIEW_H
       
    20 
       
    21 // System includes
       
    22 #include <QDateTime>
       
    23 
       
    24 // User includes
       
    25 #include "calennativeview.h"
       
    26 
       
    27 // Forward declarations
       
    28 class QGraphicsSceneMouseEvent;
       
    29 class CalenAgendaViewWidget;
       
    30 class CalenDocLoader;
       
    31 
       
    32 #ifdef  CALENVIEWS_DLL
       
    33 #define CALENAGENDAVIEW_EXPORT Q_DECL_EXPORT
       
    34 #else
       
    35 #define CALENAGENDAVIEW_EXPORT Q_DECL_IMPORT
       
    36 #endif
       
    37 
       
    38 /**
       
    39  * @class CalenAgendaView
       
    40  * @brief Class declaration for the agenda view
       
    41  * which shows the list of events &/ to-do's (if any)
       
    42  * for any given day in the calendar. User can do other
       
    43  * basic operations like creating, viewing or deleting
       
    44  * an event
       
    45  */
       
    46 class CalenAgendaView : public CalenNativeView
       
    47     {
       
    48     Q_OBJECT
       
    49 
       
    50 public:
       
    51     /**
       
    52      * @brief Constructor
       
    53      * @param services A reference to the MCalenServices object
       
    54      */
       
    55     CALENAGENDAVIEW_EXPORT CalenAgendaView(MCalenServices &services);
       
    56     
       
    57     /**
       
    58      * @brief Default C++ constructor
       
    59      */
       
    60     CALENAGENDAVIEW_EXPORT virtual ~CalenAgendaView();
       
    61     
       
    62     /**
       
    63      * @brief Initializes the view after its creation
       
    64      * Must be called only after the view and its children are constructed
       
    65      * @param docLoader Pointer to the document loader object which has
       
    66      * loaded this view from the .docml file
       
    67      */
       
    68     CALENAGENDAVIEW_EXPORT void setupView(CalenDocLoader *docLoader);
       
    69     
       
    70     /**
       
    71      * @brief Activates the current view. Sets this view as the current
       
    72      * view of the application's main window. Must be called only after
       
    73      * the view has been constructed and initialized
       
    74      */
       
    75     CALENAGENDAVIEW_EXPORT virtual void doPopulation();
       
    76     
       
    77     /**
       
    78      * @brief Callback function for any notifications that has been
       
    79      * subscribed by this view
       
    80      * @param notification The event for which notification is being sent
       
    81      */
       
    82     CALENAGENDAVIEW_EXPORT void HandleNotification(const TCalenNotification notification);
       
    83     
       
    84     /**
       
    85      * @brief Getter function for the document loader. Called from the content
       
    86      * widget in order get its children
       
    87      */
       
    88     CALENAGENDAVIEW_EXPORT CalenDocLoader* docLoader();
       
    89 
       
    90     /**
       
    91      * @brief clears the list model from the view
       
    92      */
       
    93     CALENAGENDAVIEW_EXPORT void clearListModel();
       
    94 
       
    95     /**
       
    96      * disconnectAboutToQuitEvent disconnects for the aboutToQuit events
       
    97      * 
       
    98      */
       
    99     CALENAGENDAVIEW_EXPORT void disconnectAboutToQuitEvent();
       
   100     
       
   101 	/*
       
   102 	 * @brief Refreshes the view with the date set in the context
       
   103 	 */
       
   104     void refreshViewOnGoToDate();
       
   105     
       
   106 protected:
       
   107     void gestureEvent(QGestureEvent *event);
       
   108 
       
   109 private:
       
   110     
       
   111     /**
       
   112      * @brief Connects to all the toolbar and menu actions associated
       
   113      * with this view
       
   114      */
       
   115 	void setupActions();
       
   116 	
       
   117 	/**
       
   118 	 * @brief Callback function for listening to locale changes like
       
   119 	 * time format, date format etc
       
   120 	 */
       
   121 	void onLocaleChanged(int reason);
       
   122 	
       
   123 private slots:
       
   124 	
       
   125     /**
       
   126 	 * @brief Slot which is called whenever the orientation of the device changes
       
   127 	 * @param orientation The current device orientation
       
   128 	 */
       
   129 	void orientationChanged(Qt::Orientation orientation);
       
   130 	
       
   131 	/**
       
   132 	 * @brief Slot which launches back the month view
       
   133 	 */
       
   134 	void launchMonthView();
       
   135 	
       
   136 	/**
       
   137 	 * @brief Slot which launches the day view
       
   138 	 */
       
   139 	void launchDayView();
       
   140 
       
   141 private:
       
   142 	
       
   143 	/**
       
   144 	 * @var mDate
       
   145 	 * @brief The date for which this view is being shown
       
   146 	 */
       
   147 	QDateTime mDate;
       
   148 	
       
   149 	/**
       
   150 	 * @var mSoftKeyAction
       
   151 	 * TODO: This may not be required going ahead
       
   152 	 */
       
   153 	HbAction *mSoftKeyAction;
       
   154 	
       
   155 	/**
       
   156 	 * @var mAgendaViewWidget
       
   157 	 * @brief The pointer to the content widget of this view
       
   158 	 */
       
   159 	CalenAgendaViewWidget *mAgendaViewWidget;
       
   160 	
       
   161 	/**
       
   162 	 * @var mDocLoader
       
   163 	 * @brief Pointer to the document loader which has loaded
       
   164 	 * this view
       
   165 	 */
       
   166 	CalenDocLoader *mDocLoader;
       
   167 	
       
   168 	/**
       
   169 	 * @var mGoToTodayAction
       
   170 	 * Action which provides "Go to today" functionality
       
   171 	 */
       
   172 	HbAction *mGoToTodayAction;
       
   173 	
       
   174 	/**
       
   175 	 * @var mSwitchToDayViewAction
       
   176 	 * Action which provides "Switch to day view" functionality
       
   177 	 */
       
   178 	HbAction *mSwitchToDayViewAction;
       
   179 	
       
   180     // TODO: Remove these after gestures are available
       
   181     QPointF mTapPoint;
       
   182     bool    mActionTaken;
       
   183     bool    mIsAboutToQuitEventConnected; // bool to check if agenda view is registered to get aboutToQuit signals
       
   184 
       
   185 };
       
   186 
       
   187 #endif /* CALENAGENDAVIEW_H */
       
   188 
       
   189 // End of file	--Don't remove this.