phonebookui/Phonebook2/Commands/inc/CPbk2CommandStore.h
changeset 0 e686773b3f54
child 21 9da50d567e3c
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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:  Phonebook 2 command store.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2COMMANDSTORE_H
       
    20 #define CPBK2COMMANDSTORE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2CommandObserver.h>
       
    25 #include "MPbk2CommandList.h"
       
    26 
       
    27 #include <akninputblock.h>
       
    28 
       
    29 //  CLASS DECLARATION
       
    30 class MPbk2MenuCommandObserver;
       
    31 class CAknInputBlock;
       
    32 
       
    33 /**
       
    34  * Phonebook 2 command store. This object owns all the command objects.
       
    35  */
       
    36 class CPbk2CommandStore : public CBase,
       
    37                           public MPbk2CommandList,
       
    38                           public MPbk2CommandObserver,
       
    39                           public MAknInputBlockCancelHandler
       
    40     {
       
    41     public: // Construction and destruction
       
    42 
       
    43         /**
       
    44          * Creates a new instance of this class.
       
    45          *
       
    46          * @return  A new instance of this class.
       
    47          */
       
    48         IMPORT_C static CPbk2CommandStore* NewL();
       
    49 
       
    50         /**
       
    51          * Destructor.
       
    52          */
       
    53         ~CPbk2CommandStore();
       
    54 
       
    55     public: // Interface
       
    56 
       
    57         /**
       
    58          * Adds a menu command observer.
       
    59          *
       
    60          * @param aObserver     Observer to add.
       
    61          */
       
    62         void AddMenuCommandObserver(
       
    63                 MPbk2MenuCommandObserver& aObserver );
       
    64 
       
    65         /**
       
    66          * Removes a menu command observer.
       
    67          *
       
    68          * @param aObserver     Observer to remove.
       
    69          */
       
    70         void RemoveMenuCommandObserver(
       
    71                 MPbk2MenuCommandObserver& aObserver );
       
    72         /**
       
    73          * Destroys all the commands in the iCommandArray.
       
    74          * by calling CommandFinished() on each one.
       
    75          */
       
    76         void DestroyAllCommands();
       
    77 
       
    78     public: // From MPbk2CommandList
       
    79         IMPORT_C void AddAndExecuteCommandL(
       
    80                 MPbk2Command* aCommand );
       
    81 
       
    82     private: // From MPbk2CommandObserver
       
    83         void CommandFinished(
       
    84                 const MPbk2Command& aCommand );
       
    85         
       
    86     public: // From MAknInputBlockCancelHandler
       
    87     	
       
    88     	void AknInputBlockCancel();
       
    89 
       
    90 
       
    91     private: // Implementation
       
    92         CPbk2CommandStore();
       
    93         void ConstructL();
       
    94         static TInt IdleDestructorCallback(
       
    95                 TAny* aSelf );
       
    96         void IdleDestructor();
       
    97 
       
    98     private: // Data
       
    99         /// Own: Array of executed commands
       
   100         RPointerArray<MPbk2Command> iCommandArray;
       
   101         /// Own: Idle command destroyer
       
   102         CIdle* iIdleDestroyer;
       
   103         /// Own: Array of executed commands
       
   104         RPointerArray<MPbk2Command> iIdleDestructableCommands;
       
   105         /// Own: Array of menu command observers
       
   106         RPointerArray<MPbk2MenuCommandObserver> iCommandObservers;
       
   107         /// Own: User input blocker
       
   108         CAknInputBlock* iInputBlocker;
       
   109     };
       
   110 
       
   111 #endif // CPBK2COMMANDSTORE_H
       
   112 
       
   113 // End of File