DirectPrint/DirectPrintApp/ui/src/directprintviewbase.cpp
author Steven Cao <steven.1.cao@nokia.com>
Tue, 11 May 2010 14:10:02 +0800
changeset 19 2275db202402
parent 11 613a5ff70823
permissions -rw-r--r--
Pickup K3's code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
     1
/*
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
     2
* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
     3
* All rights reserved.
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
     4
* This component and the accompanying materials are made available
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
     6
* which accompanies this distribution, and is available
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
     8
*
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
     9
* Initial Contributors:
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    10
* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    11
*
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    12
* Contributors:
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    13
*
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    14
* Description:
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    15
*
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    16
*/
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    17
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    18
#include <aknviewappui.h>
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    19
#include <barsread.h>
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    20
#include <akntitle.h>
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    21
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    22
#include "directprintviewbase.h"
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    23
#include "directprintappappui.h"
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    24
#include "directprintappdocument.h"
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    25
#include "directprintmodel.h"
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    26
#include "directprintuipluginmgr.h"
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    27
#include "directprintengine.h"
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    28
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    29
CDirectPrintViewBase::CDirectPrintViewBase()
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    30
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    31
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    32
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    33
CDirectPrintViewBase::~CDirectPrintViewBase()
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    34
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    35
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    36
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    37
void CDirectPrintViewBase::ConstructL()
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    38
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    39
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    40
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    41
TUid CDirectPrintViewBase::Id() const
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    42
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    43
	return iViewId;
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    44
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    45
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    46
void CDirectPrintViewBase::HandleListIndexL(TInt /*aIndex*/)
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    47
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    48
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    49
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    50
void CDirectPrintViewBase::HandleEditItemL(TInt /*aIndex*/, TBool /*aChanged*/)
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    51
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    52
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    53
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    54
void CDirectPrintViewBase::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    55
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    56
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    57
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    58
void CDirectPrintViewBase::DoDeactivate()
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    59
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    60
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    61
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    62
void CDirectPrintViewBase::SetActiveTitleL(TInt aTitleResId)
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    63
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    64
	TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    65
	CEikStatusPaneBase::TPaneCapabilities subPaneTitle = 
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    66
		StatusPane()->PaneCapabilities( titlePaneUid );
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    67
	if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    68
		{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    69
		CAknTitlePane* title = static_cast< CAknTitlePane* >( 
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    70
			StatusPane()->ControlL( titlePaneUid ) );
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    71
		TResourceReader reader;
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    72
		iEikonEnv->CreateResourceReaderLC( reader, aTitleResId );
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    73
		title->SetFromResourceL( reader );
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    74
		CleanupStack::PopAndDestroy(); // reader internal state
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    75
		}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    76
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    77
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    78
CDirectPrintModel& CDirectPrintViewBase::GetModel()
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    79
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    80
	return (static_cast<CDirectPrintAppAppUi*>(AppUi()))->Doc()->Model();
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    81
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    82
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    83
CDirectPrintUiPluginMgr& CDirectPrintViewBase::GetPluginMgr()
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    84
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    85
	return (static_cast<CDirectPrintAppAppUi*>(AppUi()))->PluginMgr();
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    86
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    87
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    88
CDirectPrintEngine& CDirectPrintViewBase::GetEngine()
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    89
	{
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    90
	return *((static_cast<CDirectPrintAppAppUi*>(AppUi()))->Engine());
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    91
	}
2275db202402 Pickup K3's code
Steven Cao <steven.1.cao@nokia.com>
parents: 11
diff changeset
    92