src/hbwidgets/widgets/hbgroupbox.cpp
changeset 0 16d8024aca5e
child 1 f7ac710697a9
equal deleted inserted replaced
-1:000000000000 0:16d8024aca5e
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbWidgets module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 
       
    26 #include <hbgroupbox.h>
       
    27 #include "hbgroupbox_p.h"
       
    28 #include "hbgroupboxheadingwidget_p.h"
       
    29 #include "hbgroupboxcontentwidget_p.h"
       
    30 #include <hbstyle.h>
       
    31 #include <hbstyleoption.h>
       
    32 
       
    33 #ifdef HB_EFFECTS
       
    34 #include <hbeffect.h>
       
    35 #include "hbeffectinternal_p.h"
       
    36 #define HB_GROUPBOX_TYPE "HB_GROUPBOX"
       
    37 #endif
       
    38 
       
    39 #include <QGraphicsSceneMouseEvent>
       
    40 #include <QDebug>
       
    41 
       
    42 QT_BEGIN_NAMESPACE
       
    43 class QGraphicsItem;
       
    44 QT_END_NAMESPACE
       
    45 
       
    46 
       
    47 /*
       
    48     HbGroupBoxPrivate
       
    49     private class constructor     
       
    50 */
       
    51 HbGroupBoxPrivate::HbGroupBoxPrivate()
       
    52     :HbWidgetPrivate(),
       
    53     mContentWidget( 0 ),
       
    54     mHeadingWidget( 0 )
       
    55 {
       
    56 }
       
    57 
       
    58 /*
       
    59     private class destructor
       
    60 */
       
    61 HbGroupBoxPrivate::~HbGroupBoxPrivate()
       
    62 {
       
    63 }
       
    64 
       
    65 /*
       
    66     \internal
       
    67     creates groupbox HeadingWidget
       
    68 */
       
    69 void HbGroupBoxPrivate::createHeadingWidget()
       
    70 {
       
    71     Q_Q( HbGroupBox );
       
    72 
       
    73     mHeadingWidget = new HbGroupBoxHeadingWidget(q);
       
    74     HbStyle::setItemName( mHeadingWidget , "headingwidget");
       
    75 }
       
    76 
       
    77 /*
       
    78     \internal
       
    79     creates groupbox Contentwidget
       
    80 */
       
    81 void HbGroupBoxPrivate::createContentWidget()
       
    82 {
       
    83     Q_Q( HbGroupBox );
       
    84 
       
    85     mContentWidget = new HbGroupBoxContentWidget(q);
       
    86     HbStyle::setItemName( mContentWidget , "contentwidget");
       
    87 }
       
    88 
       
    89 /*!
       
    90     \internal
       
    91     Sets the group box type
       
    92 */
       
    93 void HbGroupBoxPrivate::setGroupBoxType( GroupBoxType type )
       
    94 {
       
    95     Q_Q( HbGroupBox );
       
    96     
       
    97     // set dynamic property based on type
       
    98     q->setProperty("groupBoxType",(int)type);
       
    99 
       
   100     if ( mGroupBoxType == type ) 
       
   101         return;
       
   102 
       
   103     mGroupBoxType = type;
       
   104   
       
   105     // set the type and makes necesary primitive creation/deletion
       
   106     switch(mGroupBoxType) {
       
   107         case GroupBoxSimpleLabel:
       
   108             {
       
   109             if(mHeadingWidget){
       
   110 				mHeadingWidget->setType(type);				
       
   111                 mHeadingWidget->setVisible(true);
       
   112              
       
   113             }else{
       
   114                 createHeadingWidget();
       
   115             }
       
   116 
       
   117             if(mContentWidget){
       
   118                 mContentWidget->setVisible(false);
       
   119                 HbStyle::setItemName( mContentWidget , "");
       
   120             }
       
   121             
       
   122             }
       
   123             break;
       
   124         case GroupBoxRichLabel:
       
   125             {
       
   126             if(mHeadingWidget){
       
   127                 mHeadingWidget->setVisible(false);
       
   128 
       
   129             }
       
   130             if(mContentWidget){
       
   131 				mContentWidget->setType(type);
       
   132                 mContentWidget->setVisible(true);
       
   133                 HbStyle::setItemName( mContentWidget , "contentwidget");
       
   134             }else{
       
   135                 createContentWidget();
       
   136             }
       
   137 
       
   138             }
       
   139             break;
       
   140         case GroupBoxCollapsingContainer:
       
   141             {
       
   142             if((mHeadingWidget)){
       
   143 				mHeadingWidget->setType(type);
       
   144                 mHeadingWidget->setVisible(true);                
       
   145             }else{
       
   146                 createHeadingWidget();
       
   147             }
       
   148 
       
   149             if(mContentWidget){
       
   150                 mContentWidget->setType(type);
       
   151                 if(!q->isCollapsed()){
       
   152                     mContentWidget->setVisible(true);
       
   153                     HbStyle::setItemName( mContentWidget , "contentwidget");
       
   154 				}else{
       
   155 					mContentWidget->setVisible(false);
       
   156 					HbStyle::setItemName( mContentWidget , "");
       
   157                 }
       
   158             }else{
       
   159                 createContentWidget();
       
   160             }
       
   161             }
       
   162             break;
       
   163         default:
       
   164             break;
       
   165     }
       
   166 
       
   167     q->updatePrimitives();
       
   168     q->repolish();
       
   169 }
       
   170 
       
   171 
       
   172 /*!
       
   173     @alpha
       
   174     @hbwidgets
       
   175     \class HbGroupBox
       
   176 
       
   177     \brief HbGroupBox shows the user that a set of controls belong together.
       
   178     
       
   179     HbGroupBox is a container that provides the following : 
       
   180 
       
   181     \li Heading: text only
       
   182     \li Body content: arbitrary content (any HbWidget)
       
   183     \li Disclosure mechanism: expands and collapses the body content;
       
   184 
       
   185     There are three types of GroupBox:
       
   186 
       
   187     \li Simple Label - it's only function is to show relationship between items.
       
   188     simple Label shows a heading with marquee, no disclosure mechanism, and 
       
   189     no body content. Marquee is disabled by default.Also it is not focusable. 
       
   190 
       
   191     Example usage: For SimpleLabel type groupbox
       
   192     \code
       
   193     // create groupBox and set only heading; without any body content
       
   194     HbGroupBox *simpleLabel = new HbGroupBox();
       
   195     simpleLabel->setHeading("Simple label groupBox comes with marquee disabled by default");
       
   196     \endcode 
       
   197     
       
   198     \image html simpleLabelgroupbox.png A SimpleLabel groupbox
       
   199 
       
   200 
       
   201     \li Rich Label - does not show a heading and all content is in the body area 
       
   202     with no marquee and no disclosure control.Body Content must describe its own behavior and layout. 
       
   203 
       
   204     Example usage: For RichLabel type groupbox
       
   205     \code
       
   206     // create groupBox and set only content; without any heading
       
   207     HbGroupBox *richHeading = new HbGroupBox();
       
   208     // content widget can be any HbWidget
       
   209     // layouting and interaction behaviour inside Content widget is application's responsiblity
       
   210     HbPushButton *button = new HbPushButton(HbIcon(":/icons/ovi.png"),"Ovi");
       
   211     button->setAdditionalText("Launch Ovi Music store");
       
   212     button->setOrientation(Qt::Vertical);
       
   213     button->setTextAlignment(Qt::AlignLeft);
       
   214     richHeading->setContentWidget(button);
       
   215     \endcode 
       
   216 
       
   217     \image html richLabelgroupbox.png A RichLabel groupbox.
       
   218     In RichLabel type, groupbox provides background for body content.
       
   219 
       
   220     \li Collapsing container - also allows the user to show or hide the content of the groupBox.
       
   221     It always has a heading and body content; optionally has a disclosure mechanism.
       
   222     The heading does not marquee.The collapse/expand disclosure mechanism is located 
       
   223     in the heading and is the chief utility of this type of group box.
       
   224 
       
   225     If disclosure mechanism is Off, then heading will appear without expand/collapse indication icon 
       
   226     heading.Also the user will not be able to expand/collapse the body content.
       
   227 
       
   228     Example usage:For collapsingContainer groupbox
       
   229     \code    
       
   230     // create groupBox and set both heading and content
       
   231     HbGroupBox *collapsingContainer = new HbGroupBox();
       
   232     HbPushButton *button = new HbPushButton("Collapsing container content");
       
   233     button->setMaximumHeight(50);
       
   234     // content widget can be any HbWidget
       
   235     // layouting and interaction behaviour inside Content widget is application's responsiblity
       
   236     collapsingContainer->setContentWidget(button);
       
   237     collapsingContainer->setHeading("collapsing container");
       
   238     \endcode
       
   239 
       
   240     \image html collapsableContainergroupbox.png A Collapsing container groupbox.
       
   241 
       
   242     In this type, groupBox body content can be expanded/collapsed, 
       
   243     depending on whether or not the group box is collapsed.
       
   244 
       
   245     CollapsingContainer type groupBox comes with disclosure mechanism On by default.
       
   246 
       
   247     Setting heading and body content decides type of the groupbox.
       
   248 
       
   249     Groupbox type determines the default visualization, associated properties and suggest usages.    
       
   250 */
       
   251 
       
   252 /*!
       
   253     \fn void HbGroupBox::longPress( QPointF )
       
   254 
       
   255     This signal is emitted only in case of richLabel and collapsing container groupbox,
       
   256     when the long press happened on body content.
       
   257   */
       
   258 
       
   259 /*!
       
   260     \fn void HbGroupBox::clicked()
       
   261 
       
   262     This signal is emitted only in case of richLabel and collapsing container groupbox,
       
   263     whenever click happened on body content.If the body content set is an interactive widget
       
   264     and consumes mouse press event, then clicked signal will not get emitted from groupBox in that case.
       
   265  */
       
   266 
       
   267 /*!
       
   268     \fn void HbGroupBox::toggled(bool)
       
   269 
       
   270     This signal is emitted only in case of collapsing container groupbox,
       
   271     whenever groupbox is collapsed/expanded
       
   272  */
       
   273 
       
   274 /*!
       
   275     @alpha
       
   276     Constructs a group box with the given \a parent.
       
   277 */
       
   278 HbGroupBox::HbGroupBox( QGraphicsItem *parent)
       
   279     : HbWidget(*new HbGroupBoxPrivate, parent)
       
   280 {
       
   281     Q_D( HbGroupBox );
       
   282     d->q_ptr = this;
       
   283 }
       
   284 
       
   285 /*! Constructs a group box with the given \a title and \a parent.
       
   286 
       
   287     \deprecated HbGroupBox::HbGroupBox(const QString&, QGraphicsItem*)
       
   288         is deprecated.This version of overloaded constructor is deprecated and cease to exist in the near future    
       
   289  */
       
   290 HbGroupBox::HbGroupBox(const QString &titleText, QGraphicsItem *parent )
       
   291     : HbWidget(*new HbGroupBoxPrivate, parent)
       
   292 {
       
   293     Q_UNUSED(titleText);
       
   294     Q_UNUSED(parent);
       
   295     qDebug() << "this version of constructor is deprecated and will cease to exist in the near future."; 
       
   296 }
       
   297 
       
   298 /*!
       
   299     protected constructor for derived class
       
   300 */
       
   301 HbGroupBox::HbGroupBox(HbGroupBoxPrivate &dd, QGraphicsItem *parent)
       
   302     :HbWidget( dd, parent )
       
   303 {
       
   304     Q_D( HbGroupBox );
       
   305     d->q_ptr = this;
       
   306 }
       
   307 
       
   308 /*!
       
   309     Destructs the group box.
       
   310 */
       
   311 HbGroupBox::~HbGroupBox()
       
   312 {
       
   313 }
       
   314 
       
   315 /*!
       
   316     @alpha
       
   317     
       
   318     Sets the group box heading
       
   319 
       
   320     Note: heading property is valid for simpleLabel & collapsing container type.
       
   321     If heading is set on richLabel type groupBox, it will be ignored
       
   322 
       
   323     \sa heading
       
   324 */
       
   325 void HbGroupBox::setHeading( const QString &text )
       
   326 {
       
   327     Q_D( HbGroupBox );
       
   328 
       
   329     if(!d->mHeadingWidget)
       
   330         d->createHeadingWidget();
       
   331     
       
   332     d->mHeadingWidget->setHeading(text);
       
   333 
       
   334     if(d->mContentWidget){
       
   335         d->setGroupBoxType(GroupBoxCollapsingContainer);
       
   336     }else
       
   337         d->setGroupBoxType(GroupBoxSimpleLabel);
       
   338 }
       
   339 
       
   340 /*!
       
   341     @alpha
       
   342 
       
   343     Returns text shown on the groupBox heading.
       
   344 
       
   345     There is no default heading string set.
       
   346 
       
   347     Note: If groupBox type is richLabel then this will return NULL string
       
   348 
       
   349     \sa setHeading
       
   350 */
       
   351 QString HbGroupBox::heading( ) const
       
   352 {
       
   353     Q_D( const HbGroupBox );
       
   354 
       
   355     if(d->mHeadingWidget && d->mGroupBoxType != GroupBoxRichLabel)
       
   356         return d->mHeadingWidget->headingText;
       
   357     return QString();
       
   358 }
       
   359 
       
   360 /*!
       
   361     @alpha
       
   362 
       
   363     Sets whether the groupbox is collapsable or not
       
   364 
       
   365     If this property is true, then disclosure mechanism is On.    
       
   366 
       
   367     Note: collapsable property is valid only for collapsing container type.
       
   368     If collapsable property is set on simpleLabel & richLabel type groupBox, it will be ignored
       
   369 
       
   370     \sa setCollapsed \sa isCollapsable
       
   371 */
       
   372 void HbGroupBox::setCollapsable( bool collapsable )
       
   373 {
       
   374     Q_D( HbGroupBox );
       
   375 
       
   376     if(d->mGroupBoxType == GroupBoxCollapsingContainer){
       
   377         if(d->mHeadingWidget->collapsable  == collapsable)
       
   378         {
       
   379             return;
       
   380         }
       
   381         d->mHeadingWidget->collapsable  = collapsable;
       
   382 
       
   383         d->mHeadingWidget->createPrimitives();
       
   384 
       
   385         // make it expand otherwise groupBox can't be expanded at all, after this scenario
       
   386         if(!collapsable && d->mHeadingWidget->collapsed){
       
   387             d->mContentWidget->setVisible(true);
       
   388             HbStyle::setItemName( d->mContentWidget , "contentwidget");
       
   389             d->mHeadingWidget->collapsed  = false;            
       
   390         }
       
   391         d->mHeadingWidget->updatePrimitives();
       
   392         repolish();
       
   393     }
       
   394 }
       
   395 
       
   396 /*!
       
   397     @alpha
       
   398 
       
   399     Returns whether the groupbox is collapsable or not
       
   400 
       
   401     By default, group boxes are collapsable.
       
   402 
       
   403     \sa setCollapsable
       
   404 */
       
   405 bool HbGroupBox::isCollapsable( ) const
       
   406 {
       
   407     Q_D( const HbGroupBox );
       
   408     if(d->mHeadingWidget && d->mGroupBoxType == GroupBoxCollapsingContainer)
       
   409         return d->mHeadingWidget->collapsable;
       
   410     return false;
       
   411 }
       
   412 
       
   413 /*!
       
   414     @alpha
       
   415 
       
   416     Sets whether the groupbox collapsed or expanded
       
   417 
       
   418     If the groupbox is collapsed,the group box's content widget are hidden; 
       
   419     otherwise they will be visible
       
   420 
       
   421     setCollapsed on groupbox will emit signal toggled( bool ) 
       
   422     upon collapse\expand of content widget
       
   423 
       
   424     Only collapsable groupboxes can be collapsed. (i.e)this API will not do anything 
       
   425     if group box is not collapsable.By default, group boxes are not collapsed.
       
   426 
       
   427     Note: collapsed property is valid only for collapsing container type.
       
   428     If collapsed is set on simpleLabel or richLabel type groupBox, it will be ignored
       
   429 
       
   430     \sa isCollapsed \sa setCollapsable
       
   431 */
       
   432 void HbGroupBox::setCollapsed( bool collapsed )
       
   433 {
       
   434     Q_D( HbGroupBox );
       
   435     if(d->mGroupBoxType == GroupBoxCollapsingContainer){
       
   436         if( d->mContentWidget && d->mHeadingWidget->collapsable) {
       
   437             if ( d->mHeadingWidget->collapsed == collapsed )
       
   438                 return;
       
   439 
       
   440             d->mHeadingWidget->collapsed = collapsed;
       
   441 
       
   442             #ifdef HB_EFFECTS
       
   443             HbEffectInternal::add(HB_GROUPBOX_TYPE,"groupbox_expand", "expand");
       
   444             //HbEffectInternal::add(HB_GROUPBOX_TYPE,"groupbox_collapse", "collapse");
       
   445             #endif
       
   446 
       
   447             if ( d->mHeadingWidget->collapsed ) {
       
   448                 #ifdef HB_EFFECTS
       
   449                 HbEffect::start( d->mContentWidget, HB_GROUPBOX_TYPE, "collapse");  
       
   450                 #endif
       
   451                 HbStyle::setItemName( d->mContentWidget , "");
       
   452                 d->mContentWidget->setVisible(false);
       
   453             }
       
   454             else {
       
   455                 #ifdef HB_EFFECTS
       
   456                 HbEffect::start( d->mContentWidget, HB_GROUPBOX_TYPE, "expand");  
       
   457                 #endif
       
   458                 HbStyle::setItemName( d->mContentWidget , "contentwidget");
       
   459                 d->mContentWidget->setVisible(true);
       
   460             }
       
   461             d->mHeadingWidget->updatePrimitives();
       
   462             repolish();
       
   463             emit toggled( d->mHeadingWidget->collapsed );
       
   464         }
       
   465     }
       
   466 }
       
   467 
       
   468 /*!
       
   469     @alpha
       
   470 
       
   471     Returns whether the group box is collapsed or expanded
       
   472 
       
   473     By default, groupboxes are not collapsed.
       
   474      
       
   475     \sa setCollapsed \sa setCollapsable
       
   476 */
       
   477 bool HbGroupBox::isCollapsed( ) const
       
   478 {
       
   479     Q_D ( const HbGroupBox );
       
   480     if(d->mGroupBoxType == GroupBoxCollapsingContainer)
       
   481         return d->mHeadingWidget->collapsed;
       
   482 		
       
   483     return false;
       
   484 }
       
   485 
       
   486 /*!
       
   487     @alpha
       
   488 
       
   489     Enables the marquee for heading if marqueeHeading is true, otherwise the 
       
   490     heading will not marquee.
       
   491 
       
   492     Note: marqueeHeading property is valid  only for simpleLabel type.
       
   493     If marqueeHeading is set on richLabel or collapsing container type groupBox, it will be ignored
       
   494 
       
   495     \sa marqueeHeading
       
   496 */
       
   497 void HbGroupBox::setMarqueeHeading( bool marquee )
       
   498 {
       
   499     Q_D( HbGroupBox );
       
   500     if((d->mHeadingWidget && d->mGroupBoxType == GroupBoxSimpleLabel)){
       
   501         d->mHeadingWidget->setMarqueeHeading( marquee );
       
   502     }
       
   503 
       
   504 }
       
   505 
       
   506 /*!
       
   507     @alpha
       
   508 
       
   509     Returns true if marquee is enabled for  groupbox heading; 
       
   510     otherwise returns false.
       
   511 
       
   512     The default value is false.
       
   513 
       
   514     \sa setMarqueeHeading
       
   515 */
       
   516 bool HbGroupBox::marqueeHeading( ) const
       
   517 {
       
   518     Q_D( const HbGroupBox );
       
   519     if(d->mHeadingWidget && d->mGroupBoxType == GroupBoxSimpleLabel)
       
   520         return d->mHeadingWidget->marqueeEnabled;
       
   521 		
       
   522     return false;
       
   523 }
       
   524 
       
   525 
       
   526 /*!
       
   527     @alpha
       
   528 
       
   529     Sets the groupbox content widget
       
   530 
       
   531     Groupbox can set only one content widget at a time.
       
   532     Ownership of the content widget is transferred to groupbox.
       
   533 
       
   534     If \a widget to set is NULL then content is removed.
       
   535 
       
   536     contentWidget is valid only for richLabel & collapsing container type.
       
   537     If content Widget is set on simpleLabel type groupBox, it will be ignored
       
   538 
       
   539     Note:
       
   540     1 ) GroupBox will not take care of layouting/scrolling inside content widget
       
   541     2 ) If no default height is set on content widget, then Application is responsible 
       
   542     for inconsitent UI.
       
   543 
       
   544     \sa contentWidget
       
   545 */
       
   546 void HbGroupBox::setContentWidget( HbWidget *widget )
       
   547 {
       
   548     Q_D( HbGroupBox );
       
   549    
       
   550     if(!d->mContentWidget)
       
   551         d->createContentWidget();
       
   552     
       
   553     d->mContentWidget->setContentWidget(widget);
       
   554 
       
   555     if(d->mHeadingWidget){
       
   556         d->setGroupBoxType(GroupBoxCollapsingContainer);
       
   557     }else
       
   558         d->setGroupBoxType(GroupBoxRichLabel);
       
   559 
       
   560      // collapsed property is set before setContentWidget
       
   561     if ( d->mGroupBoxType == GroupBoxCollapsingContainer && d->mHeadingWidget->collapsed ) {	
       
   562         d->mContentWidget->setVisible(false);
       
   563         HbStyle::setItemName( d->mContentWidget , "");
       
   564     }
       
   565     // update content widget primitve
       
   566     d->mContentWidget->updatePrimitives();
       
   567     repolish();
       
   568 }
       
   569 
       
   570 /*!
       
   571     @alpha
       
   572 
       
   573     Returns groupbox content widget
       
   574     
       
   575     There is no default content widget.	
       
   576 
       
   577     GroupBox takes care of the ownership of the content widget being set
       
   578 
       
   579     Note: if \li setContentWidget is called more then once,
       
   580     then this will return last set content widget
       
   581 
       
   582     \sa setContentWidget
       
   583 */
       
   584 HbWidget* HbGroupBox::contentWidget( ) const
       
   585 {
       
   586     Q_D( const HbGroupBox );
       
   587     if(d->mContentWidget && d->mGroupBoxType != GroupBoxSimpleLabel)
       
   588         return d->mContentWidget->mContent; 
       
   589     return NULL;
       
   590 }
       
   591 
       
   592 /*!
       
   593     Returns the pointer for \a primitive passed.
       
   594     Will return NULL if \a primitive passed is invalid
       
   595 */
       
   596 QGraphicsItem* HbGroupBox::primitive(HbStyle::Primitive primitive) const
       
   597 {
       
   598     Q_D( const HbGroupBox );
       
   599 
       
   600     switch (primitive) {
       
   601         case HbStyle::P_GroupBoxHeading_icon:
       
   602         case HbStyle::P_GroupBoxHeading_text:
       
   603         case HbStyle::P_GroupBoxHeading_background:
       
   604              if(d->mHeadingWidget){
       
   605                 return d->mHeadingWidget->primitive(primitive);
       
   606                 }
       
   607             break;
       
   608         case HbStyle::P_GroupBoxContent_background:
       
   609             if(d->mContentWidget)
       
   610                 return d->mContentWidget->primitive(primitive);
       
   611             break;
       
   612         default:
       
   613             return NULL;
       
   614     }
       
   615     return NULL;	
       
   616 }
       
   617 
       
   618 /*!
       
   619     \reimp
       
   620  */
       
   621 void HbGroupBox::updatePrimitives()
       
   622 {
       
   623     Q_D( const HbGroupBox );
       
   624 
       
   625     if(d->mHeadingWidget)
       
   626         d->mHeadingWidget->updatePrimitives();
       
   627 
       
   628     if(d->mContentWidget)
       
   629         d->mContentWidget->updatePrimitives();
       
   630 }
       
   631 
       
   632 /*! 
       
   633     Sets the group box title text
       
   634 
       
   635     There is no default title text.
       
   636 
       
   637     Note: titletext property is valid for simpleLabel & collapsing container type
       
   638     If titletext is set on richLabel type groupBox, it will be ignored
       
   639 
       
   640     \deprecated HbGroupBox::setTitleText(const QString&)
       
   641         is deprecated.Please use HbGroupBox::setHeading(const QString&) instead
       
   642 
       
   643     \sa titleText
       
   644 */
       
   645 void HbGroupBox::setTitleText( const QString &text )
       
   646 {
       
   647     qDebug() << "This API is deprecated, please use HbGroupBox::setHeading( const QString &text ) instead.";
       
   648     setHeading(text);  
       
   649 }
       
   650 
       
   651 /*! 
       
   652     Returns title text shown on group box
       
   653 
       
   654     Note: If the groupBox type is RichLabel, then this will return NULL string
       
   655 
       
   656     \deprecated HbGroupBox::titleText() const
       
   657         is deprecated. Please use HbGroupBox::heading() const instead
       
   658 
       
   659     \sa setTitleText 
       
   660 */
       
   661 QString HbGroupBox::titleText( ) const
       
   662 {
       
   663     qDebug() << "This API is deprecated, please use HbGroupBox::heading( ) instead.";
       
   664     return heading();
       
   665 }
       
   666 
       
   667 /*! 
       
   668     Sets the group box title widget
       
   669 
       
   670     There is no default title widget.
       
   671 
       
   672     Note: 1)if user set title text after this  \li setTitleText then,title widget will be set to null .
       
   673      Either title text or title widget can be set, both cant se set.
       
   674      2) GroupBox takes ownership of titlewidget and deletes the old title widget
       
   675 
       
   676      \deprecated HbGroupBox::setTitleWidget(HbWidget*) 
       
   677         is deprecated. TitleWidget concept is removed. GroupBox nomore supports widget in the heading part
       
   678 
       
   679      \sa setTitleText \sa titleWidget
       
   680  */
       
   681 void HbGroupBox::setTitleWidget( HbWidget* widget )
       
   682 {
       
   683    Q_UNUSED(widget);
       
   684    qDebug() << "This API is deprecated and will cease to exist in the near future.";
       
   685 }
       
   686 
       
   687 /*! 
       
   688     Returns group box title widget
       
   689 
       
   690     There is no default title widget.
       
   691 
       
   692     Note: If title text is set, then this will return HbLabel
       
   693 
       
   694     \deprecated HbGroupBox::titleWidget() const
       
   695         is deprecated. TitleWidget concept is removed. GroupBox nomore supports widget in the heading part
       
   696 
       
   697     \sa setTitleWidget
       
   698  */
       
   699 HbWidget* HbGroupBox::titleWidget( ) const
       
   700 {
       
   701     qDebug() << "This API is deprecated and will cease to exist in the near future.";
       
   702     return NULL;
       
   703 }
       
   704 
       
   705 /*! 
       
   706     Returns the alignment of the group box title.
       
   707 
       
   708     The default alignment is Qt::AlignLeft.
       
   709 
       
   710     \deprecated HbGroupBox::textAlignment() const
       
   711         is deprecated. GroupBox heading will always be left aligned
       
   712 
       
   713     \sa Qt::Alignment
       
   714  */
       
   715 Qt::Alignment HbGroupBox::textAlignment() const
       
   716 {
       
   717     qDebug() << "This API is deprecated and will cease to exist in the near future.";
       
   718     return NULL;
       
   719 }
       
   720 
       
   721 /*! 
       
   722     Sets the alignment of the group box title.
       
   723 
       
   724     Most styles place the title at the top of the frame. The horizontal
       
   725     alignment of the title can be specified using single values from
       
   726     the following list:
       
   727 
       
   728     \list
       
   729     \i Qt::AlignLeft aligns the title text on the left-hand side .
       
   730     \i Qt::AlignRight aligns the title text on the right-hand side .
       
   731     \i Qt::AlignHCenter aligns the title text with the horizontal center of the group box.
       
   732     \endlist
       
   733 
       
   734     The default alignment is Qt::AlignLeft.
       
   735 
       
   736     Note: This API will not work if heading is set as widget \li setTitleWidget
       
   737     This alignment is only of heading text \li setTitleText
       
   738 
       
   739     \deprecated HbGroupBox::setTextAlignment(QFlags<Qt::AlignmentFlag>)
       
   740         is deprecated. GroupBox heading will always be left aligned.
       
   741 
       
   742     \sa Qt::Alignment
       
   743  */
       
   744 void HbGroupBox::setTextAlignment(Qt::Alignment alignment)
       
   745 {
       
   746     Q_UNUSED(alignment);
       
   747     qDebug() << "This API is deprecated and will cease to exist in the near future.";
       
   748 }
       
   749 
       
   750 #include "moc_hbgroupbox.cpp"