psln/Inc/pslnidletaskcreateviews.h
changeset 37 89c890c70182
parent 34 6b5204869ed5
child 45 667edd0b8678
equal deleted inserted replaced
34:6b5204869ed5 37:89c890c70182
     1 /*
       
     2 * Copyright (c) 2004-2006 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:  Background task for creating views.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PSLNIDLETASKCREATEVIEWS_H
       
    20 #define C_PSLNIDLETASKCREATEVIEWS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class CPslnUi;
       
    25 
       
    26 /**
       
    27  *  Creates Themes application views in the background when application 
       
    28  *  is idle.
       
    29  *  @since S60 v3.1
       
    30  */
       
    31 class CPslnIdleTaskCreateViews : public CBase
       
    32     {
       
    33 public:
       
    34 
       
    35     /**
       
    36     * Two-phased constructor.
       
    37     * @param aPslnUi pointer to UI class.
       
    38     * @return new instance of CPslnIdleTaskCreateViews.
       
    39     */
       
    40     static CPslnIdleTaskCreateViews* NewL( CPslnUi* aPslnUi );
       
    41     
       
    42     /**
       
    43     * Destructor.
       
    44     */
       
    45     virtual ~CPslnIdleTaskCreateViews();
       
    46 
       
    47     /**
       
    48     * From MAknBackgroundProcess.
       
    49     * Return ETrue when the process is done.
       
    50     * @return ETrue if process is ready.
       
    51     */
       
    52     TBool IsFinished() const;
       
    53 
       
    54 private:
       
    55 
       
    56     /**
       
    57     * Callback when idle time occurs.
       
    58     */
       
    59     static TInt DoHandleIdleTimeL( TAny* aAny );
       
    60 
       
    61     /**
       
    62     * When idle time occurs, creates a new view, until all views
       
    63     * have been created.
       
    64     */
       
    65     void HandleIdleTimeL();
       
    66 
       
    67     /**
       
    68     * C++ constructor.
       
    69     */
       
    70     CPslnIdleTaskCreateViews( CPslnUi* aPslnUi );
       
    71 
       
    72     /**
       
    73     * By default Symbian 2nd phase constructor is private.
       
    74     */
       
    75     void ConstructL();
       
    76 
       
    77 private: // data
       
    78 
       
    79     /**
       
    80     * Reference to Psln UI class.
       
    81     * Not own.
       
    82     */
       
    83     CPslnUi* iPslnUi;
       
    84 
       
    85     /**
       
    86     * Has the task been done.
       
    87     */
       
    88     TBool iDone;
       
    89 
       
    90     /**
       
    91     * Internal state.
       
    92     */
       
    93     TInt iIdleStep;
       
    94 
       
    95     /**
       
    96     * Idle task that creates views in the background.
       
    97     * Own.
       
    98     */
       
    99     CIdle* iIdleTask;
       
   100     };
       
   101 
       
   102 #endif // C_PSLNIDLETASKCREATEVIEWS_H