src/hbwidgets/devicedialogs/hbdevicemessageboxsymbian.cpp
changeset 34 ed14f46c0e55
parent 7 923ff622b8b9
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    79         EFirstIntProperty,
    79         EFirstIntProperty,
    80         EType = EFirstIntProperty,
    80         EType = EFirstIntProperty,
    81         EIconVisible,
    81         EIconVisible,
    82         ETimeout,
    82         ETimeout,
    83         EStandardButtons,
    83         EStandardButtons,
       
    84         EShowLevel,
    84         EDismissPolicy,
    85         EDismissPolicy,
    85         ELastIntProperty = EDismissPolicy,
    86         ELastIntProperty = EDismissPolicy,
    86         EFirstStringProperty,
    87         EFirstStringProperty,
    87         EText = EFirstStringProperty,
    88         EText = EFirstStringProperty,
    88         EIconName,
    89         EIconName,
   444     static const wchar_t * const names[] = {
   445     static const wchar_t * const names[] = {
   445         L"type",
   446         L"type",
   446         L"iconVisible",
   447         L"iconVisible",
   447         L"timeout",
   448         L"timeout",
   448         L"standardButtons",
   449         L"standardButtons",
       
   450         L"showLevel",
   449         L"dismissPolicy",
   451         L"dismissPolicy",
   450         L"text",
   452         L"text",
   451         L"iconName",
   453         L"iconName",
   452         L"acceptAction",
   454         L"acceptAction",
   453         L"rejectAction",
   455         L"rejectAction",
   536     if (mActiveSchedulerWait.IsStarted()) {
   538     if (mActiveSchedulerWait.IsStarted()) {
   537         mActiveSchedulerWait.AsyncStop();
   539         mActiveSchedulerWait.AsyncStop();
   538     }
   540     }
   539 }
   541 }
   540 
   542 
   541 /*!
   543 // Set dialog show level
       
   544 void SetShowLevel(CHbDeviceMessageBoxPrivate *aBox, TInt aLevel)
       
   545 {
       
   546     aBox->SetPropertyValue(CHbDeviceMessageBoxPrivate::EShowLevel, aLevel);
       
   547 }
       
   548 
       
   549 /*!
       
   550     @stable
       
   551     @hbwidgets
       
   552 
   542     \class CHbDeviceMessageBoxSymbian
   553     \class CHbDeviceMessageBoxSymbian
   543     \brief CHbDeviceMessageBoxSymbian is a Symbian implementation of HbDeviceMessageBox.
   554     \brief CHbDeviceMessageBoxSymbian is a Symbian implementation of HbDeviceMessageBox.
       
   555 
       
   556     <b>This class is Symbian only. Not available on other platforms.</b>
   544 
   557 
   545     CHbDeviceMessageBoxSymbian is intended for use by servers that don't run Qt event loop
   558     CHbDeviceMessageBoxSymbian is intended for use by servers that don't run Qt event loop
   546     and cannot use HbDeviceMessageBox.
   559     and cannot use HbDeviceMessageBox.
   547 
   560 
   548     It displays a message box with text, icon or animation and two optional buttons,
   561     It displays a message box with text, icon or animation and two optional buttons,
   549     accept and reject.
   562     accept and reject.
   550 
   563 
   551     It provides a similar interface as HbDeviceMessageBox. The main
   564     It provides a similar interface as HbDeviceMessageBox. The main
   552     differences are:
   565     differences are:
   553     - Signals are replaced by an observer interface
   566     - Signals are replaced by an observer interface
   554     - HbAction/QAction is replaced by button information.
   567     - HbAction/QAction is replaced by button text.
   555     - Function parameters whose type is a Qt or Hb enumeration are replaced by an integer.
   568     - Function parameters whose type is a Qt or Hb enumeration are replaced by an integer.
   556       As suitable default values are set at construction, it is assumed that application rarely
   569       As suitable default values are set at construction, it is assumed that application rarely
   557       needs to use these.
   570       needs to use these.
   558 
   571 
   559     Device message box is a modal dialog. It is shown on top of applications by device dialog
   572     Device message box is a modal dialog. It is shown on top of applications by device dialog
   560     server. CHbDeviceMessageBoxSymbian is a client of the server.
   573     server. CHbDeviceMessageBoxSymbian is a client of the server.
   561 
   574 
   562     Three predefined message boxes are provided or a custom one can be constructed using the API.
   575     Four types of message boxes are predefined. The type determines a set of default properties that
   563     Predefined message boxes are:
   576     are set on construction. Below is a table listing types and their default properties.
   564     - Information
   577 
   565     - Question
   578     <table border="1">
   566     - Warning
   579         <caption><b>HbDeviceMessageBox types and default properties</b></caption>
   567 
   580         <tr><th>Type</th><th>Icon</th><th>Buttons</th><th>Timeout</th><th>Dismiss policy</th><th>Sound</th></tr>
   568     ShowL() displays a message box asynchronously. The function returns immediately. The launched
   581         <tr><td>ENone</td><td>No icon</td><td>"Ok" button</td><td>Standard timeout</td><td>Tap anywhere</td><td>No sound</td></tr>
       
   582         <tr><td>EInformation</td><td>Info icon</td><td>"Ok" button</td><td>Standard timeout</td><td>Tap anywhere</td><td>Info sound</td></tr>
       
   583         <tr><td>EWarning</td><td>Warning icon</td><td>"Ok" button</td><td>Standard timeout</td><td>Tap anywhere</td><td>Warn sound</td></tr>
       
   584         <tr><td>EQuestion</td><td>Question icon</td><td>"Yes" and "No" buttons</td><td>No timeout</td><td>Button press</td><td>Question sound</td></tr>
       
   585     </table>
       
   586 
       
   587     ShowL() displays a message box asynchronously. The function returns immediately.
       
   588     A new message box is lauched every time ShowL() is called. The launched
   569     dialog can be updated by setters and then calling UpdateL(). Closing can be observed by a
   589     dialog can be updated by setters and then calling UpdateL(). Closing can be observed by a
   570     callback. Because each UpdateL() after the ShowL() requires interprocess communication,
   590     callback. Because each UpdateL() after the ShowL() requires interprocess communication,
   571     it's advisable to fully construct the device message box before displaying it.
   591     it's advisable to fully construct the device message box before displaying it.
   572 
   592 
   573     A device message box is launched synchronously by ExecL() function. The function returns when
   593     A device message box is launched synchronously by ExecL() function. The function returns when
   583 
   603 
   584     Static convenience functions are provided for ease of use. Message boxes created by these
   604     Static convenience functions are provided for ease of use. Message boxes created by these
   585     static functions contain a default set of properties depending on the message box type and their
   605     static functions contain a default set of properties depending on the message box type and their
   586     contents cannot be updated while the message box executes.
   606     contents cannot be updated while the message box executes.
   587 
   607 
   588     Supported animation formats are following:
   608     If CHbDeviceMessageBoxSymbian has no observer set, the object can be deleted after
       
   609     ShowL() has been called and device-dialog service takes care showing the message box. If
       
   610     observer is set, message box is closed when CHbDeviceMessageBoxSymbian object goes out of
       
   611     scope.  
       
   612 
       
   613     An animation can replace an icon on device message box. Supported icon animation formats are
       
   614     following:
       
   615 
   589     - GIF (.gif)
   616     - GIF (.gif)
   590     - MNG (.mng)
   617     - MNG (.mng)
   591         - Frame animations
   618         - Frame animations
   592 
   619 
   593     Sample code:
   620     Sample code:
   664     iMessageBox->SetIconNameL(KIconName);
   691     iMessageBox->SetIconNameL(KIconName);
   665     iMessageBox->ShowL();
   692     iMessageBox->ShowL();
   666     \endcode
   693     \endcode
   667 
   694 
   668     \sa HbDeviceMessageBox, HbMessageBox, MHbDeviceMessageBoxObserver
   695     \sa HbDeviceMessageBox, HbMessageBox, MHbDeviceMessageBoxObserver
   669 
       
   670     @stable
       
   671     @hbwidgets
       
   672 */
   696 */
   673 
   697 
   674 /*!
   698 /*!
   675     \enum CHbDeviceMessageBoxSymbian::TType
   699     \enum CHbDeviceMessageBoxSymbian::TType
   676     Predefined device message boxes.
   700     Message box type. Determines a set of default properties for the message box.
   677 */
   701 */
   678 /*!
   702 /*!
   679     \var CHbDeviceMessageBoxSymbian::TType CHbDeviceMessageBoxSymbian::ENone
   703     \var CHbDeviceMessageBoxSymbian::TType CHbDeviceMessageBoxSymbian::ENone
   680     Message box with no icon and audio defined by default.
   704     Message box with no icon and audio defined.
   681 */
   705 */
   682 /*!
   706 /*!
   683     \var CHbDeviceMessageBoxSymbian::TType CHbDeviceMessageBoxSymbian::EInformation
   707     \var CHbDeviceMessageBoxSymbian::TType CHbDeviceMessageBoxSymbian::EInformation
   684     Information message box.
   708     Information message box.
   685 */
   709 */
   709     Reject button.
   733     Reject button.
   710 */
   734 */
   711 
   735 
   712 /*!
   736 /*!
   713     \class MHbDeviceMessageBoxObserver
   737     \class MHbDeviceMessageBoxObserver
   714     \brief Interface to observe CHbDeviceMessageBoxSymbian.
   738     \brief MHbDeviceMessageBoxObserver is an observer interface for observing CHbDeviceMessageBoxSymbian.
   715 
   739 
   716     \sa CHbDeviceMessageBoxSymbian
   740     \sa CHbDeviceMessageBoxSymbian
   717 */
   741 */
   718 
   742 
   719 /*!
   743 /*!
   727     \param aButton Button that was pressed.
   751     \param aButton Button that was pressed.
   728 
   752 
   729     \sa CHbDeviceMessageBoxSymbian::SetObserver()
   753     \sa CHbDeviceMessageBoxSymbian::SetObserver()
   730 */
   754 */
   731 
   755 
   732 // Constructor
   756 /*!
       
   757     Constructs CHbDeviceMessageBoxSymbian.
       
   758 */
   733 CHbDeviceMessageBoxSymbian::CHbDeviceMessageBoxSymbian()
   759 CHbDeviceMessageBoxSymbian::CHbDeviceMessageBoxSymbian()
   734 {
   760 {
   735 }
   761 }
   736 
   762 
   737 // Destructor
   763 /*!
       
   764     Destructs CHbDeviceMessageBoxSymbian. The message box launched by ShowL()
       
   765     is closed if observer is set. If there is no observer, it is
       
   766     left executing and closes itself by timeout.
       
   767 */
   738 EXPORT_C CHbDeviceMessageBoxSymbian::~CHbDeviceMessageBoxSymbian()
   768 EXPORT_C CHbDeviceMessageBoxSymbian::~CHbDeviceMessageBoxSymbian()
   739 {
   769 {
   740     delete d;
   770     delete d;
   741 }
   771 }
   742 
   772 
   743 /*!
   773 /*!
   744     Factory function. Returns pointer to a device message box.
   774     Constructs a new CHbDeviceMessageBoxSymbian and returns a pointer it.
   745 
   775 
   746     \param aType Selects a template for the message box. Information, question or warning.
   776     \param aType Selects a template for the message box. None, information, question or warning.
   747     \param aObserver Observer for message box close event
   777     \param aObserver Observer for message box close event. 0 if no observer.
   748 */
   778 */
   749 EXPORT_C CHbDeviceMessageBoxSymbian* CHbDeviceMessageBoxSymbian::NewL(TType aType,
   779 EXPORT_C CHbDeviceMessageBoxSymbian* CHbDeviceMessageBoxSymbian::NewL(TType aType,
   750     MHbDeviceMessageBoxObserver *aObserver)
   780     MHbDeviceMessageBoxObserver *aObserver)
   751 {
   781 {
   752     ARG_UNUSED(aObserver)
   782     ARG_UNUSED(aObserver)
   763 }
   793 }
   764 
   794 
   765 /*!
   795 /*!
   766     Static convenience function to create and show a question device message box. Waits for
   796     Static convenience function to create and show a question device message box. Waits for
   767     the message box to close and returns button selected. If message box was closed for other
   797     the message box to close and returns button selected. If message box was closed for other
   768     reason than button press, returns EInvalidButton.
   798     reason than button press, returns CHbDeviceMessageBoxSymbian::EInvalidButton.
   769 
   799 
   770     <b> Beware that Symbian event processing is running while the function executes. For example
   800     <b> Beware that Symbian event processing is running while the function executes. For example
   771     application may have exited when the function returns.</b>
   801     application may have exited when the function returns.</b>
   772 
   802 
   773     \param aText Message box text.
   803     \param aText Message box text.
   793 }
   823 }
   794 
   824 
   795 /*!
   825 /*!
   796     Static convenience function to create and show a question device message box. Waits for
   826     Static convenience function to create and show a question device message box. Waits for
   797     the message box to close and returns button selected. If message box was closed for other
   827     the message box to close and returns button selected. If message box was closed for other
   798     reason than button press, returns EInvalidButton.
   828     reason than button press, returns CHbDeviceMessageBoxSymbian::EInvalidButton.
   799 
   829 
   800     <b> Beware that Symbian event processing is running while the function executes. For example
   830     <b> Beware that Symbian event processing is running while the function executes. For example
   801     application may have exited when the function returns.</b>
   831     application may have exited when the function returns.</b>
   802 
   832 
   803     \param aText Message box text.
   833     \param aText Message box text.
   818     CleanupStack::PopAndDestroy(); // messageBox
   848     CleanupStack::PopAndDestroy(); // messageBox
   819     return buttonId;
   849     return buttonId;
   820 }
   850 }
   821 
   851 
   822 /*!
   852 /*!
   823     Static convenience function to create and show an information device message box.
   853     Static convenience function to create and show an information device message box. Returns
       
   854     immediately (doesn't wait for the box to close).
   824 
   855 
   825     \param aText Message box text.
   856     \param aText Message box text.
   826 */
   857 */
   827 EXPORT_C void CHbDeviceMessageBoxSymbian::InformationL(const TDesC& aText)
   858 EXPORT_C void CHbDeviceMessageBoxSymbian::InformationL(const TDesC& aText)
   828 {
   859 {
   832     messageBox->ShowL();
   863     messageBox->ShowL();
   833     CleanupStack::PopAndDestroy(); // messageBox
   864     CleanupStack::PopAndDestroy(); // messageBox
   834 }
   865 }
   835 
   866 
   836 /*!
   867 /*!
   837     Static convenience function to create and show a warning device message box.
   868     Static convenience function to create and show a warning device message box. Returns
       
   869     immediately (doesn't wait for the box to close).
   838 
   870 
   839     \param aText Message box text.
   871     \param aText Message box text.
   840 */
   872 */
   841 EXPORT_C void CHbDeviceMessageBoxSymbian::WarningL(const TDesC& aText)
   873 EXPORT_C void CHbDeviceMessageBoxSymbian::WarningL(const TDesC& aText)
   842 {
   874 {
   871 {
   903 {
   872     d->SendToServerL(false);
   904     d->SendToServerL(false);
   873 }
   905 }
   874 
   906 
   875 /*!
   907 /*!
   876     Closes a device message box.
   908     Closes a device message box. Closing of the message box can be observer with
   877 
   909     MHbDeviceMessageBoxObserver.
   878     \sa ShowL()
   910 
       
   911     \sa ShowL(),  SetObserver()
   879 */
   912 */
   880 EXPORT_C void CHbDeviceMessageBoxSymbian::Close()
   913 EXPORT_C void CHbDeviceMessageBoxSymbian::Close()
   881 {
   914 {
   882     d->Close();
   915     d->Close();
   883 }
   916 }
   884 
   917 
   885 /*!
   918 /*!
   886     Shows a device message box synchronously. Function launches the message box and waits for it
   919     Shows a device message box synchronously. Function launches the message box and waits for it
   887     to close. Returns a button that was selected. If message box was closed for other reason
   920     to close. Returns a button that was selected. If message box was closed for other reason
   888     than button press, returns EInvalidButton.
   921     than button press, returns CHbDeviceMessageBoxSymbian::EInvalidButton.
   889 
   922 
   890     <b> Beware that Symbian event processing is running while the function executes. For example
   923     <b> Beware that Symbian event processing is running while the function executes. For example
   891     application may have exited when the function returns.</b>
   924     application may have exited when the function returns.</b>
   892 
   925 
   893     \sa ShowL()
   926     \sa ShowL()
   904     return buttonId;
   937     return buttonId;
   905 }
   938 }
   906 
   939 
   907 /*!
   940 /*!
   908     Sets message box type. All message box properties are reset to a default values for the type.
   941     Sets message box type. All message box properties are reset to a default values for the type.
   909     A ShowL() must be called to launch a message box after SetTypeL() has been called.
   942     Type of a showing message box cannot be changed on the fly. A ShowL() must be called to launch
       
   943     a new message box after SetTypeL() has been called.
   910 
   944 
   911     \param aType Message box type.
   945     \param aType Message box type.
   912 
   946 
   913     \sa Type()
   947     \sa Type(), ShowL()
   914 */
   948 */
   915 EXPORT_C void CHbDeviceMessageBoxSymbian::SetTypeL(TType aType)
   949 EXPORT_C void CHbDeviceMessageBoxSymbian::SetTypeL(TType aType)
   916 {
   950 {
   917     d->InitProperties(aType);
   951     d->InitProperties(aType);
   918     d->mShowCalled = false;
   952     d->mShowCalled = false;
   928     return static_cast<TType>(
   962     return static_cast<TType>(
   929         d->mProperties[CHbDeviceMessageBoxPrivate::EType].IntValue());
   963         d->mProperties[CHbDeviceMessageBoxPrivate::EType].IntValue());
   930 }
   964 }
   931 
   965 
   932 /*!
   966 /*!
   933     Sets message box text. The message box gets updated next time ShowL() or UpdateL()
   967     Sets message box text.
   934     is called.
       
   935 
   968 
   936     \param aText Message box text.
   969     \param aText Message box text.
   937 
   970 
   938     \sa Text()
   971     \sa Text(), ShowL(), UpdateL()
   939 */
   972 */
   940 EXPORT_C void CHbDeviceMessageBoxSymbian::SetTextL(const TDesC& aText)
   973 EXPORT_C void CHbDeviceMessageBoxSymbian::SetTextL(const TDesC& aText)
   941 {
   974 {
   942     d->SetPropertyValueL(CHbDeviceMessageBoxPrivate::EText, aText);
   975     d->SetPropertyValueL(CHbDeviceMessageBoxPrivate::EText, aText);
   943 }
   976 }
   951 {
   984 {
   952     return d->mProperties[CHbDeviceMessageBoxPrivate::EText].StringValue();
   985     return d->mProperties[CHbDeviceMessageBoxPrivate::EText].StringValue();
   953 }
   986 }
   954 
   987 
   955 /*!
   988 /*!
   956     Sets message box icon name or animation logical name. The message box gets updated next time ShowL() or UpdateL()
   989     Sets message box icon name or animation logical name.
   957     is called.
       
   958 
   990 
   959     \param aIconName Icon name. Icon can be from Hb resources or themes. Or can be a file in
   991     \param aIconName Icon name. Icon can be from Hb resources or themes. Or can be a file in
   960     a file system.
   992     a file system.
   961 
   993 
   962     \sa IconName()
   994     \sa IconName(), ShowL(), UpdateL()
   963 */
   995 */
   964 EXPORT_C void CHbDeviceMessageBoxSymbian::SetIconNameL(const TDesC& aIconName)
   996 EXPORT_C void CHbDeviceMessageBoxSymbian::SetIconNameL(const TDesC& aIconName)
   965 {
   997 {
   966     d->SetPropertyValueL(CHbDeviceMessageBoxPrivate::EIconName, aIconName);
   998     d->SetPropertyValueL(CHbDeviceMessageBoxPrivate::EIconName, aIconName);
   967 }
   999 }
   975 {
  1007 {
   976     return d->mProperties[CHbDeviceMessageBoxPrivate::EIconName].StringValue();
  1008     return d->mProperties[CHbDeviceMessageBoxPrivate::EIconName].StringValue();
   977 }
  1009 }
   978 
  1010 
   979 /*!
  1011 /*!
   980     Sets message box animation definition name.  The message box gets updated next time ShowL() or UpdateL()
  1012     Sets message box animation definition name.
   981     is called.
  1013 
   982 
  1014     Supported icon animation formats are following:
   983     Supported animation formats are following:
       
   984     - GIF (.gif)
  1015     - GIF (.gif)
   985     - MNG (.mng)
  1016     - MNG (.mng)
   986         - Frame animations
  1017     - Frame animations
   987 
  1018 
   988     \param aAnimationDefinition Animation definition file name. Definition can be from Hb resources or themes.
  1019     \param aAnimationDefinition Animation definition file name. Definition can be from Hb resources or themes.
   989     Or can be a file in a file system. The definition must be stored to a place where it can be accessed by
  1020     Or can be a file in a file system. The definition must be stored to a place where it can be accessed by
   990     device dialog service.
  1021     device dialog service.
   991 
  1022 
   992     \sa AnimationDefinition() SetIconNameL() HbIconAnimationManager::addDefinitionFile()
  1023     \sa AnimationDefinition() SetIconNameL() HbIconAnimationManager::addDefinitionFile(), ShowL(), UpdateL()
   993 */
  1024 */
   994 EXPORT_C void CHbDeviceMessageBoxSymbian::SetAnimationDefinitionL(const TDesC& aAnimationDefinition)
  1025 EXPORT_C void CHbDeviceMessageBoxSymbian::SetAnimationDefinitionL(const TDesC& aAnimationDefinition)
   995 {
  1026 {
   996 	d->SetPropertyValueL(CHbDeviceMessageBoxPrivate::EAnimationDefinition, aAnimationDefinition);
  1027     d->SetPropertyValueL(CHbDeviceMessageBoxPrivate::EAnimationDefinition, aAnimationDefinition);
   997 }
  1028 }
   998 
  1029 
   999 /*!
  1030 /*!
  1000     Returns device message box animation definition name.
  1031     Returns device message box animation definition name.
  1001 
  1032 
  1002     \sa SetAnimationDefinitionL()
  1033     \sa SetAnimationDefinitionL()
  1003 */
  1034 */
  1004 EXPORT_C TPtrC CHbDeviceMessageBoxSymbian::AnimationDefinition() const
  1035 EXPORT_C TPtrC CHbDeviceMessageBoxSymbian::AnimationDefinition() const
  1005 {
  1036 {
  1006 	return d->mProperties[CHbDeviceMessageBoxPrivate::EAnimationDefinition].StringValue();
  1037     return d->mProperties[CHbDeviceMessageBoxPrivate::EAnimationDefinition].StringValue();
  1007 }
  1038 }
  1008 
  1039 
  1009 /*!
  1040 /*!
  1010     Sets message box icon visibility. The message box gets updated next time ShowL() or UpdateL()
  1041     Sets message box icon visibility.
  1011     is called.
       
  1012 
  1042 
  1013     \param aVisible Icon visibility.
  1043     \param aVisible Icon visibility.
  1014 
  1044 
  1015     \sa IconVisible()
  1045     \sa IconVisible(), ShowL(), UpdateL()
  1016 */
  1046 */
  1017 EXPORT_C void CHbDeviceMessageBoxSymbian::SetIconVisible(TBool aVisible)
  1047 EXPORT_C void CHbDeviceMessageBoxSymbian::SetIconVisible(TBool aVisible)
  1018 {
  1048 {
  1019     d->SetPropertyValue(CHbDeviceMessageBoxPrivate::EIconVisible, aVisible);
  1049     d->SetPropertyValue(CHbDeviceMessageBoxPrivate::EIconVisible, aVisible);
  1020 }
  1050 }
  1021 
  1051 
  1022 /*!
  1052 /*!
  1023     Returns message box icon visibility.
  1053     Returns message box icon visibility. Default value is true for message box
       
  1054     types other than ENone.
  1024 
  1055 
  1025     \sa SetIconVisible()
  1056     \sa SetIconVisible()
  1026 */
  1057 */
  1027 EXPORT_C TBool CHbDeviceMessageBoxSymbian::IconVisible() const
  1058 EXPORT_C TBool CHbDeviceMessageBoxSymbian::IconVisible() const
  1028 {
  1059 {
  1029     return d->mProperties[CHbDeviceMessageBoxPrivate::EIconVisible].IntValue();
  1060     return d->mProperties[CHbDeviceMessageBoxPrivate::EIconVisible].IntValue();
  1030 }
  1061 }
  1031 
  1062 
  1032 /*!
  1063 /*!
  1033     Sets message box timeout. The message box gets updated next time ShowL() or UpdateL()
  1064     Sets message box timeout.
  1034     is called.
       
  1035 
  1065 
  1036     \param aTimeout Timeout in milliseconds. Zero denotes no timeout.
  1066     \param aTimeout Timeout in milliseconds. Zero denotes no timeout.
  1037 
  1067 
  1038     \sa Timeout()
  1068     \sa Timeout(), ShowL(), UpdateL()
  1039 */
  1069 */
  1040 EXPORT_C void CHbDeviceMessageBoxSymbian::SetTimeout(TInt aTimeout)
  1070 EXPORT_C void CHbDeviceMessageBoxSymbian::SetTimeout(TInt aTimeout)
  1041 {
  1071 {
  1042     d->SetPropertyValue(CHbDeviceMessageBoxPrivate::ETimeout, aTimeout);
  1072     d->SetPropertyValue(CHbDeviceMessageBoxPrivate::ETimeout, aTimeout);
  1043 }
  1073 }
  1044 
  1074 
  1045 /*!
  1075 /*!
  1046     Returns message box timeout value in milliseconds.
  1076     Returns message box timeout value in milliseconds. Default value depends on message box type.
       
  1077     Question message box has a default of HbPopup::NoTimeout. All other boxes, the default is
       
  1078     HbPopup::StandardTimeout.
  1047 
  1079 
  1048     \sa SetTimeout()
  1080     \sa SetTimeout()
  1049 */
  1081 */
  1050 EXPORT_C TInt CHbDeviceMessageBoxSymbian::Timeout() const
  1082 EXPORT_C TInt CHbDeviceMessageBoxSymbian::Timeout() const
  1051 {
  1083 {
  1052     return d->mProperties[CHbDeviceMessageBoxPrivate::ETimeout].IntValue();
  1084     return d->mProperties[CHbDeviceMessageBoxPrivate::ETimeout].IntValue();
  1053 }
  1085 }
  1054 
  1086 
  1055 /*!
  1087 /*!
  1056     Sets message box dismiss policy. The message box gets updated next time ShowL() or UpdateL()
  1088     Sets message box dismiss policy.
  1057     is called.
       
  1058 
  1089 
  1059     \param aHbPopupDismissPolicy Dismiss policy. Values are HbPopup::DismissPolicy flags.
  1090     \param aHbPopupDismissPolicy Dismiss policy. Values are HbPopup::DismissPolicy flags.
  1060 
  1091 
  1061     \sa HbPopup::DismissPolicy, DismissPolicy()
  1092     \sa HbPopup::DismissPolicy, DismissPolicy(), ShowL(), UpdateL()
  1062 */
  1093 */
  1063 EXPORT_C void CHbDeviceMessageBoxSymbian::SetDismissPolicy(TInt aHbPopupDismissPolicy)
  1094 EXPORT_C void CHbDeviceMessageBoxSymbian::SetDismissPolicy(TInt aHbPopupDismissPolicy)
  1064 {
  1095 {
  1065     d->SetPropertyValue(CHbDeviceMessageBoxPrivate::EDismissPolicy,
  1096     d->SetPropertyValue(CHbDeviceMessageBoxPrivate::EDismissPolicy,
  1066         aHbPopupDismissPolicy);
  1097         aHbPopupDismissPolicy);
  1067 }
  1098 }
  1068 
  1099 
  1069 /*!
  1100 /*!
  1070     Returns message box dismiss policy. Returned values are HbPopup::DismissPolicy flags.
  1101     Returns message box dismiss policy. Returned values are HbPopup::DismissPolicy flags.
       
  1102     Default depends on message box type. Question box has default HbPopup::NoDismiss and
       
  1103     all other boxes HbPopup::TapAnywhere.
  1071 
  1104 
  1072     \sa HbPopup::DismissPolicy, SetDismissPolicy()
  1105     \sa HbPopup::DismissPolicy, SetDismissPolicy()
  1073 */
  1106 */
  1074 EXPORT_C TInt CHbDeviceMessageBoxSymbian::DismissPolicy() const
  1107 EXPORT_C TInt CHbDeviceMessageBoxSymbian::DismissPolicy() const
  1075 {
  1108 {
  1076     return d->mProperties[CHbDeviceMessageBoxPrivate::EDismissPolicy].IntValue();
  1109     return d->mProperties[CHbDeviceMessageBoxPrivate::EDismissPolicy].IntValue();
  1077 }
  1110 }
  1078 
  1111 
  1079 /*!
  1112 /*!
  1080     Sets message box button text. The message box gets updated next time ShowL() or UpdateL()
  1113     Sets message box button text.
  1081     is called.
       
  1082 
  1114 
  1083     \param aButton Selects the button.
  1115     \param aButton Selects the button.
  1084     \param aText Button text.
  1116     \param aText Button text.
  1085 
  1117 
  1086     \sa ButtonText()
  1118     \sa ButtonText(), SetButton(), ShowL(), UpdateL()
  1087 */
  1119 */
  1088 EXPORT_C void CHbDeviceMessageBoxSymbian::SetButtonTextL(TButtonId aButton, const TDesC& aText)
  1120 EXPORT_C void CHbDeviceMessageBoxSymbian::SetButtonTextL(TButtonId aButton, const TDesC& aText)
  1089 {
  1121 {
  1090     d->SetButtonTextL(aButton, aText);
  1122     d->SetButtonTextL(aButton, aText);
  1091 }
  1123 }
  1092 
  1124 
  1093 /*!
  1125 /*!
  1094     Returns message box button text.
  1126     Returns message box button text. Question message box by default has "Yes" and "No" buttons.
       
  1127     Other message boxes have a single "Ok" button.
  1095 
  1128 
  1096     \param aButton Selects the button.
  1129     \param aButton Selects the button.
  1097 
  1130 
  1098     \sa SetButtonTextL()
  1131     \sa SetButtonTextL()
  1099 */
  1132 */
  1104             CHbDeviceMessageBoxPrivate::EAcceptText, aButton);
  1137             CHbDeviceMessageBoxPrivate::EAcceptText, aButton);
  1105     return d->mProperties[id].StringValue();
  1138     return d->mProperties[id].StringValue();
  1106 }
  1139 }
  1107 
  1140 
  1108 /*!
  1141 /*!
  1109     Sets message box button presence. The message box gets updated next time ShowL() or UpdateL()
  1142     Sets message box button presence.
  1110     is called.
       
  1111 
  1143 
  1112     \param aButton Selects the button.
  1144     \param aButton Selects the button.
  1113     \param aEnable True enables (makes visible) message box button.
  1145     \param aEnable True enables (makes visible) message box button.
  1114 
  1146 
  1115     \sa HasButton()
  1147     \sa HasButton(), SetButtonTextL(), ShowL(), UpdateL()
  1116 */
  1148 */
  1117 EXPORT_C void CHbDeviceMessageBoxSymbian::SetButton(TButtonId aButton, TBool aEnable)
  1149 EXPORT_C void CHbDeviceMessageBoxSymbian::SetButton(TButtonId aButton, TBool aEnable)
  1118 {
  1150 {
  1119     d->SetButtonNull(aButton, !aEnable);
  1151     d->SetButtonNull(aButton, !aEnable);
  1120 }
  1152 }
  1121 
  1153 
  1122 /*!
  1154 /*!
  1123     Returns message box button presence.
  1155     Returns message box button presence. Question message box by default has accept and reject
       
  1156     buttons. Other message boxes have a single accept button.
  1124 
  1157 
  1125     \param aButton Selects the button.
  1158     \param aButton Selects the button.
  1126 
  1159 
  1127     \sa SetButton()
  1160     \sa SetButton(), ButtonText()
  1128 */
  1161 */
  1129 EXPORT_C TBool CHbDeviceMessageBoxSymbian::HasButton(TButtonId aButton) const
  1162 EXPORT_C TBool CHbDeviceMessageBoxSymbian::HasButton(TButtonId aButton) const
  1130 {
  1163 {
  1131     CHbDeviceMessageBoxPrivate::TPropertyId id =
  1164     CHbDeviceMessageBoxPrivate::TPropertyId id =
  1132         CHbDeviceMessageBoxPrivate::ButtonPropertyId(
  1165         CHbDeviceMessageBoxPrivate::ButtonPropertyId(
  1135 }
  1168 }
  1136 
  1169 
  1137 /*!
  1170 /*!
  1138     Sets message box buttons to standard buttons.
  1171     Sets message box buttons to standard buttons.
  1139 
  1172 
  1140     \param aButtons Message box buttons. A combination of flags,
  1173     \param aButtons Message box buttons. A combination of flags, eg.
  1141     eg. HbMessageBox::Yes | HbMessageBox::No. Button flags are scanned starting from lsb.
  1174     HbMessageBox::Yes | HbMessageBox::No.
  1142     First button found goes to accept position and so forth.
  1175     Button flags are scanned starting from lsb. First button found goes to accept position
  1143 
  1176     and so forth.
  1144     \sa StandardButtons()
  1177 
       
  1178     \sa HbMessageBox::StandardButton, StandardButtons(), ShowL(), UpdateL()
  1145 */
  1179 */
  1146 EXPORT_C void CHbDeviceMessageBoxSymbian::SetStandardButtons(TUint aButtons)
  1180 EXPORT_C void CHbDeviceMessageBoxSymbian::SetStandardButtons(TUint aButtons)
  1147 {
  1181 {
  1148     return d->SetStandardButtons(aButtons);
  1182     return d->SetStandardButtons(aButtons);
  1149 }
  1183 }
  1150 
  1184 
  1151 /*!
  1185 /*!
  1152     Returns standard buttons set to a message box. A default value for question message box is
  1186     Returns standard buttons set to a message box. A default value for question message box is
  1153     HbMessageBox::Yes|HbMessageBox::No. For all other message box types the default is
  1187     HbMessageBox::Yes | HbMessageBox::No. For all other message box types the default is
  1154     HbMessageBox::Ok.
  1188     HbMessageBox::Ok.
  1155 
  1189 
  1156     \sa SetStandardButtons()
  1190     \sa HbMessageBox::StandardButton, SetStandardButtons()
  1157 */
  1191 */
  1158 EXPORT_C TUint CHbDeviceMessageBoxSymbian::StandardButtons() const
  1192 EXPORT_C TUint CHbDeviceMessageBoxSymbian::StandardButtons() const
  1159 {
  1193 {
  1160     return d->mProperties[CHbDeviceMessageBoxPrivate::EStandardButtons].IntValue();
  1194     return d->mProperties[CHbDeviceMessageBoxPrivate::EStandardButtons].IntValue();
  1161 }
  1195 }