calendarui/views/inc/calencontainerlayoutmanager.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 27 Apr 2010 16:36:22 +0300
branchRCL_3
changeset 15 9711e452b5e9
parent 0 f979ecb2b13e
permissions -rw-r--r--
Revision: 201015 Kit: 201017

/*
* Copyright (c) 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:   Manages preview pane, info bar and toolbar for calendar views
 *
*/



#ifndef CALENCONTAINERLAYOUTMANAGER_H
#define CALENCONTAINERLAYOUTMANAGER_H

//  INCLUDES
#include <calenservices.h>              // Calendar services
#include "calencontainer.h"             // CCalenContainer

//  FORWARD DECLARATIONS
class CAknToolbar;

/**
 *  CCalenNativeViewExtension
 *  This class decides if a calendar view should additionally display a 
 *  preview pane or an info bar
 */
NONSHARABLE_CLASS( CCalenContainerLayoutManager ) : public CBase
    {
    public:

        enum TCalenContainerLayout
            {
            ECalenContainerToolbar,
            ECalenContainerInfobar,
            ECalenContainerPreview
            };
    
        static CCalenContainerLayoutManager* NewL( 
                            MCalenServices& aServices, CCalenContainer& aContainer );
                            
        ~CCalenContainerLayoutManager();

    public:
        TBitFlags LayoutFlags();
        CCoeControl* ControlOrNull();
        void GetLayoutAndExtensionL();
        CAknToolbar* ToolbarOrNull();
        void SetToolbarVisibility( TBool aVisible );
        
        void HandleResourceChange( TInt aType );
        
    private:
        CCalenContainerLayoutManager( MCalenServices& aServices, CCalenContainer& aContainer );
        void ConstructL();       
        
        void CheckPreviewL();
        void CheckInfobarL();
        void CheckToolbarL();
        
    private:
        CCalenContainer& iContainer;        // Calendar Container
        MCalenServices& iServices;          // Calendar Services
        CCoeControl* iInfobar;              // Info bar, owned by a plugin
        CAknToolbar* iToolbar;              // Toolbar, owned by the appui
        TBitFlags iLayoutFlags;             // Bitfield for current layout
    };

#endif // CALENCONTAINERLAYOUTMANAGER_H


// End of file