messagingfw/senduiservices/launcher/src/senduilauncherapp.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 25 May 2010 13:13:43 +0300
branchRCL_3
changeset 20 c540a10963a1
parent 0 8e480a14352b
permissions -rw-r--r--
Revision: 201019 Kit: 2010121

/*
* Copyright (c) 2006 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:   Server application for launching SendUi with low 
*                capability requirements.
*
*/



#include "senduilauncherdoc.h"
#include "senduilauncherapp.h"
#include "senduilauncherappui.h"
#include "senduiservice.h"
#include "senduiserviceclient.h"
#include "senduiserviceslog.h"
#include <SendUiConsts.h>
#include "senduilauncher.h"

// ---------------------------------------------------------------------------
// Creates SendUiService or pass service request to the framework
// ---------------------------------------------------------------------------
//
class CSendUiServer : public CAknAppServer
    {
    public:
    
    CApaAppServiceBase* CreateServiceL( TUid aServiceType ) const
        {
        if( aServiceType.iUid == KSendUiLauncherAppServiceUid.iUid )
            {
            return CSendUiService::NewL();
            }
        else
            {
            return CAknAppServer::CreateServiceL( aServiceType );
            }
        }
    };

// ======== LOCAL FUNCTIONS ========

// ---------------------------------------------------------------------------
// Constructs and returns an application object.
// ---------------------------------------------------------------------------
//
CApaDocument* CSendUiLauncherApplication::CreateDocumentL()
    {  
    // Create an SendUiServer document, and return a pointer to it
    CApaDocument* document = CSendUiLauncherDocument::NewL(*this);
    return document;
    }

// ---------------------------------------------------------------------------
// AppDllUid
// Return application Uid
// ---------------------------------------------------------------------------
//
TUid CSendUiLauncherApplication::AppDllUid() const
    {
    // Return the UID for the SendUiServer application
    return KSendUiLauncherAppUid;
    }

// ---------------------------------------------------------------------------
// NewAppServerL
// Returns new CSendUIServer object for the framework
// ---------------------------------------------------------------------------
//
void CSendUiLauncherApplication::NewAppServerL( CApaAppServer* & aAppServer )
    {
    aAppServer = new(ELeave)CSendUiServer;
    }