meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmralarmonofffield.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 21:08:33 +0300
branchRCL_3
changeset 12 4ce476e64c59
child 16 b5fbb9b25d57
permissions -rw-r--r--
Revision: 201011 Kit: 201013

/*
* Copyright (c) 2009 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:  ESMR alarm on off field header
 *
*/


#ifndef CMRALARMONOFFFIELD_H
#define CMRALARMONOFFFIELD_H

#include "CESMRfield.h"
#include "mmrabsolutealarmcontroller.h"

class CMRLabel;
class CMRImage;
class MESMRFieldValidator;
//class MMRAbsoluteAlarmController;

/**
 * Creates an alarm on off field for setting absolute alarm on/off
 */
NONSHARABLE_CLASS( CMRAlarmOnOffField ): public CESMRField,
                                         public MMRAbsoluteAlarmController
    {
public:
    /**
     * Creates new CMRAlarmOnOffField object. Ownership
     * is transferred to caller.
     * @return Pointer to created object,
     */
    static CMRAlarmOnOffField* NewL( MESMRFieldValidator* aValidator );

    /**
     * C++ Destructor.
     */
    ~CMRAlarmOnOffField();
    
public: // From MMRAbsoluteAlarmController
    void SetAbsoluteAlarmOn();
    void SetAbsoluteAlarmOff();

private: // From CMRField
    void InternalizeL( MESMRCalEntry& aEntry );
    void SetOutlineFocusL( TBool aFocus );
    TBool ExecuteGenericCommandL( TInt aCommand );

private: // From CCoeControl
    TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType);
    void MakeVisible(TBool aVisible);
    void SizeChanged();
    TInt CountComponentControls() const;
    CCoeControl* ComponentControl( TInt aIndex ) const;
    void SetContainerWindowL( const CCoeControl& aContainer );

private:
    /**
     * Constructor.
     *
     * @param aValidator validator object
     */
    CMRAlarmOnOffField();

    /**
     * Second phase constructor.
     */
    void ConstructL( MESMRFieldValidator* aValidator );

    /**
     * Reset field value.
     */
    void ResetFieldL();

    /**
     * Switch middle softkey: on/off
     */
    void SwitchMiddleSoftKeyL();

private:
  
    // Not Own. Field label.
    CMRLabel* iLabel;

    // Own. Field icon
    CMRImage* iIcon;
    
    // Current value.
    TBool iStatus;
    };

#endif  // CMRALARMONOFFFIELD_H