~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/plugins/contrib/ThreadSearch/ThreadSearchLoggerList.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************
 
2
 * Name:      ThreadSearchLoggerList
 
3
 * Purpose:   ThreadSearchLoggerList implements the
 
4
 *            ThreadSearchLoggerBase with a wxListCtrl.
 
5
 * Author:    Jerome ANTOINE
 
6
 * Created:   2007-07-28
 
7
 * Copyright: Jerome ANTOINE
 
8
 * License:   GPL
 
9
 **************************************************************/
 
10
 
 
11
#ifndef THREAD_SEARCH_LOGGER_LIST_H
 
12
#define THREAD_SEARCH_LOGGER_LIST_H
 
13
 
 
14
#include <wx/event.h>
 
15
 
 
16
#include "ThreadSearchLoggerBase.h"
 
17
 
 
18
class wxPanel;
 
19
class wxWindow;
 
20
class wxListEvent;
 
21
class wxListCtrl;
 
22
class wxString;
 
23
 
 
24
class ThreadSearch;
 
25
class ThreadSearchView;
 
26
class ThreadSearchEvent;
 
27
 
 
28
class ThreadSearchLoggerList : public wxEvtHandler, public ThreadSearchLoggerBase
 
29
{
 
30
public:
 
31
        /** Constructor. */
 
32
        ThreadSearchLoggerList(ThreadSearchView& threadSearchView, ThreadSearch& threadSearchPlugin,
 
33
                                                        InsertIndexManager::eFileSorting fileSorting, wxPanel* pParent, long id);
 
34
 
 
35
        /** Destructor. */
 
36
        virtual ~ThreadSearchLoggerList();
 
37
 
 
38
        /** Getter */
 
39
        virtual eLoggerTypes GetLoggerType() {return TypeList;}
 
40
 
 
41
        /** Called by ThreadSearchView when new settings are applied. */
 
42
        virtual void Update();
 
43
 
 
44
        /** Called by ThreadSearchView to process a ThreadSearchEvent
 
45
          * sent by worker thread.
 
46
          */
 
47
        virtual void OnThreadSearchEvent(const ThreadSearchEvent& event);
 
48
 
 
49
        /** Removes all items from logger. */
 
50
        virtual void Clear();
 
51
 
 
52
        /** Returns the logger window. */
 
53
        virtual wxWindow* GetWindow();
 
54
 
 
55
        /** Sets focus on list window. */
 
56
        virtual void SetFocus();
 
57
 
 
58
        /** Single click event handler */
 
59
        void OnLoggerListClick(wxListEvent& event);
 
60
 
 
61
        /** Double click event handler */
 
62
        void OnLoggerListDoubleClick(wxListEvent& event);
 
63
 
 
64
protected:
 
65
        /** SetListColumns
 
66
          * The SimpleListLog constructor does not set the provided columns on Linux.
 
67
          * It is necessary to set columns after the ThreadSearchLoggerList constructor.
 
68
          */
 
69
        void SetListColumns();
 
70
 
 
71
        /** GetFileLineFromListEvent
 
72
          * Return the file path at index from the list control using dir and file columns.
 
73
          * @param event    : list control event
 
74
          * @param filepath : reference that will receive the path
 
75
          * @param line     : reference that will receive the line index
 
76
          * @return true if successful.
 
77
          */
 
78
        bool GetFileLineFromListEvent(wxListEvent& event, wxString& filepath, long &line);
 
79
 
 
80
        /** Dynamic events connection. */
 
81
        virtual void ConnectEvents(wxEvtHandler* pEvtHandler);
 
82
 
 
83
        /** Dynamic events disconnection. */
 
84
        virtual void DisconnectEvents(wxEvtHandler* pEvtHandler);
 
85
 
 
86
        wxListCtrl* m_pListLog;
 
87
};
 
88
 
 
89
#endif // THREAD_SEARCH_LOGGER_LIST_H