vmbx/vmbxcpplugin/src/vmbxcpgroup.cpp
changeset 13 e32024264ebb
parent 12 ae8abd0db65c
child 19 e44a8c097b15
--- a/vmbx/vmbxcpplugin/src/vmbxcpgroup.cpp	Fri Mar 19 09:40:14 2010 +0200
+++ b/vmbx/vmbxcpplugin/src/vmbxcpgroup.cpp	Fri Apr 16 15:31:58 2010 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
  * All rights reserved.
  * This component and the accompanying materials are made available
  * under the terms of "Eclipse Public License v1.0"
@@ -14,83 +14,94 @@
  * Description:
  *
  */
- 
-#include <hbsettingformdataitem.h> // TODO: remember to replace this during API switch
+
+// System includes
 #include <cpitemdatahelper.h>
+
+// User includes
 #include "vmbxuiengine.h"
 #include "vmbxcpgroup.h"
 #include "loggerutil.h"
 
-// TODO: To get signals from ui control in QtControlPanelwk38 package you have 
-// to fix the mistyped connect
-// in qtcontrolpanel\qtcontrolpanel\cpframework\src\cpsettingformitemdata.cpp:
-// "lineEditTextChanged" is mistyped as "lineEditTextChangge"
-
-// -----------------------------------------------------------------------------
-// Comment me!
-// -----------------------------------------------------------------------------
-//
+/*!
+    Constructor
+*/
 VmbxCpGroup::VmbxCpGroup(
-    const QString &/*configFile*/,
+    const QString &configFile,
     const HbDataFormModelItem *parent) :
-        CpSettingFormItemData( parent ),
-        mEditorCsVoice1( 0 ) // TODO: null member pointers as it is good practice
+        CpSettingFormItemData(parent),
+        mUiEngine(0),
+        mEditorCsVoice1(0),
+        mEditorCsVoice2(0),
+        mEditorCsVideo1(0)
 {
+    Q_UNUSED(configFile);
 }
 
-// -----------------------------------------------------------------------------
-// Comment me!
-// -----------------------------------------------------------------------------
-//
+/*!
+    Constructor
+*/
 VmbxCpGroup::VmbxCpGroup(
     HbDataFormModelItem::DataItemType type,
     const QString &label,
-    const QString &/*configFile*/,
+    const QString &configFile,
     const HbDataFormModelItem *parent,
-    CpItemDataHelper &itemDataHelper ) :
-        CpSettingFormItemData( type, label, parent ),
-        mEditorCsVoice1( 0 ),// TODO: null member pointers as it is good practice
-        mEditorCsVoice2( 0 ),
-        mEditorCsVideo1( 0 )
+    CpItemDataHelper &itemDataHelper) :
+        CpSettingFormItemData(type, label, parent),
+        mUiEngine(0),
+        mEditorCsVoice1(0),
+        mEditorCsVoice2(0),
+        mEditorCsVideo1(0)
 { 
     _DBGLOG2("VmbxCpGroup::VmbxCpGroup label=",label)
+    Q_UNUSED(configFile);
     mUiEngine = new VmbxUiEngine();
-    beforeLoadingConfigPlugins( itemDataHelper );
+    loadingPreparation(itemDataHelper);
     _DBGLOG("VmbxCpGroup::VmbxCpGroup <")
 }
 
-// -----------------------------------------------------------------------------
-// Comment me!
-// -----------------------------------------------------------------------------
-//
-// Todo: rename this method
-void VmbxCpGroup::beforeLoadingConfigPlugins( CpItemDataHelper &itemDataHelper ) 
+/*!
+    Destructor
+*/
+VmbxCpGroup::~VmbxCpGroup()
+{
+    _DBGLOG("VmbxCpGroup::~VmbxCpGroup")
+    if (mUiEngine) {
+        delete mUiEngine;
+        mUiEngine = NULL;
+    }
+}
+
+/*!
+    Preparation before loading
+*/
+void VmbxCpGroup::loadingPreparation(CpItemDataHelper &itemDataHelper)
 {   
-    _DBGLOG("VmbxCpGroup::beforeLoadingConfigPlugins >")
-        
-    // HbSettingFormDataItem::appendChild takes ownership
+    _DBGLOG("VmbxCpGroup::loadingPreparation >")
     
     QString newUiValue("");
 
     mEditorCsVoice1 = new CpSettingFormItemData(
             HbDataFormModelItem::TextItem, tr("Call mailbox") );
-    _DBGLOG("VmbxCpGroup::beforeLoadingConfigPlugins appendChild")
+    _DBGLOG("VmbxCpGroup::loadingPreparation appendChild")
     itemDataHelper.addConnection( 
         mEditorCsVoice1, 
         SIGNAL(textChanged(QString)), 
-        mUiEngine, SLOT(uiCsVoice1Changed(QString) ) 
+        mUiEngine, SLOT(uiCsVoice1Changed(QString))
         );
-    appendChild( mEditorCsVoice1 );
+    // appendChild takes ownership
+    appendChild(mEditorCsVoice1);
 
     // Todo: add csVoice2 if ALS supported
     
     // Todo: add video only if supported
     //mEditorCsVideo1 = new CpSettingFormItemData(
     //        HbDataFormModelItem::TextItem, tr("Video mailbox") );
-    //_DBGLOG("VmbxCpGroup::beforeLoadingConfigPlugins appendChild")
+    //_DBGLOG("VmbxCpGroup::loadingPreparation appendChild")
     //appendChild( mEditorCsVideo1 );
     
-    // TODO: get all ps addresses AND THEIR NAMES from engine and add ui controls for them
+    // TODO: get all ps addresses AND THEIR NAMES from engine and add ui controls
+    //for them
     // Set UI control pointers to mPsServiceEditors
     
     updateAllMailboxesToUi();
@@ -110,118 +121,102 @@
     // Editing of PS Services is not allowed by default, disable ui editing
     // for them.
 
-    _DBGLOG("VmbxCpGroup::beforeLoadingConfigPlugins <")
+    _DBGLOG("VmbxCpGroup::loadingPreparation <")
 }
 
-// -----------------------------------------------------------------------------
-// Comment me!
-// -----------------------------------------------------------------------------
-//
-VmbxCpGroup::~VmbxCpGroup()
-{
-    _DBGLOG("VmbxCpGroup::~VmbxCpGroup")
-    if ( mUiEngine ) {
-        delete mUiEngine;
-    }
-    // TODO: check cleanup, this is draft project version
-}
-
-// -----------------------------------------------------------------------------
-// Comment me!
-// -----------------------------------------------------------------------------
-//
+/*!
+   Update Cs voice primary 
+*/
 void VmbxCpGroup::updateCsVoicePrimaryToUi()
 {
     _DBGLOG("VmbxCpGroup::updateCsVoicePrimaryToUi")
-    if ( mEditorCsVoice1 &&mUiEngine) {
+    if (mEditorCsVoice1 && mUiEngine) {
         QString newUiValue("");
-        mUiEngine->GetCsVoice1Number( newUiValue );
-        mEditorCsVoice1->setContentWidgetData( "text", newUiValue );
+        mUiEngine->getCsVoice1Number(newUiValue);
+        mEditorCsVoice1->setContentWidgetData("text", newUiValue);
     }
 }
 
-// -----------------------------------------------------------------------------
-// Comment me! 
-// -----------------------------------------------------------------------------
-//
+/*!
+    Update Cs voice Als
+*/
 void VmbxCpGroup::updateCsVoiceAlsToUi()
 {
     _DBGLOG("VmbxCpGroup::updateCsVoiceAlsToUi")
-    if ( mEditorCsVoice2 && mUiEngine )
-        {
+    if (mEditorCsVoice2 && mUiEngine){
         QString newUiValue("");
-        mUiEngine->GetCsVoice1Number( newUiValue );
-        _DBGLOG2( "VmbxCpGroup::updateCsVoiceAlsToUi newUiValue=", newUiValue)
-        mEditorCsVoice2->setContentWidgetData( "text", newUiValue );
-        }
+        mUiEngine->getCsVoice1Number(newUiValue );
+        _DBGLOG2("VmbxCpGroup::updateCsVoiceAlsToUi newUiValue=", newUiValue)
+        mEditorCsVoice2->setContentWidgetData("text", newUiValue );
+    }
 }
 
-// -----------------------------------------------------------------------------
-// Comment me! 
-// -----------------------------------------------------------------------------
-//
+/*!
+   update Cs video primary
+*/
 void VmbxCpGroup::updateCsVideoPrimaryToUi()
 {
-    _DBGLOG("VmbxCpGroup::updateCsVoiceAlsToUi")
-    if ( mEditorCsVideo1 && mUiEngine )
-        {
+    _DBGLOG("VmbxCpGroup::updateCsVideoPrimaryToUi >")
+    if (mEditorCsVideo1 && mUiEngine){
         QString newUiValue("");
-        mUiEngine->GetCsVideo1Number( newUiValue );
-        _DBGLOG2( "VmbxCpGroup::updateCsVideoPrimaryToUi newUiValue=", newUiValue)
-        mEditorCsVideo1->setContentWidgetData( "text", newUiValue );
-        }
+        mUiEngine->getCsVideo1Number(newUiValue);
+        _DBGLOG2("VmbxCpGroup::updateCsVideoPrimaryToUi newUiValue=", \
+            newUiValue)
+        mEditorCsVideo1->setContentWidgetData("text", newUiValue);
+    }
+    _DBGLOG("VmbxCpGroup::updateCsVideoPrimaryToUi <")
 }
 
-// -----------------------------------------------------------------------------
-// Comment me! 
-// -----------------------------------------------------------------------------
-//
+/*!
+   update Ps services
+*/
 void VmbxCpGroup::updatePsServicesToUi()
 {
-    _DBGLOG("VmbxCpGroup::updatePsServicesToUi EMPTY METHOD WAITING FOR IMPLEMENTING")
-    /* 
-        TODO: Set values from engine to ui
-        NOTICE: IT IS POSSIBLE THAT PS SERVICES WILL NOT BE DISPLAYED BY VMBX 
-        CONTROL PANEL WHEN WE GET THE NEW UI CONCEPT!!!!!!
-    */
+    _DBGLOG("VmbxCpGroup::updatePsServicesToUi >")
+    // Set values from engine to ui
+    // NOTICE: IT IS POSSIBLE THAT PS SERVICES WILL NOT BE DISPLAYED BY VMBX 
+    // CONTROL PANEL WHEN WE GET THE NEW UI CONCEPT!!!!!!
+    _DBGLOG("VmbxCpGroup::updatePsServicesToUi <")
 }
 
-// -----------------------------------------------------------------------------
-// Comment me! 
-// -----------------------------------------------------------------------------
-//
+/*!
+    Update default mailbox
+*/
 void VmbxCpGroup::updateDefaultMailboxToUi()
 {
-    _DBGLOG("VmbxCpGroup::updateDefaultMailboxToUi EMPTY METHOD WAITING FOR IMPLEMENTING")
-    // TODO: implement me!
-    // Consider should you check here if the number length of the default mailbox
+    _DBGLOG("VmbxCpGroup::updateDefaultMailboxToUi >")
+    // Consider should you check here if the number 
+    // length of the default mailbox
     // and reset the default mailbox type selection to "none" if it is.
-    // If you do so, remember to save the new value to engine. 
+    // If you do so, remember to save the new value to engine.
+    _DBGLOG("VmbxCpGroup::updateDefaultMailboxToUi <")
 }
 
-// -----------------------------------------------------------------------------
-// Comment me! 
-// -----------------------------------------------------------------------------
-//
+/*!
+    Update all mailboxes
+*/
 void VmbxCpGroup::updateAllMailboxesToUi()
 {
-    _DBGLOG("VmbxCpGroup::updateAllMailboxesToUi")
+    _DBGLOG("VmbxCpGroup::updateAllMailboxesToUi >")
     updateCsVoicePrimaryToUi();
-    updateCsVoiceAlsToUi();
+    //updateCsVoiceAlsToUi();
     //updateCsVideoPrimaryToUi();
-    updatePsServicesToUi();
-    updateDefaultMailboxToUi();
+    //updatePsServicesToUi();
+    //updateDefaultMailboxToUi();
+    _DBGLOG("VmbxCpGroup::updateAllMailboxesToUi <")
 } 
 
-// -----------------------------------------------------------------------------
-// Notification slot for engine signal about Voice Mailbox entries' changes
-// -----------------------------------------------------------------------------
-//
+/*!
+    Notification slot for engine signal about 
+    Voice Mailbox entries' changes
+*/
 void VmbxCpGroup::voiceMailboxEngineEntriesUpdated()
 {
     _DBGLOG("VmbxCpGroup::voiceMailboxEngineEntriesUpdated")
-    /* TODO:  consider is there need to pass the actual modified data 
-    and mailbox type enum to slot (here) so only needed data can be updated.
-    */
+    // Consider is there need to pass the actual modified data 
+    // and mailbox type enum to slot (here) so only needed 
+    // data can be updated.
     updateAllMailboxesToUi();
 }
+
+//End of file
\ No newline at end of file