calendarui/controller/src/calenactionui.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:32:31 +0100
branchRCL_3
changeset 66 bd7edf625bdd
parent 65 12af337248b1
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:  Calendar action ui
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
// INCLUDES
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    20
#include <aknViewAppUi.h>
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    21
#include <avkon.hrh>
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    22
#include <aknnavi.h>
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    23
#include <akntitle.h>
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    24
#include <eikspane.h>
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    25
#include <Calendar.rsg>
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    26
#include <calencommonui.rsg>
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    27
#include <calenservices.h>
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    28
#include <calentoolbar.h>
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    29
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#include "calendarui_debug.h"
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#include "calenactionui.h"
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
#include "calencontroller.h"
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#include "calendeleteui.h"
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
#include "caleneditui.h"
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    35
#include "calenlocationui.h"
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    36
#include "calensettingsui.h"
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
#include "calennotifier.h"
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    38
#include "calenmultipledbui.h"
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    39
#include "calenattachmentui.h"
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    40
#include "CalenUid.h"
27
55d60436f00b Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    41
#include "calenviewmanager.h"
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
// CCalenActionUi::NewL
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
// 1st phase of construction
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
// (other items were commented in a header).
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
//
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
CCalenActionUi* CCalenActionUi::NewL( CCalenController& aController )
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
    {
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    51
    TRACE_ENTRY_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    52
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
    CCalenActionUi* self = new( ELeave ) CCalenActionUi( aController );
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
    CleanupStack::PushL( self );
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
    self->ConstructL();
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
    CleanupStack::Pop( self );
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    58
    TRACE_EXIT_POINT;
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
    return self;
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
    }
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
// CCalenActionUi::CCalenActionUi
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
// C++ default constructor.
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
// (other items were commented in a header).
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
//
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
CCalenActionUi::CCalenActionUi( CCalenController& aController )
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
    : iController( aController )
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
    {
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    71
    TRACE_ENTRY_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    72
    TRACE_EXIT_POINT;
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
    }
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
// CCalenActionUi::ConstructL
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
// 2nd phase of construction.
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
// (other items were commented in a header).
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
//
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
void CCalenActionUi::ConstructL()
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
    {
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    83
    TRACE_ENTRY_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    84
    TRACE_EXIT_POINT;
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
    }
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
// CCalenActionUi::~CCalenActionUi
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
// Destructor.
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
// (other items were commented in a header).
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
//
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
CCalenActionUi::~CCalenActionUi()
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
    {
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    95
    TRACE_ENTRY_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    96
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
    delete iDeleteUi;
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    98
    delete iEditUi;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    99
    delete iLocationUi;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   100
    delete iAttachmentUi;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   101
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   102
    TRACE_EXIT_POINT;
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
    }
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
// CCalenActionUi::GetCommandHandlerL
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
// Gets a command handler
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
//
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
MCalenCommandHandler* CCalenActionUi::GetCommandHandlerL( TInt aCommand )
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
    {
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
    MCalenCommandHandler* handler = NULL;
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   114
    if( aCommand >= ECalenEditCommandBase &&
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   115
        aCommand < ECalenDeleteCommandBase )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   116
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   117
        if(!iEditUi)
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   118
            {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   119
            iEditUi = CCalenEditUi::NewL(iController);
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   120
            }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   121
        handler = iEditUi;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   122
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   123
    else if( aCommand >= ECalenDeleteCommandBase &&
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   124
             aCommand < ECalenSettingsCommandBase )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   125
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   126
        if(!iDeleteUi)
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   127
            {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   128
            iDeleteUi = CCalenDeleteUi::NewL( iController );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   129
            }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   130
        handler = iDeleteUi;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   131
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   132
    else if( aCommand >= ECalenSettingsCommandBase &&
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   133
             aCommand < ECalenMapCommandBase )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   134
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   135
        handler = this;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   136
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   137
    else if( aCommand >= ECalenMapCommandBase &&
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   138
             aCommand < ECalenAttachmentCommandBase )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   139
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   140
        if(!iLocationUi)
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   141
            {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   142
            iLocationUi = CCalenLocationUi::NewL( iController );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   143
            }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   144
        handler = iLocationUi;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   145
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   146
    else if( aCommand >= ECalenAttachmentCommandBase && 
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   147
             aCommand < ECalenLastCommand )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   148
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   149
        if(!iAttachmentUi)
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   150
            {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   151
            iAttachmentUi = CCalenAttachmentUi::NewL(iController);
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   152
            }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   153
        handler = iAttachmentUi;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   154
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   155
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   156
    TRACE_EXIT_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   157
    return handler;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   158
    }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   159
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   160
// ----------------------------------------------------------------------------
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   161
// CCalenActionUi::HandleCommmandL
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   162
// Handles Calendar commands. Delegates to appropriate action ui.
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   163
// (other items were commented in a header).
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   164
// ----------------------------------------------------------------------------
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   165
//
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   166
/*TBool CCalenActionUi::HandleActionUiCommandL( TInt aCommand )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   167
    {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   168
    TRACE_ENTRY_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   169
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   170
    // Lazy initialisation for action uis.
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   171
    TBool handled( EFalse );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   172
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   173
    if( aCommand >= ECalenEditCommandBase && aCommand < ECalenLastCommand )
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
        {
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
        if( !iEditUi )
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
            {
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
            iEditUi = CCalenEditUi::NewL( iController );
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
            }
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   179
        handled = iEditUi->HandleActionUiCommandL( aCommand );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   180
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   181
        if( !handled )
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
            {
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   183
            if( !iDeleteUi )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   184
                {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   185
                iDeleteUi = CCalenDeleteUi::NewL( iController );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   186
                }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   187
            handled = iDeleteUi->HandleActionUiCommandL( aCommand );
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
            }
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   189
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   190
        if( !handled && aCommand == ECalenShowSettings )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   191
            {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   192
            handled = ETrue;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   193
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   194
            ShowSettingsL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   195
            }
65
12af337248b1 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 27
diff changeset
   196
        }
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   197
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   198
    TRACE_EXIT_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   199
    return handled;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   200
    }*/
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   201
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
// CCalenActionUi::HandleCommandL
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
// Handles key presses.
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
// (other items were commented in a header).
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
//
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
TBool CCalenActionUi::HandleCommandL( const TCalenCommand& aCommand )
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
    {
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   211
    TRACE_ENTRY_POINT;
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
    TBool continueCommand(EFalse);
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   213
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   214
    switch(aCommand.Command())
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   215
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   216
        case ECalenShowSettings:
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   217
            {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   218
            ShowSettingsL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   219
            }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   220
            break;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   221
        case ECalenShowCalendars:
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   222
            {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   223
            ShowCalendarsL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   224
            }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   225
            break;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   226
        default:
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   227
            break;
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
        }
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   229
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   230
    TRACE_EXIT_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   231
    return continueCommand;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   232
    }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   233
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   234
// ----------------------------------------------------------------------------
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   235
// CCalenActionUi::CalenCommandHandlerExtensionL
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   236
// Dummy implementation.
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   237
// (other items were commented in a header).
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   238
// ----------------------------------------------------------------------------
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   239
//
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   240
TAny* CCalenActionUi::CalenCommandHandlerExtensionL( TUid /*aExtensionUid*/ )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   241
    {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   242
    TRACE_ENTRY_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   243
    TRACE_EXIT_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   244
    return NULL;
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
    }
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
// ----------------------------------------------------------------------------
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   248
// CCalenActionUi::ShowCalendarsL
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   249
// Shows the multiple db calendar's dialog
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   250
// (other items were commented in a header).
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   251
// ----------------------------------------------------------------------------
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   252
//
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   253
void CCalenActionUi::ShowCalendarsL()
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   254
    {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   255
    TRACE_ENTRY_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   256
    // Create settings own titlepane and navipane, and swap with existing ones
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   257
    CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   258
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   259
    // Titlepane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   260
    CAknTitlePane* newtp = new( ELeave ) CAknTitlePane();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   261
    CleanupStack::PushL( newtp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   262
    CCoeControl* oldtp = sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), newtp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   263
    CleanupStack::Pop( newtp ); // ownership is passed to statuspane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   264
    TRect oldRect( 0, 0, 0, 0 );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   265
    if( oldtp )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   266
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   267
        CleanupStack::PushL( oldtp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   268
        oldRect = oldtp->Rect();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   269
        CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidTitle ));
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   270
        newtp->SetContainerWindowL( *ctrl );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   271
        newtp->ConstructL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   272
        newtp->SetRect(oldRect);
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   273
        newtp->ActivateL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   274
        }        
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   275
    // NaviPane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   276
    CAknNavigationControlContainer* newnp = new( ELeave )CAknNavigationControlContainer();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   277
    CleanupStack::PushL( newnp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   278
    CCoeControl* oldnp = sp->SwapControlL( TUid::Uid( EEikStatusPaneUidNavi ), newnp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   279
    CleanupStack::Pop( newnp ); // ownership is passed to statuspane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   280
    if( oldnp )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   281
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   282
        CleanupStack::PushL( oldnp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   283
        oldRect = oldnp->Rect();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   284
        CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidNavi ) );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   285
        newnp->SetContainerWindowL( *ctrl );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   286
        newnp->ConstructL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   287
        newnp->SetRect( oldRect );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   288
        newnp->PushDefaultL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   289
        newnp->ActivateL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   290
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   291
            
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   292
        // Hide the toolbar before we display settings menu
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   293
        MCalenToolbar* toolbar = iController.Services().ToolbarOrNull();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   294
        if(toolbar)
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   295
            {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   296
            toolbar->SetToolbarVisibilityL(EFalse);  
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   297
            }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   298
        
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   299
        // defer settings notifications before launching the settings  
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   300
        CCalenNotifier& notifier = iController.Notifier();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   301
        notifier.DeferSettingsNotifications();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   302
        
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   303
        CCalenMultipleDbUi* dlg = CCalenMultipleDbUi::NewL(iController);
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   304
        TInt retValue = KErrNone;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   305
        // Trap showing settings so settings watcher is always resumed.
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   306
        PIM_TRAPD_HANDLE( retValue = dlg->ExecuteLD( R_CALEN_MULTIPLEDB_DIALOG ) );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   307
        notifier.ResumeSettingsNotifications();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   308
        
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   309
        // Unhide the toolbar when manage calendar view is closed
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   310
        TUid activeViewUid = iController.ViewManager().CurrentView();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   311
        if(toolbar && (activeViewUid != KUidCalenMissedAlarmsView ) &&(activeViewUid != KUidCalenMissedEventView ) )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   312
            {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   313
            toolbar->SetToolbarVisibilityL(ETrue); 
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   314
            }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   315
        
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   316
    // When setting is closed, swap back old titlepane and navipane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   317
    if( oldnp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidNavi), oldnp ) )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   318
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   319
        CleanupStack::Pop( oldnp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   320
        delete newnp;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   321
        oldnp->ActivateL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   322
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   323
    if( oldtp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), oldtp ) )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   324
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   325
        CleanupStack::Pop( oldtp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   326
        delete newtp;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   327
        oldtp->ActivateL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   328
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   329
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   330
    iController.BroadcastNotification( ECalenNotifyCalendarFieldChanged );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   331
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   332
    if( retValue == EAknCmdExit ||
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   333
        retValue == EKeyEscape )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   334
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   335
        // iController.IssueCommandL( EAknCmdExit );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   336
        // FIX ME ::
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   337
        // Issuing the command from here will not exit the application properly
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   338
        // because aknviewappui is not exited
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   339
        // Calling ProcessCommandL of aknviewappui will exits the application
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   340
        iController.AppUi().ProcessCommandL(EAknCmdExit);
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   341
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   342
    else if(retValue == EAknSoftkeyExit)
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   343
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   344
        // iController.IssueCommandL( EAknCmdExit );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   345
        // FIX ME ::
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   346
        // Issuing the command from here will not exit the application properly
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   347
        // because aknviewappui is not exited
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   348
        // Calling ProcessCommandL of aknviewappui will exits the application
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   349
        iController.AppUi().ProcessCommandL(EAknSoftkeyExit);
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   350
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   351
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   352
    TRACE_EXIT_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   353
    }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   354
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   355
// ----------------------------------------------------------------------------
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   356
// CCalenActionUi::ShowSettingsL
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   357
// Shows the settings dialog
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   358
// (other items were commented in a header).
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   359
// ----------------------------------------------------------------------------
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
//
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   361
void CCalenActionUi::ShowSettingsL()
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   362
    {
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   363
    TRACE_ENTRY_POINT;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   364
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   365
    // Create settings own titlepane and navipane, and swap with existing ones
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   366
    CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   367
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   368
    // Titlepane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   369
    CAknTitlePane* newtp = new( ELeave ) CAknTitlePane();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   370
    CleanupStack::PushL( newtp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   371
    CCoeControl* oldtp = sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), newtp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   372
    CleanupStack::Pop( newtp ); // ownership is passed to statuspane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   373
    TRect oldRect( 0, 0, 0, 0 );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   374
    if( oldtp )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   375
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   376
        CleanupStack::PushL( oldtp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   377
        oldRect = oldtp->Rect();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   378
        CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidTitle ));
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   379
        newtp->SetContainerWindowL( *ctrl );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   380
        newtp->ConstructL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   381
        newtp->SetRect(oldRect);
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   382
        newtp->ActivateL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   383
        }        
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   384
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   385
    // NaviPane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   386
    CAknNavigationControlContainer* newnp = new( ELeave )CAknNavigationControlContainer();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   387
    CleanupStack::PushL( newnp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   388
    CCoeControl* oldnp = sp->SwapControlL( TUid::Uid( EEikStatusPaneUidNavi ), newnp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   389
    CleanupStack::Pop( newnp ); // ownership is passed to statuspane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   390
    if( oldnp )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   391
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   392
        CleanupStack::PushL( oldnp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   393
        oldRect = oldnp->Rect();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   394
        CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidNavi ) );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   395
        newnp->SetContainerWindowL( *ctrl );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   396
        newnp->ConstructL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   397
        newnp->SetRect( oldRect );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   398
        newnp->PushDefaultL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   399
        newnp->ActivateL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   400
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   401
        
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   402
    // Hide the toolbar before we display settings menu
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   403
    MCalenToolbar* toolbar = iController.Services().ToolbarOrNull();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   404
    if(toolbar)
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   405
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   406
        toolbar->SetToolbarVisibilityL(EFalse);  
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   407
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   408
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   409
    // defer settings notifications before launching the settings  
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   410
    CCalenNotifier& notifier = iController.Notifier();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   411
    notifier.DeferSettingsNotifications();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   412
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   413
    CCalenSettingsUi* dlg = CCalenSettingsUi::NewL(iController.CustomisationManager());
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   414
    TInt retValue = KErrNone;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   415
    // Trap showing settings so settings watcher is always resumed.
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   416
    PIM_TRAPD_HANDLE( retValue = dlg->ExecuteLD( R_CALEN_SETTING_DIALOG ) );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   417
    notifier.ResumeSettingsNotifications();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   418
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   419
    // Unhide the toolbar when settings is closed
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   420
    TUid activeViewUid = iController.ViewManager().CurrentView();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   421
    if(toolbar && (activeViewUid != KUidCalenMissedAlarmsView ) &&(activeViewUid != KUidCalenMissedEventView ) )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   422
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   423
        toolbar->SetToolbarVisibilityL(ETrue); 
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   424
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   425
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   426
    // When setting is closed, swap back old titlepane and navipane
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   427
    if( oldnp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidNavi), oldnp ) )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   428
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   429
        CleanupStack::Pop( oldnp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   430
        delete newnp;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   431
        oldnp->ActivateL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   432
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   433
    if( oldtp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), oldtp ) )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   434
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   435
        CleanupStack::Pop( oldtp );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   436
        delete newtp;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   437
        oldtp->ActivateL();
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   438
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   439
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   440
    iController.BroadcastNotification( ECalenNotifySettingsClosed );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   441
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   442
      if( retValue == EAknCmdExit ||
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   443
        retValue == EKeyEscape )
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   444
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   445
        // iController.IssueCommandL( EAknCmdExit );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   446
        // FIX ME ::
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   447
        // Issuing the command from here will not exit the application properly
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   448
        // because aknviewappui is not exited
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   449
        // Calling ProcessCommandL of aknviewappui will exits the application
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   450
        iController.AppUi().ProcessCommandL(EAknCmdExit);
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   451
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   452
    else if(retValue == EAknSoftkeyExit)
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   453
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   454
        // iController.IssueCommandL( EAknCmdExit );
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   455
        // FIX ME ::
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   456
        // Issuing the command from here will not exit the application properly
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   457
        // because aknviewappui is not exited
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   458
        // Calling ProcessCommandL of aknviewappui will exits the application
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   459
        iController.AppUi().ProcessCommandL(EAknSoftkeyExit);
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   460
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   461
    
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   462
    TRACE_EXIT_POINT;
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
    }
66
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   464
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   465
// -----------------------------------------------------------------------------
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   466
// CCalenActionUi::IsEditorActive
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   467
// Tells framework whether editor is active or not
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   468
// -----------------------------------------------------------------------------
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   469
//
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   470
TBool CCalenActionUi::IsEditorActive()
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   471
    {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   472
    if(iEditUi)
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   473
        {
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   474
        return(iEditUi->IsEditorActive());
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   475
        }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   476
    else
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   477
        return EFalse;
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   478
    }
bd7edf625bdd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
   479
0
f979ecb2b13e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
// End of file