calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentscrollarea/hbmainwindow.h
changeset 70 a5ed90760192
child 83 5aadd1120515
equal deleted inserted replaced
64:1881ad52dc45 70:a5ed90760192
       
     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: Mocked classes for testing CalenDayUtils class
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef  HBMAINWINDOW_H
       
    19 #define  HBMAINWINDOW_H
       
    20 
       
    21 #include <HbView>
       
    22 
       
    23 // Test variables
       
    24 extern QRectF gTestWindowRect;
       
    25 extern Qt::Orientation gTestOrientation;
       
    26 
       
    27 /*!
       
    28  Mocked class HbMainWindow (simulating window in unittests)
       
    29  */
       
    30 class HbMainWindow : public QObject
       
    31 {
       
    32 public:
       
    33     HbMainWindow()
       
    34     {
       
    35         mView = new HbView();
       
    36     }
       
    37 
       
    38     ~HbMainWindow()
       
    39     {
       
    40         if (mView) {
       
    41             delete mView;
       
    42             mView = 0;
       
    43         }
       
    44     }
       
    45 
       
    46     QRectF layoutRect() const
       
    47     {
       
    48         return gTestWindowRect;
       
    49     }
       
    50 
       
    51     Qt::Orientation orientation() const
       
    52     {
       
    53         return gTestOrientation;
       
    54     }
       
    55 
       
    56     HbView *HbMainWindow::currentView() const
       
    57     {
       
    58         return mView;
       
    59     }
       
    60 
       
    61     HbView *mView;
       
    62     
       
    63 signals:
       
    64     void orientationChanged(Qt::Orientation orientation);
       
    65 };
       
    66 
       
    67 #endif // HBMAINWINDOW_H