commands/sms/sms.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // sms.h
       
     2 // 
       
     3 // Copyright (c) 2008 - 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 #ifndef __SMS_H__
       
    14 #define __SMS_H__
       
    15 
       
    16 #include <fshell/ioutils.h>
       
    17 #include "smswatch.h"
       
    18 #include "smssend.h"
       
    19 
       
    20 using namespace IoUtils;
       
    21 
       
    22 NONSHARABLE_CLASS(CCmdSms) : public CCommandBase, public MSmsSendObserver
       
    23 	{
       
    24 public:
       
    25 	static CCmdSms* NewLC();
       
    26 	~CCmdSms();
       
    27 
       
    28 	// Functions for helper objects
       
    29 	using CCommandBase::Fs;
       
    30 	using CCommandBase::Printf;
       
    31 	using CCommandBase::PrintError;
       
    32 	using CCommandBase::IoSession;
       
    33 	using CCommandBase::Stdin;
       
    34 	using CCommandBase::Stdout;
       
    35 	using CCommandBase::Stderr;
       
    36 	TBool Debug() const { return iDebug; }
       
    37 	RPointerArray<HBufC>& MatchStrings() { return iMatchStrings; }
       
    38 		
       
    39 
       
    40 private:
       
    41 	CCmdSms();
       
    42 	static TInt CompletionCallBack(TAny* aEvent);
       
    43 	void Cleanup();
       
    44 	
       
    45 	// From CCommandBase.
       
    46 	virtual const TDesC& Name() const;
       
    47 	virtual void DoRunL();
       
    48 	virtual void ArgumentsL(RCommandArgumentList& aArguments);
       
    49 	virtual void OptionsL(RCommandOptionList& aOptions);
       
    50 	
       
    51 	// From MSmsListenerObserver
       
    52 	virtual void EventsFinished(const TInt aError);
       
    53 	
       
    54 	// From MSmsSendObserver
       
    55 	virtual void SendComplete(const TInt aError);
       
    56 	
       
    57 private:
       
    58 	CAsyncCallBack* iCompletionCallBack;
       
    59 	CSmsWatcher* iWatch;
       
    60 	CSmsSender* iSendMsg;
       
    61 	TInt iCompletionError;
       
    62 	enum 
       
    63 		{
       
    64 		ESend, EReceive
       
    65 		} iOperation;
       
    66 	TBool iAutometricSms;
       
    67 	HBufC* iMsgToSend;
       
    68 	HBufC* iDestination;
       
    69 	RPointerArray<HBufC> iMatchStrings;
       
    70 	TBool iDebug;
       
    71 	CTextBuffer* iMessageFromStdin;
       
    72 	};
       
    73 
       
    74 #endif // __SMS_H__