XDMSettingsUI/inc/XDMPluginContainer.h
branchGCC_SURGE
changeset 28 d9861ae9169c
parent 23 77cb48a03620
parent 26 04ca1926b01c
equal deleted inserted replaced
23:77cb48a03620 28:d9861ae9169c
     1 /*
       
     2 * Copyright (c) 2005-2007 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:    XDM GS plugin main list container.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef GS_XDMPLUGIN_CONTAINER_H
       
    22 #define GS_XDMPLUGIN_CONTAINER_H
       
    23 
       
    24 // INCLUDES
       
    25 #include    <bldvariant.hrh>
       
    26 #include    <coeccntx.h>
       
    27 #include    <eikclb.h>
       
    28 #include    <akntitle.h>
       
    29 
       
    30 #include    "XDMPlugin.hrh"
       
    31 
       
    32 
       
    33 // FORWARD DECLARATION
       
    34 class CGSListBoxItemTextArray;
       
    35 class CEikTextListBox;
       
    36 class CAknSingleStyleListBox;
       
    37 class CXDMPluginMainList;
       
    38 class CAknColumnListBox;
       
    39 class CAknViewAppUi;
       
    40 class CXDMPlugin;
       
    41 class CMainView;
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 /**
       
    46 *  CXDMPluginContainer main list container class
       
    47 */
       
    48 class CXDMPluginContainer : public CCoeControl, MEikListBoxObserver
       
    49     {
       
    50     public: // Constructors and destructor
       
    51         
       
    52         /**
       
    53         * Constructor
       
    54         */
       
    55         CXDMPluginContainer(CAknView* aView);
       
    56 
       
    57         /**
       
    58         * Symbian OS constructor.
       
    59         *
       
    60         * @param aRect Listbox's rect.
       
    61         */
       
    62         void ConstructL( const TRect& aRect );
       
    63 
       
    64         /**
       
    65         * Destructor.
       
    66         */
       
    67         ~CXDMPluginContainer();
       
    68     
       
    69     public: // From CCoeControl
       
    70         
       
    71         /**
       
    72         * See CCoeControl
       
    73         */
       
    74         TInt CountComponentControls() const;
       
    75         
       
    76         /**
       
    77         * See CCoeControl
       
    78         */
       
    79         CCoeControl* ComponentControl( TInt aIndex ) const;
       
    80 
       
    81         /**
       
    82         * See CCoeControl
       
    83         */
       
    84         TKeyResponse OfferKeyEventL( 
       
    85             const TKeyEvent& aKeyEvent, TEventCode aType );
       
    86 
       
    87         /**
       
    88         * See CCoeControl
       
    89         */
       
    90         void SizeChanged();
       
    91 
       
    92         /**
       
    93         * See CCoeControl
       
    94         */
       
    95         void HandleResourceChange( TInt aType );
       
    96         
       
    97         /**
       
    98          * Gets help context
       
    99          */
       
   100         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   101 
       
   102         /**
       
   103          * See CCoeControl
       
   104          */
       
   105         void FocusChanged(TDrawNow aDrawNow);
       
   106 
       
   107  
       
   108     public: // own methods
       
   109         
       
   110         /**
       
   111         * Invokes editing on current item, in response to UI Edit command
       
   112         */
       
   113         void EditCurrentItemL();
       
   114         
       
   115         /**
       
   116         * See MEikListBoxObserver
       
   117         */
       
   118         void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   119         
       
   120         /**
       
   121         * Finds whether main list is empty
       
   122         * @return ETrue if main list is empty.
       
   123         */
       
   124         TBool IsListEmpty();
       
   125         
       
   126         /**
       
   127         * Finds whether the current item is the last item in main list
       
   128         * @return ETrue if current item is last in main list.
       
   129         */
       
   130         TBool IsLastItem();
       
   131         
       
   132         /**
       
   133         * Delete the currently focused set. Also deletes it using XDM API
       
   134         */
       
   135         void DeleteCurrentSetL();
       
   136         
       
   137         /**
       
   138         * Load the main list using XDM API, and perform other necessary tasks
       
   139         */
       
   140         void LoadSettingsListArrayL();
       
   141         
       
   142         /**
       
   143         * Get the name of currently focused set. Usually called by UI.
       
   144         * The pointer to buffer remains on heap, which is deleted by caller.
       
   145         * @return HBufC* pointer to currently focused set name
       
   146         */
       
   147         HBufC* GetCurrentSetNameLC();
       
   148         
       
   149         /**
       
   150         * This function starts the deleting current XDM set. All sub functions
       
   151         * are called through this function.
       
   152         */
       
   153         void DeleteSetProcedureL();
       
   154 
       
   155         /**
       
   156         * This function does necessary action on layout change, it is called from
       
   157         * actual resource change function.
       
   158         * @param aType type of resource
       
   159         */
       
   160         void HandleResourceChangeManual(TInt aType);
       
   161 
       
   162         /**
       
   163         * Set the focus to the given set name if it exist
       
   164         * @param aSetName Set name to set focus
       
   165         */
       
   166         void SetFocusIfExist(TDes& aSetName);
       
   167 
       
   168         
       
   169     private: // own methods
       
   170     
       
   171         /**
       
   172         * Perform the initial setup of the main list. Called by Constructor
       
   173         */
       
   174       void SetupListL();
       
   175       
       
   176         /**
       
   177         * Get the Setting ID of the current set
       
   178         * @return TInt setting ID of the current set
       
   179         */
       
   180       TInt GetCurrentSetIdL();
       
   181       
       
   182         /**
       
   183         * Load XDM Collection names with trap, useful when list doesnt have anything
       
   184         * @param Reference to setting ids
       
   185         * @return CDesCArray collection names
       
   186         */
       
   187       CDesCArray* LoadCollectionNamesL(RArray<TInt>& aSettingIDs);
       
   188       
       
   189       
       
   190       
       
   191     private: // data
       
   192       
       
   193         // Pointer to the main list, owned
       
   194       CAknColumnListBox* iMainList;
       
   195   
       
   196       // Pointer to the application view, not owned
       
   197       CAknView* iView; // not owned
       
   198       
       
   199       // The XDM set names list array, not owned
       
   200       CDesCArray* iSettingListArray;
       
   201       
       
   202       // Buffer for holding new XDM set name
       
   203       TBuf<KMaxSettingSetNameLength>  iSettingNewName;
       
   204       
       
   205       // Title for menu pane
       
   206       TBuf<KMaxSettingSetNameLength>  iTitle;
       
   207       
       
   208       // Pointer to title pane, not owned
       
   209       CAknTitlePane* iTitlePane;
       
   210   
       
   211 
       
   212     };
       
   213 
       
   214 #endif //GS_XDMPLUGIN_CONTAINER_H