diff -r 000000000000 -r e686773b3f54 phonebookui/Phonebook2/Commands/inc/CPbk2CommandStore.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/Phonebook2/Commands/inc/CPbk2CommandStore.h Tue Feb 02 10:12:17 2010 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Phonebook 2 command store. +* +*/ + + +#ifndef CPBK2COMMANDSTORE_H +#define CPBK2COMMANDSTORE_H + +// INCLUDES +#include +#include +#include "MPbk2CommandList.h" + +#include + +// CLASS DECLARATION +class MPbk2MenuCommandObserver; +class CAknInputBlock; + +/** + * Phonebook 2 command store. This object owns all the command objects. + */ +class CPbk2CommandStore : public CBase, + public MPbk2CommandList, + public MPbk2CommandObserver, + public MAknInputBlockCancelHandler + { + public: // Construction and destruction + + /** + * Creates a new instance of this class. + * + * @return A new instance of this class. + */ + IMPORT_C static CPbk2CommandStore* NewL(); + + /** + * Destructor. + */ + ~CPbk2CommandStore(); + + public: // Interface + + /** + * Adds a menu command observer. + * + * @param aObserver Observer to add. + */ + void AddMenuCommandObserver( + MPbk2MenuCommandObserver& aObserver ); + + /** + * Removes a menu command observer. + * + * @param aObserver Observer to remove. + */ + void RemoveMenuCommandObserver( + MPbk2MenuCommandObserver& aObserver ); + /** + * Destroys all the commands in the iCommandArray. + * by calling CommandFinished() on each one. + */ + void DestroyAllCommands(); + + public: // From MPbk2CommandList + IMPORT_C void AddAndExecuteCommandL( + MPbk2Command* aCommand ); + + private: // From MPbk2CommandObserver + void CommandFinished( + const MPbk2Command& aCommand ); + + public: // From MAknInputBlockCancelHandler + + void AknInputBlockCancel(); + + + private: // Implementation + CPbk2CommandStore(); + void ConstructL(); + static TInt IdleDestructorCallback( + TAny* aSelf ); + void IdleDestructor(); + + private: // Data + /// Own: Array of executed commands + RPointerArray iCommandArray; + /// Own: Idle command destroyer + CIdle* iIdleDestroyer; + /// Own: Array of executed commands + RPointerArray iIdleDestructableCommands; + /// Own: Array of menu command observers + RPointerArray iCommandObservers; + /// Own: User input blocker + CAknInputBlock* iInputBlocker; + }; + +#endif // CPBK2COMMANDSTORE_H + +// End of File