videocollection/tsrc/stubs/inc/hbmainwindow.h
branchRCL_3
changeset 56 839377eedc2b
equal deleted inserted replaced
54:315810614048 56:839377eedc2b
       
     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:  stub hbmainwindow
       
    15 * 
       
    16 */
       
    17 
       
    18 #ifndef HBMAINWINDOW_H
       
    19 #define HBMAINWINDOW_H
       
    20 
       
    21 #include <QObject>
       
    22 #include "hbwidget.h"
       
    23 #include "hbaction.h"
       
    24 
       
    25 class HbView;
       
    26 
       
    27 class HbMainWindow : public QObject
       
    28 {
       
    29     Q_OBJECT
       
    30 
       
    31 public:
       
    32 
       
    33     /**
       
    34      * constructor
       
    35      */
       
    36     HbMainWindow(QWidget *parent = 0, Hb::WindowFlags windowFlags = Hb::WindowFlagNone) :
       
    37     mSoftKeyAction(0),
       
    38     mOrientation(Qt::Vertical),
       
    39     mOrientationSet(false),
       
    40     mCurrentView(0)
       
    41     {
       
    42         Q_UNUSED(parent);
       
    43         Q_UNUSED(windowFlags);
       
    44     }
       
    45     
       
    46     /**
       
    47      * destructor
       
    48      */
       
    49     ~HbMainWindow() {};
       
    50     
       
    51     /**
       
    52      * dummy
       
    53      */
       
    54     void addSoftKeyAction(Hb::SoftKeyId type, HbAction *action)
       
    55     {
       
    56         Q_UNUSED(type);
       
    57         mSoftKeyAction = action;
       
    58     }
       
    59     
       
    60     void removeSoftKeyAction(Hb::SoftKeyId type, HbAction *action)
       
    61     {
       
    62         Q_UNUSED(type);
       
    63         if(mSoftKeyAction == action)
       
    64         {
       
    65             mSoftKeyAction = 0;
       
    66         }
       
    67     }
       
    68     
       
    69     
       
    70     /**
       
    71      * returns mSoftKeyAction
       
    72      */
       
    73     HbAction* softKeyAction(Hb::SoftKeyId type)
       
    74     {
       
    75         Q_UNUSED(type);
       
    76         return mSoftKeyAction;
       
    77     }
       
    78     
       
    79     HbView *addView(QGraphicsWidget *widget = 0);
       
    80     
       
    81     void removeView(QGraphicsWidget *widget);
       
    82     
       
    83     QList<HbView *> views() const;
       
    84     
       
    85     HbView *currentView() const;
       
    86     
       
    87     void setCurrentView(HbView *view);
       
    88     
       
    89     Qt::Orientation orientation() const
       
    90     {
       
    91         return mOrientation;
       
    92     }
       
    93     
       
    94     void setOrientation(Qt::Orientation orientation, bool animate = true)
       
    95     {
       
    96         Q_UNUSED(animate);
       
    97         mOrientation = orientation;
       
    98         mOrientationSet = true;
       
    99     }
       
   100     
       
   101     void unsetOrientation(bool animate = true)
       
   102     {
       
   103         Q_UNUSED(animate);
       
   104         mOrientation = Qt::Vertical;
       
   105         mOrientationSet = false;
       
   106     }
       
   107     
       
   108 signals:
       
   109 
       
   110     void aboutToChangeOrientation();
       
   111     void orientationChanged(Qt::Orientation orientation);
       
   112     
       
   113 public:
       
   114     
       
   115     /**
       
   116      * value to return from softKeyAction
       
   117      */
       
   118     HbAction *mSoftKeyAction;
       
   119     
       
   120     /**
       
   121      * views
       
   122      */
       
   123     QList<HbView *> mViews;
       
   124     
       
   125     /**
       
   126      * orientation
       
   127      */
       
   128     Qt::Orientation mOrientation;
       
   129     
       
   130     /**
       
   131      * orientation set
       
   132      */
       
   133     bool mOrientationSet;
       
   134     
       
   135     HbView *mCurrentView;
       
   136     
       
   137 };
       
   138 #endif