phoneapp/phoneuiview2/inc/phoneuiqtview.h
changeset 78 baacf668fe89
parent 76 cfea66083b62
equal deleted inserted replaced
76:cfea66083b62 78:baacf668fe89
     1 /*!
     1 /*!
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    20 
    20 
    21 #include <QObject>
    21 #include <QObject>
    22 #include <hbview.h>
    22 #include <hbview.h>
    23 #include "phoneuiqtviewif.h"
    23 #include "phoneuiqtviewif.h"
    24 #include <bubblemanagerif.h>
    24 #include <bubblemanagerif.h>
    25 #include <qsysteminfo.h>
    25 
    26 
       
    27 class BubbleManager;
       
    28 class HbAction;
    26 class HbAction;
    29 class QSignalMapper;
    27 class PhoneUIQtViewPrivate;
    30 class HbToolBar;
       
    31 class HbVolumeSliderPopup;
       
    32 class Dialpad;
       
    33 class XQKeyCapture;
       
    34 class DialpadKeyHandler;
       
    35 
    28 
    36 #ifdef BUILD_PHONEUIQTVIEW
    29 #ifdef BUILD_PHONEUIQTVIEW
    37 #define PHONEUIQTVIEW_EXPORT Q_DECL_EXPORT
    30 #define PHONEUIQTVIEW_EXPORT Q_DECL_EXPORT
    38 #else
    31 #else
    39 #define PHONEUIQTVIEW_EXPORT Q_DECL_IMPORT
    32 #define PHONEUIQTVIEW_EXPORT Q_DECL_IMPORT
    40 #endif
    33 #endif
    41 
    34 
    42 using namespace QtMobility;
       
    43 
    35 
    44 
    36 
    45 class PHONEUIQTVIEW_EXPORT PhoneUIQtView : public HbView, public PhoneUIQtViewIF
    37 class PHONEUIQTVIEW_EXPORT PhoneUIQtView : public HbView, public PhoneUIQtViewIF
    46 {
    38 {
    47     Q_OBJECT
    39     Q_OBJECT
    49 public:
    41 public:
    50 
    42 
    51     /*!
    43     /*!
    52        Constructor
    44        Constructor
    53     */
    45     */
    54     PhoneUIQtView (HbMainWindow &window, QGraphicsItem *parent = 0);
    46     PhoneUIQtView(HbMainWindow &window, QGraphicsItem *parent = 0);
    55     
    47     
    56     /*!
    48     /*!
    57        Destructor
    49        Destructor
    58     */
    50     */
    59     virtual ~PhoneUIQtView ();
    51     virtual ~PhoneUIQtView();
    60             
    52             
    61     /*!
    53     /*!
    62         \fn void PhoneUIQtView::bubbleManager ()
    54         \fn void PhoneUIQtView::bubbleManager ()
    63         
    55         
    64         Returns BubbleManager interface.
    56         Returns BubbleManager interface.
    67     
    59     
    68     /*!
    60     /*!
    69         \fn void PhoneUIQtView::addBubbleCommand ()
    61         \fn void PhoneUIQtView::addBubbleCommand ()
    70         
    62         
    71         Adds new command to bubble. Command id will be emitted as
    63         Adds new command to bubble. Command id will be emitted as
    72         a parameter from view's command(int) signal.
    64         a parameter from view's command(int) signal. Ownership transferred.
    73     */
    65     */
    74     void addBubbleCommand (int bubbleId, const PhoneAction& action);
    66     void addBubbleCommand(int bubbleId, HbAction* action);
    75 
    67 
    76     /*!
    68     /*!
    77         \fn void PhoneUIQtView::clearBubbleCommands ()
    69         \fn void PhoneUIQtView::clearBubbleCommands ()
    78         
    70         
    79         Clears commands from bubble.
    71         Clears commands from bubble.
    80     */
    72     */
    81     void clearBubbleCommands (int bubbleId);
    73     void clearBubbleCommands(int bubbleId);
    82     
    74     
    83     /*!
    75     /*!
    84         \fn void PhoneUIQtView::addParticipantListAction ()
    76         \fn void PhoneUIQtView::addParticipantListAction ()
    85         
    77         
    86         Adds new patricipant list command to conference bubble. 
    78         Adds new patricipant list command to conference bubble. 
    95     void clearParticipantListActions();
    87     void clearParticipantListActions();
    96     
    88     
    97     /*!
    89     /*!
    98         \fn void PhoneUIQtViewIF::setToolbarActions()
    90         \fn void PhoneUIQtViewIF::setToolbarActions()
    99         
    91         
   100        Sets toolbar actions.
    92        Sets toolbar actions. Ownership transferred.
   101     */
    93     */
   102     void setToolbarActions(const QList<PhoneAction*>& actions);
    94     void setToolbarActions(const QList<HbAction *> &actions);
   103     
    95     
   104     /*!
    96     /*!
   105         \fn void PhoneUIQtView::hideToolbar ()
    97         \fn void PhoneUIQtView::hideToolbar ()
   106         
    98         
   107         Hides toolbar.
    99         Hides toolbar.
   108     */
   100     */
   109     void hideToolbar ();
   101     void hideToolbar();
   110     
   102     
   111     /*!
   103     /*!
   112         \fn void PhoneUIQtView::showToolbar ()
   104         \fn void PhoneUIQtView::showToolbar ()
   113         
   105         
   114         Shows toolbar.
   106         Shows toolbar.
   115     */
   107     */
   116     void showToolbar ();
   108     void showToolbar();
   117 
   109 
   118     /*!
   110     /*!
   119         \fn void PhoneUIQtView::volumeSliderValue ()
   111         \fn void PhoneUIQtView::volumeSliderValue ()
   120         
   112         
   121         Returns HbVolumeSliderPopup's volume value.
   113         Returns HbVolumeSliderPopup's volume value.
   122         If this volume slider isn't active -1 is returned.
   114         If this volume slider isn't active -1 is returned.
   123     */
   115     */
   124     int volumeSliderValue ();
   116     int volumeSliderValue();
   125 
   117 
   126     /*!
   118     /*!
   127         \fn void PhoneUIQtView::setVolumeSliderValue (int value)
   119         \fn void PhoneUIQtView::setVolumeSliderValue (int value)
   128         
   120         
   129         Sets slider value to HbVolumeSliderPopup.
   121         Sets slider value to HbVolumeSliderPopup.
   130     */
   122     */
   131     void setVolumeSliderValue (
   123     void setVolumeSliderValue(
   132             int value,
   124             int value,
   133             int commandId, 
   125             int commandId, 
   134             int maxVolumeValue, 
   126             int maxVolumeValue, 
   135             int minVolumeValue);
   127             int minVolumeValue);
   136 
   128     
   137     /*!
   129     /*!
   138         \fn void PhoneUIQtView::removeVolumeSlider ()
   130         \fn void PhoneUIQtView::removeVolumeSlider()
   139         
   131         
   140         Removes HbVolumeSliderPopup.
   132         Removes HbVolumeSliderPopup.
   141     */
   133     */
   142     void removeVolumeSlider ();
   134     void removeVolumeSlider();
   143 
   135     
   144     /*!
   136     /*!
   145         \fn void PhoneUIQtView::setExpandAction ()
   137         \fn void PhoneUIQtView::setExpandAction ()
   146         
   138         
   147         Sets expand action.
   139         Sets expand action.
   148     */
   140     */
   203         Brings to foreground.
   195         Brings to foreground.
   204     */
   196     */
   205     void bringToForeground();
   197     void bringToForeground();
   206     
   198     
   207     /*!
   199     /*!
       
   200         \fn void PhoneUIQtViewIF::hide()
       
   201         
       
   202         Lowers the phone to the bottom of the stack.
       
   203      */
       
   204     void hide();
       
   205     
       
   206     /*!
   208         \fn void PhoneUIQtViewIF::setToolbarActions()
   207         \fn void PhoneUIQtViewIF::setToolbarActions()
   209         
   208         
   210        Sets menu actions for call handling.
   209        Sets menu actions for call handling. Ownership transferred.
   211     */
   210     */
   212     void setMenuActions(const QList<PhoneAction*>& actions);
   211     void setMenuActions(const QList<HbAction *> &actions);
   213     
   212     
   214     /*!
   213     /*!
   215         \fn void PhoneUIQtView::setBackButtonVisible()
   214         \fn void PhoneUIQtView::setBackButtonVisible()
   216         
   215         
   217         Set the Back command visibility in TitleBar
   216         Set the Back command visibility in TitleBar
   237         
   236         
   238         Sets Ui to restricted mode. Decides which keyevent are allowed.
   237         Sets Ui to restricted mode. Decides which keyevent are allowed.
   239      */
   238      */
   240     void setRestrictedMode(bool restrictedMode);
   239     void setRestrictedMode(bool restrictedMode);
   241     
   240     
   242 public slots:
       
   243 
       
   244     /*!
       
   245         \fn void PhoneUIQtView::volumeSliderClosed ()
       
   246         
       
   247         HbVolumeSliderPopup calls this method when slider
       
   248         is going to be closed.
       
   249     */
       
   250     void volumeSliderClosed ();
       
   251     
       
   252     /*!
       
   253         \fn void PhoneUIQtView::volumeSliderChanged (int value)
       
   254         
       
   255         HbVolumeSliderPopup calls this method when it's value is changed.
       
   256     */
       
   257     void volumeSliderChanged(int value);
       
   258 
       
   259     /*!
       
   260         \fn void PhoneUIQtView::handleOrientationChange(Qt::Orientation orientation)
       
   261         
       
   262         HbMainWindow calls this method when orientation is changed.
       
   263     */
       
   264     void handleOrientationChange(Qt::Orientation orientation);
       
   265         
       
   266     /*!
       
   267         \fn void PhoneUIQtView::backButtonClicked(Qt::Orientation orientation)
       
   268         
       
   269         HbMainWindow calls this method when back softkey is clicked.
       
   270     */    
       
   271     void backButtonClicked();
       
   272     
       
   273     /*!
       
   274         \fn void PhoneUIQtView::onEditorContentChanged()
       
   275         
       
   276         Dialpad calls this method when dialpad content is changed.
       
   277     */
       
   278     void onEditorContentChanged();
       
   279     
       
   280     /*!
       
   281         \fn void dialpadClosed()
       
   282         
       
   283         Dialpad calls this method when dialpad is closed.
       
   284     */
       
   285     void dialpadClosed();
       
   286 
       
   287     /*!
   241     /*!
   288         \fn void PhoneUIQtView::shutdownPhoneApp()
   242         \fn void PhoneUIQtView::shutdownPhoneApp()
   289         
   243         
   290         Shutdown phone application.
   244         Shutdown phone application.
   291     */
   245     */
   292     void shutdownPhoneApp();
   246     void shutdownPhoneApp();
   293     
       
   294     /*!
       
   295         \fn void PhoneUIQtView::networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName)
       
   296         
       
   297         Network name change is informed via this method.
       
   298     */
       
   299     void networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName);
       
   300     
       
   301    
       
   302 signals:
   247 signals:
   303 
   248 
   304     /*!
   249     /*!
   305         \fn void keyPressed (QKeyEvent *event)
   250         \fn void keyPressed (QKeyEvent *event)
   306         
   251         
   307         This signal is emitted when key is pressed down.
   252         This signal is emitted when key is pressed down.
   308     */
   253     */
   309     void keyPressed (QKeyEvent *event);
   254     void keyPressed(QKeyEvent *event);
   310 
   255 
   311     /*!
   256     /*!
   312         \fn void keyPressed (QKeyEvent *event)
   257         \fn void keyPressed (QKeyEvent *event)
   313         
   258         
   314         This signal is emitted when key is released.
   259         This signal is emitted when key is released.
   315     */
   260     */
   316     void keyReleased (QKeyEvent *event);
   261     void keyReleased(QKeyEvent *event);
   317     
   262     
   318     /*!
   263     /*!
   319         \fn void command(int command)
   264         \fn void command(int command)
   320         
   265         
   321         This signal is emitted when UI action is handled.
   266         This signal is emitted when UI action is handled.
   322     */
   267     */
   323     void command (int command);
   268     void command(int command);
   324     
   269     
   325     /*!
   270     /*!
   326         \fn void dialpadIsAboutToClose()
   271         \fn void dialpadIsAboutToClose()
   327         
   272         
   328         This signal is emitted when dialpad is about to close.
   273         This signal is emitted when dialpad is about to close.
   341          
   286          
   342          This signal is emitted when window is deactivated
   287          This signal is emitted when window is deactivated
   343      */
   288      */
   344     void windowDeactivated();
   289     void windowDeactivated();
   345     
   290     
   346 protected:
   291 public slots:
   347 
   292     /*!
   348     /*!
   293         \fn void handleOrientationChange(Qt::Orientation orientation)
   349         \fn void eventFilter(int command)
   294     */
   350         
   295     void handleOrientationChange(Qt::Orientation orientation);
   351         Handles key events.
       
   352     */
       
   353     bool eventFilter(QObject * watched, QEvent * event);
       
   354     
   296     
   355 private:
   297 private:
   356 
   298     friend class PhoneUIQtViewPrivate;
   357     /*!
   299     PhoneUIQtViewPrivate *m_priv;
   358         \fn void setDialpadPosition(int command)
       
   359         
       
   360         Sets dialpad position.
       
   361     */
       
   362     void setDialpadPosition();
       
   363 
       
   364     /*!
       
   365         \fn void setActionRole()
       
   366         
       
   367         Sets action role.
       
   368     */    
       
   369     static void setActionRole(const PhoneAction& pa, HbAction& action);
       
   370 
       
   371     /*!
       
   372         \fn void createToolBarActions()
       
   373         
       
   374         Creates tool bar actions.
       
   375     */
       
   376     void createToolBarActions();
       
   377     
       
   378     /*!
       
   379         \fn void updateMenuVisibility()
       
   380      */
       
   381     void updateMenuVisibility();
       
   382     
       
   383 private:
       
   384     HbMainWindow        &m_window;
       
   385     BubbleManager       *m_bubbleManager;
       
   386     QMap<int , QSignalMapper *> m_bubbleMap;
       
   387     QMap<int , QList<HbAction *> *> m_bubbleActionMap;
       
   388     QSignalMapper       *m_signalMapper;
       
   389     QList<HbAction *>   m_toolbarActions;
       
   390     HbVolumeSliderPopup *m_volumeSlider;
       
   391     QSignalMapper       *m_expandSignalMapper;
       
   392     QMap<int , HbAction*> m_expandActionMap;
       
   393     QSignalMapper       *m_participantListSignalMapper;
       
   394     QList<HbAction *>   m_participantListActions;
       
   395     int                 m_volumeCommandId;
       
   396     HbAction            *m_backAction;
       
   397     Dialpad             *m_dialpad;
       
   398     QSignalMapper       *m_menuSignalMapper;
       
   399     XQKeyCapture        *m_keyCapture;
       
   400     QSystemNetworkInfo  *m_networkInfo;
       
   401     QList<Qt::Key>      m_keyCaptures;
       
   402     DialpadKeyHandler   *m_dialpadKeyHandler;
       
   403     bool                m_restrictedMode;
       
   404     HbMenu              *m_optionsMenu;
       
   405 };
   300 };
   406 
   301 
   407 #endif // PHONEUIQTVIEW_H
   302 #endif // PHONEUIQTVIEW_H