calendarui/controller/inc/caleneditui.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 15:13:43 +0300
branchRCL_3
changeset 29 12af337248b1
parent 0 f979ecb2b13e
child 30 bd7edf625bdd
permissions -rw-r--r--
Revision: 201033 Kit: 201035

/*
* Copyright (c) 2005 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:  Controller class for editing related UI behavior
 *
*/


#ifndef __CALENEDITUI_H__
#define __CALENEDITUI_H__

#include <QObject>

// INCLUDES
#include "calennotificationhandler.h"   // MCalenNotificationHandler
#include "calencommandhandler.h"

// FORWARD DECLARATIONS
class CCalInstance;
class CCalenController;
class CalenEditor;


// CLASS DECLARATION

/**
 * CCalenEditUi encapsulates editing related behavior in Calendar application.
 *
 */
class CCalenEditUi : public QObject,
									public MCalenNotificationHandler,
                                    public MCalenCommandHandler
    {
    Q_OBJECT
    
    public: // public API
        /**
         * Symbian 1st phase construction
         * @param aController Reference of the controller that owns the editui
         */
        static CCalenEditUi* NewL( CCalenController& aController );
        
        /**
         * Destructor
         */
        virtual ~CCalenEditUi();

    public:  // MCalenCommandHandler
        /**
         * Handles action ui commands
         * @param aCommand Command to be handled
         */
        TBool HandleCommandL( const TCalenCommand& aCommand );
    
    public:  // from MCalenNotificationHandler
        /** 
         * Handle notifications
         * @param aNotification Nofication to be handled
         */
        void HandleNotification(const TCalenNotification aNotification );
        
        /**
        * This Function saves the entries
        * should only calls after edit or create function has called 
        */
        void saveAndCloseEditor();

    private: // own methods
        /**
         * C++ constructor
         * @param aController Reference to the controller that owns the caleneditui
         */
        CCalenEditUi( CCalenController& aController);
        
        /**
         * Symbian 2nd phase constructor
         */
        void ConstructL();
        
    private slots:
		
		void handleEntrySaved();
		void handleDialogClosed();
        
    private: // data
        
        CCalenController&       iController;
        CalenEditor*			iEditor;
    };

#endif // __CALENEDITUI_H__

// End of File