calendarui/views/dayview/inc/calendayview.h
changeset 45 b6db4fd4947b
child 55 2c54b51f39c4
child 58 ef813d54df51
equal deleted inserted replaced
23:fd30d51f876b 45:b6db4fd4947b
       
     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: CalenDayView class definition.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CALEDAYVIEW_H
       
    19 #define CALEDAYVIEW_H
       
    20 
       
    21 // System includes
       
    22 #include <QDateTime>
       
    23 #include <xqsettingskey.h>
       
    24 
       
    25 // User includes
       
    26 #include "calennativeview.h"
       
    27 #include "calendaycommonheaders.h"
       
    28 #include "hb_calencommands.hrh"      // command ids
       
    29 
       
    30 // Forward declarations
       
    31 class QGraphicsLinearLayout;
       
    32 class XQSettingsManager;
       
    33 class QVariant;
       
    34 class HbGroupBox;
       
    35 class AgendaEntry;
       
    36 class CalenDocLoader;
       
    37 class CalenDayContentScrollArea;
       
    38 class CalenDayContentWidget;
       
    39 class CalenDayHourScrollArea;
       
    40 class CalenDayModelManager;
       
    41 
       
    42 
       
    43 // Constants
       
    44 
       
    45 
       
    46 #ifdef  CALENVIEWS_DLL
       
    47 #define CALENDAYVIEW_EXPORT Q_DECL_EXPORT
       
    48 #else
       
    49 #define CALENDAYVIEW_EXPORT Q_DECL_IMPORT
       
    50 #endif
       
    51 
       
    52 class CalenDayView : public CalenNativeView
       
    53 {
       
    54     Q_OBJECT
       
    55 
       
    56 public:
       
    57     
       
    58     /**
       
    59      * Constructor.
       
    60      * 
       
    61      * @param services Calendar services.
       
    62      */
       
    63     CALENDAYVIEW_EXPORT CalenDayView( MCalenServices &services );
       
    64     
       
    65     /**
       
    66      * Destructor.
       
    67      */
       
    68     CALENDAYVIEW_EXPORT virtual ~CalenDayView();
       
    69     
       
    70 public:
       
    71 
       
    72 //From CalenNativeView
       
    73     
       
    74     /**
       
    75      * Handles locale change.
       
    76      * 
       
    77      * @param reason Change reason.
       
    78      */    
       
    79     virtual void onLocaleChanged(int reason);
       
    80     
       
    81 //From CalenView
       
    82     
       
    83     /**
       
    84      * Handles view (re)population.
       
    85      * 
       
    86      */
       
    87     CALENDAYVIEW_EXPORT virtual void doPopulation();
       
    88     
       
    89     /**
       
    90      * Informs the organizer that the view's population is complete.
       
    91      */
       
    92     virtual void populationComplete();
       
    93    
       
    94 //From MCalenNotificationHandler
       
    95     
       
    96     /**
       
    97      * The function handles calendar notifications.
       
    98      */
       
    99     virtual void HandleNotification( const TCalenNotification notification );
       
   100 
       
   101 public:
       
   102     //API
       
   103     
       
   104     /**
       
   105      * Sets up the view accroding to the 'xml'
       
   106      * 
       
   107      * @param docLoader Loaded document.
       
   108      */
       
   109     CALENDAYVIEW_EXPORT void setupView(CalenDocLoader* docLoader);
       
   110 
       
   111 private slots:
       
   112 
       
   113     /**
       
   114      * Handles 'back' functionality;
       
   115      */
       
   116     void onBack();
       
   117     
       
   118     /**
       
   119      * Updates selected date member and context
       
   120      */
       
   121     void dayChangeStarted(CalenScrollDirection direction);
       
   122     
       
   123     /**
       
   124      * Refreshes the model
       
   125      */
       
   126     void dayChanged(CalenScrollDirection direction);
       
   127     
       
   128     /**
       
   129      * Sets new date as heading text. Triggerd after fadeOut effect.
       
   130      */
       
   131     void setHeadingText(const HbEffect::EffectStatus &status);
       
   132     
       
   133     /**
       
   134      * Handles actions from menu
       
   135      */
       
   136     void runNewMeeting();
       
   137     void runGoToToday();
       
   138     void runChangeToAgendaView();
       
   139     void runLunarData();
       
   140     
       
   141     void showRegionalInformation(const HbEffect::EffectStatus &status);
       
   142     void showRegionalInformationFadeIn();
       
   143     void showHideRegionalInformationChanged(const XQSettingsKey& key, const QVariant& var);
       
   144 
       
   145 public slots:
       
   146 	void changeView(TCalenCommandId viewId);
       
   147 private:
       
   148     /**
       
   149      * 
       
   150      */
       
   151     void getCurrentDate();
       
   152 
       
   153     /**
       
   154      * setup menu for the view
       
   155      */
       
   156     void setupMenu();
       
   157     
       
   158     /**
       
   159      * Connects view's slots.
       
   160      */
       
   161     void setupSlots();
       
   162 
       
   163     /**
       
   164      * Scrolls content to correct position after view repopulation
       
   165      */
       
   166     void setupViewport();
       
   167 
       
   168 private: // members related to view management and gesture handling
       
   169     
       
   170     CalenDayContentScrollArea* mContentScrollArea;  //!< Scroll area for content (events)
       
   171     
       
   172     CalenDayContentWidget* mContentWidget;    //!< Content widget
       
   173     
       
   174     CalenDayHourScrollArea* mHourScrollArea;  //!< Scroll area for hour elements
       
   175     
       
   176     CalenDayModelManager* mModelManager;
       
   177     
       
   178     QGraphicsLinearLayout* mVLayout;
       
   179     
       
   180    
       
   181 private:    
       
   182 
       
   183     XQSettingsManager* mSettingsManager;
       
   184     XQSettingsKey mRegionalInfo;
       
   185     MCalenServices  &mServices;
       
   186 	
       
   187     /**
       
   188      * Current date/time.
       
   189      */
       
   190     QDateTime mDate;
       
   191     
       
   192     HbGroupBox *mHeadingLabel;
       
   193     
       
   194     HbGroupBox *mRegionalInfoGroupBox;
       
   195     /*!
       
   196      * \brief It keep pointer to go to Today action from menu. 
       
   197      */
       
   198     HbAction *mGoToTodayMenuAction;
       
   199 };
       
   200 
       
   201 
       
   202 #endif // CALEDAYVIEW_H
       
   203 
       
   204 //End of file