~ubuntu-branches/ubuntu/wily/codelite/wily

« back to all changes in this revision

Viewing changes to LiteEditor/clang_code_completion.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-07-29 19:42:47 UTC
  • mfrom: (0.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100729194247-hqgxamd2yl8f1l7x
* New upstream release.
* Bump Standards.
* Refresh patches.
* Add license information about files under ./Debugger/

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CLANGCODECOMPLETION_H
 
2
#define CLANGCODECOMPLETION_H
 
3
 
 
4
#include <wx/event.h>
 
5
#include "asyncprocess.h"
 
6
#include <map>
 
7
#include "entry.h"
 
8
 
 
9
class IEditor;
 
10
class IManager;
 
11
 
 
12
/**
 
13
 * @class ClangCodeCompletion
 
14
 * @author eran
 
15
 * @date 07/18/10
 
16
 * @file clang_code_completion.h
 
17
 * @brief codelite's interface to clang's code completion
 
18
 */
 
19
class ClangCodeCompletion : public wxEvtHandler
 
20
{
 
21
 
 
22
        static ClangCodeCompletion* ms_instance;
 
23
        IManager *                  m_manager;
 
24
        IProcess*                   m_process;
 
25
        wxString                    m_output;
 
26
        wxString                    m_tmpfile;
 
27
        std::map<wxString,wxString> m_backticks;
 
28
        int                         m_activationPos;
 
29
        IEditor*                    m_activationEditor;
 
30
        
 
31
public:
 
32
        static ClangCodeCompletion* Instance();
 
33
        static void Release();
 
34
        void Initialize(IManager *manager);
 
35
        /**
 
36
         * @brief perform code completion
 
37
         * @param editor
 
38
         */
 
39
        void CodeComplete(IEditor *editor);
 
40
        void CancelCodeComplete();
 
41
        
 
42
protected:
 
43
        wxArrayString GetStandardIncludePathsArgs();
 
44
        void DoParseOutput();
 
45
        void DoCleanUp();
 
46
        TagEntryPtr ClangEntryToTagEntry(const wxString &line);
 
47
        
 
48
protected:
 
49
        DECLARE_EVENT_TABLE()
 
50
        void OnProcessTerminated(wxCommandEvent &e);
 
51
        void OnProcessOutput    (wxCommandEvent &e);
 
52
 
 
53
private:
 
54
        ClangCodeCompletion();
 
55
        ~ClangCodeCompletion();
 
56
};
 
57
 
 
58
#endif // CLANGCODECOMPLETION_H