calendarwidgetplugin/inc/dateiconlayouthandler.h
changeset 0 db1bf15cefff
equal deleted inserted replaced
-1:000000000000 0:db1bf15cefff
       
     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: Calendar widget's date icon layout handler
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DATEICONLAYOUTHANDLER_H
       
    19 #define DATEICONLAYOUTHANDLER_H
       
    20 
       
    21 // System includes
       
    22 #include <QObject>
       
    23 
       
    24 // Forward declarations
       
    25 class HbLabel;
       
    26 class HbFrameDrawer;
       
    27 class HbWidget;
       
    28 class QTimer;
       
    29 class QPointF;
       
    30 class XQServiceRequest;
       
    31 class DateTimeObserver;
       
    32 class TestDateIconLayoutHandler;
       
    33 class HbDocumentLoader;
       
    34 
       
    35 // Class declaration
       
    36 class DateIconLayoutHandler: public QObject
       
    37 {
       
    38     Q_OBJECT
       
    39     Q_PROPERTY(int testID READ testId WRITE setTestId)
       
    40     Q_PROPERTY(int testResult READ testResult WRITE setTestResult)
       
    41 
       
    42 public:
       
    43     DateIconLayoutHandler();
       
    44     ~DateIconLayoutHandler();
       
    45 
       
    46     //Test property functions
       
    47     int testId();
       
    48     void setTestId(int testID);
       
    49     int testResult();
       
    50     void setTestResult(int testResult);
       
    51 
       
    52 signals:
       
    53     void dateChanged();
       
    54     void requestComplete();
       
    55     void requestError();
       
    56 
       
    57 public slots:
       
    58     void initializeLayout(const HbDocumentLoader &layoutLoader, QObject *owner);
       
    59     void updateLayout();
       
    60     void onTap(QPointF &point); //TODO: change this with onGesture at some point
       
    61     void onThemeChange();
       
    62     void handleOk(const QVariant& var);
       
    63     void handleError(int err, const QString& str);
       
    64 
       
    65 private:
       
    66     void setCalendarIconContent();
       
    67     void launchCalendarMonthView();
       
    68     void setLabelsColor();
       
    69 
       
    70 private: // data
       
    71     Q_DISABLE_COPY(DateIconLayoutHandler)
       
    72 
       
    73     HbWidget* mWidget;
       
    74 
       
    75     // Labels (not owned)
       
    76     HbLabel* mNumberLabel;
       
    77     HbLabel* mMonthLabel;
       
    78 
       
    79     // Background drawer (not owned)
       
    80     HbFrameDrawer* mFrameDrawer;
       
    81 
       
    82     // Owned
       
    83     DateTimeObserver* mDateObserver;
       
    84 
       
    85     // Test variables
       
    86     int mTestID;
       
    87     int mTestResult;
       
    88 
       
    89     friend class TestDateIconLayoutHandler;
       
    90 };
       
    91 
       
    92 #endif // DATEICONLAYOUTHANDLER_H