phonebookui/Phonebook/App/src/CPbkMenuFiltering.cpp
changeset 0 e686773b3f54
child 21 9da50d567e3c
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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 *       Performs menu pane filtering. Common filtering methods are in
       
    16 *       app view classes, this class contains filtering methods for
       
    17 *       commands that differ in different Series 60 releases.
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include "CPbkMenuFiltering.h"  // This class' declaration
       
    24 #include <Phonebook.hrh>
       
    25 #include <eikmenup.h>           // CEikMenuPane
       
    26 #include <FeatMgr.h>
       
    27 #include <bldvariant.hrh>
       
    28 #include <MenuFilteringFlags.h>
       
    29 #include <Stringloader.h>
       
    30 #include <Phonebook.rsg>
       
    31 
       
    32 namespace {
       
    33 
       
    34 // LOCAL CONSTANTS AND MACROS
       
    35 _LIT(KSettingsVisible, "1");
       
    36 
       
    37 } // namespace
       
    38 // ================= MEMBER FUNCTIONS =======================
       
    39 
       
    40 void CPbkMenuFiltering::SettingsPaneMenuFilteringL
       
    41         (CEikMenuPane& aMenuPane, TUint /*aFlags = 0*/)
       
    42     {
       
    43     // settings menu item visibility is defined in phonebook.loc file
       
    44     // value "1" for visible and "0" for hidden.
       
    45     HBufC* visibility = StringLoader::LoadLC(R_QTN_PHOB_NAME_ORDERING_SETTINGS_VISIBILITY);
       
    46 
       
    47     if ( visibility->Compare(KSettingsVisible) != 0 )
       
    48         {
       
    49         // Filter out Settings
       
    50         aMenuPane.SetItemDimmed(EPbkCmdSettings, ETrue);
       
    51         }
       
    52 
       
    53     CleanupStack::PopAndDestroy(visibility);
       
    54     }
       
    55 
       
    56 void CPbkMenuFiltering::GroupsListPaneMenuFilteringL
       
    57         (CEikMenuPane& aMenuPane, TUint aFlags /*=0*/)
       
    58     {
       
    59     HBufC* visibility = StringLoader::LoadLC(R_QTN_PHOB_NAME_ORDERING_SETTINGS_VISIBILITY);
       
    60 
       
    61     if ( visibility->Compare(KSettingsVisible) != 0 )
       
    62         {
       
    63         // Filter out Settings
       
    64         aMenuPane.SetItemDimmed(EPbkCmdSettings, ETrue);
       
    65         }
       
    66 
       
    67     if (aFlags & KPbkControlEmpty)
       
    68         {
       
    69         // If the list is empty no options menu items
       
    70         aMenuPane.SetItemDimmed(EPbkCmdOpenGroup, ETrue);
       
    71         aMenuPane.SetItemDimmed(EPbkCmdWrite, ETrue);
       
    72         aMenuPane.SetItemDimmed(EPbkCmdRemoveGroup, ETrue);
       
    73         aMenuPane.SetItemDimmed(EPbkCmdRenameGroup, ETrue);
       
    74         aMenuPane.SetItemDimmed(EPbkCmdSetRingingTone, ETrue);
       
    75         aMenuPane.SetItemDimmed(EPbkPhonebookInfoSubMenu, ETrue);
       
    76         }
       
    77 
       
    78     if (aFlags & KPbkNoOpenOneTouch)
       
    79         {
       
    80         aMenuPane.SetItemDimmed(EPbkCmdOpenOneTouch, ETrue);
       
    81         }
       
    82 
       
    83     if ( aFlags & KPbkNoGroupSend )
       
    84         {
       
    85         aMenuPane.SetItemDimmed(EPbkCmdWrite, ETrue);
       
    86         }
       
    87     CleanupStack::PopAndDestroy(visibility);
       
    88     }
       
    89 
       
    90 //  End of File