cbs/cbsui/UiSrc/CCbsUiConfirmationNote.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:15:03 +0100
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2002 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: 
*     Implementation for CCbsUiConfirmationNote.
*
*
*/


// INCLUDES
#include <AknGlobalConfirmationQuery.h>
#include <StringLoader.h>
#include <CbsUiApp.rsg>
#include "CCbsUiConfirmationNote.h"


// MODULE DATA STRUCTURES

/**
 * Global Confirmation query observer. Doesn't do anything.
 */
class CCbsUiConfirmationNote::CGlobalConfirmationQueryObserver : 
    public CActive
    {
    public: // constructor

        inline CGlobalConfirmationQueryObserver() : CActive(EPriorityIdle) 
            {
            }

        inline ~CGlobalConfirmationQueryObserver() 
            { 
            Cancel(); 
            }

        inline void ConstructL() 
            {
            CActiveScheduler::Add(this);
            SetActive();
            }

    public: // from CActive

    	void DoCancel() 
            { 
            }

	    void RunL() 
            {
            Cancel(); 
            }
    };

// ================= MEMBER FUNCTIONS =======================

CCbsUiConfirmationNote::CCbsUiConfirmationNote()
    {
    }

CCbsUiConfirmationNote::~CCbsUiConfirmationNote()
    {
    delete iConfQueryObserver;
    delete iGlobalConfirmationQuery;
    }


// ---------------------------------------------------------
// CCbsUiConfirmationNote::ShowGlobalConfirmationNoteL
// 
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CCbsUiConfirmationNote::ShowGlobalConfirmationNoteL( CCoeEnv& aCoeEnv )
    {
    // create active object
    CGlobalConfirmationQueryObserver* observer = 
        new (ELeave) CGlobalConfirmationQueryObserver();

    if (iConfQueryObserver)
        {
        delete iConfQueryObserver;
        iConfQueryObserver = NULL;
        }
    iConfQueryObserver = observer;
    iConfQueryObserver->ConstructL();

    // show critical level note
    CAknGlobalConfirmationQuery* dlg = CAknGlobalConfirmationQuery::NewL();
    if (iGlobalConfirmationQuery)
        {
        delete iGlobalConfirmationQuery;
        iGlobalConfirmationQuery = NULL;
        }
    iGlobalConfirmationQuery = dlg;

    HBufC* noteText = StringLoader::LoadLC(
        R_TEXT_NOTE_NOT_ENOUGH_MEMORY, &aCoeEnv);
    
    iGlobalConfirmationQuery->ShowConfirmationQueryL(
        iConfQueryObserver->iStatus,
        *noteText, 
        R_AVKON_SOFTKEYS_OK_EMPTY);

    CleanupStack::PopAndDestroy(noteText);
    }


//  End of File