userguide/src/HelpBaseView.cpp
changeset 18 375271912456
child 34 4533d75b8d4e
equal deleted inserted replaced
15:c0dfc135a46c 18:375271912456
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include <hbtoolbar.h>
       
    19 #include <hbnotificationdialog.h>
       
    20 #include <hbaction.h>
       
    21 
       
    22 #include "HelpBaseView.h"
       
    23 
       
    24 //////////////////////////////////////////////////////////////////////////////////////////////
       
    25 
       
    26 HelpBaseView::HelpBaseView()
       
    27 {
       
    28 }
       
    29 
       
    30 HelpBaseView::~HelpBaseView()
       
    31 {
       
    32 }
       
    33 
       
    34 
       
    35 ////////////////////////////////////////////////////////////////////////////////////////////
       
    36 
       
    37 void HelpBaseView::initBaseDocMl()
       
    38 {
       
    39  // Create widget hierarchy
       
    40     setObjectName( DOCML_VIEW_NAME );
       
    41 
       
    42     // List existing root elements - this allows us to refer to objects in the XML 
       
    43     // which are created outside the document.
       
    44     QObjectList roots;
       
    45     roots.append( this );
       
    46 
       
    47 	mBuilder.setObjectTree(roots);
       
    48 
       
    49 	mBuilder.load(QRC_DOCML_BASE);
       
    50 }
       
    51 
       
    52 void HelpBaseView::onToolbarOnlineSupport()
       
    53 {
       
    54     HbNotificationDialog *notificationDialog = new HbNotificationDialog();
       
    55     notificationDialog->setParent(this);
       
    56     notificationDialog->setTitle(URL_LINK_SUPPORT);
       
    57     notificationDialog->show();
       
    58 }
       
    59 
       
    60 void HelpBaseView::onOrientationChanged(Qt::Orientation orientation)
       
    61 {
       
    62     RefreshToolbarText(orientation);
       
    63 }
       
    64 
       
    65 void HelpBaseView::RefreshToolbarText(Qt::Orientation orientation)
       
    66 {
       
    67 	bool isLandscape = (Qt::Horizontal==orientation);
       
    68     HbAction* tollbarAction = mBuilder.findObject<HbAction*>(DOCML_ACTION_ALL);
       
    69     tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_ALL) : QString());
       
    70 
       
    71     tollbarAction = mBuilder.findObject<HbAction*>(DOCML_ACTION_SEARCH);
       
    72     tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_FIND) : QString());
       
    73 
       
    74     tollbarAction = mBuilder.findObject<HbAction*>(DOCML_ACTION_LINK_NOKIA);
       
    75     tollbarAction->setText(isLandscape ? qtTrId(TXT_BUTTON_LINK_SUPPORT) : QString());
       
    76 }
       
    77 
       
    78 // end of file