core/src/line_completer.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // line_completer.h
       
     2 // 
       
     3 // Copyright (c) 2006 - 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 
       
    14 #ifndef __LINE_COMPLETER_H__
       
    15 #define __LINE_COMPLETER_H__
       
    16 
       
    17 #include <e32base.h>
       
    18 #include <fshell/line_editor.h>
       
    19 
       
    20 class RFs;
       
    21 class TToken;
       
    22 class TConsoleLine;
       
    23 class CLexer;
       
    24 class CTextBuffer;
       
    25 class CCommandFactory;
       
    26 namespace IoUtils
       
    27 	{
       
    28 	class CCommandInfoFile;
       
    29 	}
       
    30 
       
    31 class CLineCompleter : public CBase, public MLineCompleter
       
    32 	{
       
    33 public:
       
    34 	static CLineCompleter* NewL(RFs& aFs, CCommandFactory& aCommandFactory, IoUtils::CEnvironment& aEnv);
       
    35 	~CLineCompleter();
       
    36 private: // From MLineCompleter.
       
    37 	virtual void LcCompleteLineL(TConsoleLine& aLine, const TChar& aEscapeChar);
       
    38 private:
       
    39 	CLineCompleter(RFs& aFs, CCommandFactory& aCommandFactory, IoUtils::CEnvironment& aEnv);
       
    40 	void ConstructL();
       
    41 	void CompleteCommandNameL(TConsoleLine& aLine, const TToken& aToken, const TChar& aEscapeChar) const;
       
    42 	void CompleteFileNameL(TConsoleLine& aLine, const TToken& aToken, const TChar& aEscapeChar) const;
       
    43 	void CompleteL(TConsoleLine& aLine, const TToken& aToken, const RArray<TPtrC> aPossibilities, const TDesC* aPrefix, const TDesC* aSuffix, TBool aPrefixIsPartOfToken=EFalse) const;
       
    44 	void CompleteEnvVarL(TConsoleLine& aLine, const TToken& aToken, const TChar& aEscapeChar) const;
       
    45 	void CompleteOptionL(TConsoleLine& aLine, const TToken& aToken, const TChar& aEscapeChar) const;
       
    46 
       
    47 private:
       
    48 	RFs& iFs;
       
    49 	CCommandFactory& iCommandFactory;
       
    50 	IoUtils::CEnvironment& iEnv;
       
    51 	CLexer* iLexer;
       
    52 	IoUtils::CCommandInfoFile* iLastUsedCif;
       
    53 	};
       
    54 
       
    55 
       
    56 #endif // __LINE_COMPLETER_H__