browserutilities/feedsengine/FeedsUI/Common/src/StatusPane.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2005 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 the License "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:  Status-pane related methods
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <akntitle.h>
       
    21 #include <aknview.h>
       
    22 #include <AknViewAppUi.h>
       
    23 #include <EikSpane.h>
       
    24 #include <StringLoader.h>
       
    25 
       
    26 #include "StatusPane.h"
       
    27 
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // StatusPane::SetTitleL
       
    31 //
       
    32 // Sets the title.
       
    33 // -----------------------------------------------------------------------------
       
    34 //
       
    35 void StatusPane::SetTitleL(TInt aStringId)
       
    36     {
       
    37     HBufC*  label = NULL;
       
    38 
       
    39     // Load the label's resource.
       
    40 	label = StringLoader::LoadLC(aStringId);
       
    41 
       
    42     SetTitleL(*label);
       
    43     CleanupStack::PopAndDestroy(label);
       
    44     }
       
    45 
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // StatusPane::SetTitleL
       
    49 //
       
    50 // Sets the title.
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 void StatusPane::SetTitleL(const TDesC& aString)
       
    54     {
       
    55     CAknViewAppUi*  appUi;
       
    56 
       
    57     // Get the title sub-pane.
       
    58     appUi = static_cast<CAknViewAppUi*>(CCoeEnv::Static()->AppUi());
       
    59 
       
    60     CEikStatusPaneBase::TPaneCapabilities subPane = appUi->StatusPane()->
       
    61             PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle));
       
    62 
       
    63     // Set the title if the pane belongs to the app.
       
    64 	if (subPane.IsPresent() && subPane.IsAppOwned())
       
    65 		{
       
    66         CAknTitlePane*  titlePane;
       
    67         TUid            uid;
       
    68 
       
    69         uid.iUid = EEikStatusPaneUidTitle;
       
    70 
       
    71 		titlePane = (CAknTitlePane*) appUi->StatusPane()->ControlL(uid);
       
    72         titlePane->SetTextL(aString);
       
    73         }
       
    74     }