commands/opendoc/opendoc.cpp
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // opendoc.cpp
       
     2 // 
       
     3 // Copyright (c) 2007 - 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // 
       
     9 // Initial Contributors:
       
    10 // Accenture - Initial contribution
       
    11 //
       
    12 
       
    13 #include <apgcli.h>
       
    14 #include <apasvst.h>
       
    15 #include "opendoc.h"
       
    16 
       
    17 
       
    18 CCommandBase* CCmdOpenDoc::NewLC()
       
    19 	{
       
    20 	CCmdOpenDoc* self = new(ELeave) CCmdOpenDoc();
       
    21 	CleanupStack::PushL(self);
       
    22 	self->BaseConstructL();
       
    23 	return self;
       
    24 	}
       
    25 
       
    26 CCmdOpenDoc::~CCmdOpenDoc()
       
    27 	{
       
    28 	}
       
    29 
       
    30 CCmdOpenDoc::CCmdOpenDoc()
       
    31 	{
       
    32 	}
       
    33 
       
    34 const TDesC& CCmdOpenDoc::Name() const
       
    35 	{
       
    36 	_LIT(KName, "opendoc");
       
    37 	return KName;
       
    38 	}
       
    39 
       
    40 void CCmdOpenDoc::DoRunL()
       
    41 	{
       
    42 	RApaLsSession lsSession;
       
    43 	LeaveIfErr(lsSession.Connect(), _L("Couldn't connect to AppArc"));
       
    44 	CleanupClosePushL(lsSession);
       
    45 	TThreadId threadId;
       
    46 	LeaveIfErr(lsSession.StartDocument(iFileName, threadId), _L("Couldn't open document"));
       
    47 	CleanupStack::PopAndDestroy(&lsSession);
       
    48 	}
       
    49 
       
    50 void CCmdOpenDoc::ArgumentsL(RCommandArgumentList& aArguments)
       
    51 	{
       
    52 	_LIT(KArgFileName, "file_name");
       
    53 	aArguments.AppendFileNameL(iFileName, KArgFileName);
       
    54 	}
       
    55 
       
    56 
       
    57 #ifdef EXE_BUILD
       
    58 EXE_BOILER_PLATE(CCmdOpenDoc)
       
    59 #endif
       
    60