scrsaver/scrsaverplugins/ScreenSaverAnimPlugin/inc/ScreenSaverAnimPluginContainer.h
branchRCL_3
changeset 26 e8d784ac1a4b
parent 0 040fcad49f44
equal deleted inserted replaced
25:aaeeca1f15af 26:e8d784ac1a4b
       
     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 "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:   This header defines the container for the settings list
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_SCREENSAVERANIMPLUGINCONTAINER_H
       
    21 #define C_SCREENSAVERANIMPLUGINCONTAINER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include    <coeccntx.h>
       
    25 #include    <eikclb.h>
       
    26 #include    <eiklbo.h>
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 * CScreenSaverAnimPluginContainer container class
       
    32 *
       
    33 */
       
    34 class CScreenSaverAnimPluginContainer : public CCoeControl,
       
    35                                         public MEikListBoxObserver
       
    36     {
       
    37     public: // Constructors and destructor
       
    38 
       
    39         static CScreenSaverAnimPluginContainer* NewLC(
       
    40                            CScreenSaverAnimPlugin* aCaller, 
       
    41                            const CCoeControl* aParent,
       
    42                            CScreenSaverAnimSettingObject* aSettingObject );
       
    43 
       
    44         static CScreenSaverAnimPluginContainer* NewL( 
       
    45                               CScreenSaverAnimPlugin* aCaller,
       
    46                               const CCoeControl* aParent,
       
    47                               CScreenSaverAnimSettingObject* aSettingObject );
       
    48 
       
    49         CScreenSaverAnimPluginContainer(
       
    50                           CScreenSaverAnimPlugin* aCaller,
       
    51                           CScreenSaverAnimSettingObject* aSettingObject );
       
    52 
       
    53         virtual void ConstructL( const CCoeControl* aParent,
       
    54                                 const TRect& aRect );
       
    55 
       
    56         /**
       
    57         * Constructs all common parts of the container.
       
    58         * @param aRect Listbox control's rect.
       
    59         * @param aResTitleId Resource id for title.
       
    60         * @param aResLbxId Resource id for listbox.
       
    61         * @return void
       
    62         */
       
    63         void BaseConstructL( const TRect& aRect, TInt aResTitleId, 
       
    64                     TInt aResLbxId = 0 );
       
    65 
       
    66         /**
       
    67         * Destructor.
       
    68         */
       
    69         ~CScreenSaverAnimPluginContainer();
       
    70 
       
    71     public: //new
       
    72 
       
    73         /**
       
    74         * Updates listbox's item's value.
       
    75         * @param aItemId An item which is updated.
       
    76         * @return void.
       
    77         */
       
    78         void UpdateListBoxL( TInt aItemId );
       
    79 
       
    80         void HandleListBoxSelectionL();
       
    81 
       
    82         /**
       
    83         * Sets feature support - see screensaveranimpluginconst.h for feature list.
       
    84         * @param aFeatureBitFlags feature support bitflags.
       
    85         */
       
    86         void GetFeatureSupportL( TBitFlags& aFeatureBitFlags ) const;
       
    87 
       
    88         /**
       
    89         * Checks if feature is supported.
       
    90         * @param aFeatureID feature ID.
       
    91         * @return ETrue if feature is supported, EFalse otherwise.
       
    92         */
       
    93         TBool IsFeatureSupported( TInt aFeatureID );
       
    94 
       
    95     public: //MEikListBoxObserver 
       
    96 
       
    97         virtual void HandleListBoxEventL( CEikListBox* aListBox, 
       
    98                 TListBoxEvent aEventType );
       
    99 
       
   100     public: //From CCoeControl
       
   101 
       
   102         virtual void HandleResourceChange( TInt aType );
       
   103 
       
   104         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
       
   105                 TEventCode aType ); // this processes key events
       
   106 
       
   107         virtual void SetContainerWindowL( const CCoeControl& aContainer );
       
   108 
       
   109         // Focus change handler
       
   110         void FocusChanged( TDrawNow aDrawNow );
       
   111 
       
   112     protected: // New methods
       
   113 
       
   114         /**
       
   115         * Constructs listbox.
       
   116         * @param aResLbxId Resource id for listbox.
       
   117         * @return void
       
   118         */
       
   119         virtual void ConstructListBoxL( TInt aResLbxId );
       
   120 
       
   121     private: // new
       
   122         void CreateListBoxItemsL();
       
   123         void MakeAnimTimeOutItemL();
       
   124         void MakeLightsTimeOutItemL();
       
   125         void MakeFileNameItem();
       
   126         void ShowFileNameItemL();
       
   127         void ShowAnimTimeOutItemL();
       
   128         void ShowLightsTimeOutItemL();
       
   129 
       
   130     private: // from CCoeControl
       
   131 
       
   132         void SizeChanged();
       
   133 
       
   134         TInt CountComponentControls() const;
       
   135 
       
   136         CCoeControl* ComponentControl( TInt /*aIndex*/ ) const;
       
   137         
       
   138         void GetNormalScreenLayoutRect( TRect& aRect )  const;
       
   139 
       
   140     protected: // Data
       
   141         CEikTextListBox* iListBox;
       
   142         
       
   143     private: // new
       
   144         CDesCArrayFlat* iItems;
       
   145         CDesCArray* iItemArray;
       
   146         TBuf<128> iItem;
       
   147         CScreenSaverAnimSettingObject* iSettingObject;
       
   148         CScreenSaverAnimPlugin* iCaller;
       
   149         TBool iInShowFileItem;
       
   150 
       
   151         /**
       
   152         * Defines which features are supported.
       
   153         */
       
   154         TBitFlags iFeaturesSupport;
       
   155 
       
   156     };
       
   157 
       
   158 #endif // C_SCREENSAVERANIMPLUGINCONTAINER_H
       
   159 
       
   160 // End of File