~ubuntu-branches/ubuntu/karmic/codelite/karmic-backports

« back to all changes in this revision

Viewing changes to CodeLite/tags_options_data.h

  • Committer: Bazaar Package Importer
  • Author(s): Ubuntu Archive Backport
  • Date: 2010-03-10 00:42:25 UTC
  • mfrom: (10.1.3 lucid)
  • Revision ID: james.westby@ubuntu.com-20100310004225-ccjgjj2vvdy4q7qs
Tags: 2.2.0.3681+dfsg-0ubuntu1~karmic1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//////////////////////////////////////////////////////////////////////////////
2
 
//////////////////////////////////////////////////////////////////////////////
3
 
//
4
 
// copyright            : (C) 2008 by Eran Ifrah
5
 
// file name            : tags_options_data.h
6
 
//
7
 
// -------------------------------------------------------------------------
8
 
// A
9
 
//              _____           _      _     _ _
10
 
//             /  __ \         | |    | |   (_) |
11
 
//             | /  \/ ___   __| | ___| |    _| |_ ___
12
 
//             | |    / _ \ / _  |/ _ \ |   | | __/ _ )
13
 
//             | \__/\ (_) | (_| |  __/ |___| | ||  __/
14
 
//              \____/\___/ \__,_|\___\_____/_|\__\___|
15
 
//
16
 
//                                                  F i l e
17
 
//
18
 
//    This program is free software; you can redistribute it and/or modify
19
 
//    it under the terms of the GNU General Public License as published by
20
 
//    the Free Software Foundation; either version 2 of the License, or
21
 
//    (at your option) any later version.
22
 
//
23
 
//////////////////////////////////////////////////////////////////////////////
24
 
//////////////////////////////////////////////////////////////////////////////
25
 
#ifndef TAGS_OPTIONS_DATA_H
26
 
#define TAGS_OPTIONS_DATA_H
27
 
 
28
 
#include "serialized_object.h"
29
 
#include "wx/filename.h"
30
 
#include <map>
31
 
 
32
 
enum CodeCompletionOpts {
33
 
        CC_PARSE_COMMENTS             = 0x00000001,
34
 
        CC_DISP_COMMENTS              = 0x00000002,
35
 
        CC_DISP_TYPE_INFO             = 0x00000004,
36
 
        CC_DISP_FUNC_CALLTIP          = 0x00000008,
37
 
        CC_LOAD_EXT_DB                = 0x00000010,
38
 
        CC_LOAD_EXT_DB_TO_MEMORY      = 0x00000020,
39
 
        CC_PARSE_EXT_LESS_FILES       = 0x00000040,
40
 
        CC_COLOUR_VARS                = 0x00000080,
41
 
        CC_COLOUR_WORKSPACE_TAGS      = 0x00000100,
42
 
        CC_CPP_KEYWORD_ASISST         = 0x00000200,
43
 
        CC_CACHE_WORKSPACE_TAGS       = 0x00000400,
44
 
        CC_DISABLE_AUTO_PARSING       = 0x00000800,
45
 
        CC_MARK_TAGS_FILES_IN_BOLD    = 0x00001000,
46
 
        CC_USE_FULL_RETAGGING         = 0x00002000,
47
 
        CC_RETAG_WORKSPACE_ON_STARTUP = 0x00004000,
48
 
        CC_ACCURATE_SCOPE_RESOLVING   = 0x00008000
49
 
};
50
 
 
51
 
enum CodeCompletionColourOpts {
52
 
        CC_COLOUR_CLASS             = 0x00000001,
53
 
        CC_COLOUR_STRUCT            = 0x00000002,
54
 
        CC_COLOUR_FUNCTION          = 0x00000004,
55
 
        CC_COLOUR_ENUM              = 0x00000008,
56
 
        CC_COLOUR_UNION             = 0x00000010,
57
 
        CC_COLOUR_PROTOTYPE         = 0x00000020,
58
 
        CC_COLOUR_TYPEDEF           = 0x00000040,
59
 
        CC_COLOUR_MACRO             = 0x00000080,
60
 
        CC_COLOUR_NAMESPACE         = 0x00000100,
61
 
        CC_COLOUR_ENUMERATOR        = 0x00000200,
62
 
        CC_COLOUR_VARIABLE          = 0x00000400,
63
 
        CC_COLOUR_MEMBER            = 0x00000800,
64
 
        CC_COLOUR_DEFAULT           = CC_COLOUR_CLASS | CC_COLOUR_STRUCT | CC_COLOUR_FUNCTION |
65
 
                                                                        CC_COLOUR_ENUM | CC_COLOUR_PROTOTYPE
66
 
};
67
 
 
68
 
class TagsOptionsData : public SerializedObject
69
 
{
70
 
        size_t m_ccFlags;
71
 
        size_t m_ccColourFlags;
72
 
 
73
 
        wxArrayString m_prep;
74
 
        wxString m_fileSpec;
75
 
        wxArrayString m_languages;
76
 
        int m_minWordLen;
77
 
 
78
 
public:
79
 
        TagsOptionsData();
80
 
        virtual ~TagsOptionsData();
81
 
 
82
 
        //setters/getters
83
 
        void SetFlags(const size_t &flags) {
84
 
                m_ccFlags = flags;
85
 
        }
86
 
        void SetFileSpec(const wxString &filespec) {
87
 
                m_fileSpec = filespec;
88
 
        }
89
 
        void SetPreprocessor(const wxArrayString& prep) {
90
 
                m_prep = prep;
91
 
        }
92
 
        void SetLanguages(const wxArrayString &langs) {
93
 
                m_languages = langs;
94
 
        }
95
 
        void SetLanguageSelection(const wxString &lang);
96
 
 
97
 
        const wxArrayString &GetLanguages() const {
98
 
                return m_languages;
99
 
        }
100
 
        const wxArrayString& GetPreprocessor() const {
101
 
                return m_prep;
102
 
        }
103
 
        std::map<std::string, std::string> GetPreprocessorAsMap() const;
104
 
        std::map<wxString, wxString> GetPreprocessorAsWxMap() const;
105
 
 
106
 
        const size_t& GetFlags() const {
107
 
                return m_ccFlags;
108
 
        }
109
 
        const wxString &GetFileSpec() const {
110
 
                return m_fileSpec;
111
 
        }
112
 
 
113
 
        //Setters
114
 
        void SetMinWordLen(const int& minWordLen) {
115
 
                this->m_minWordLen = minWordLen;
116
 
        }
117
 
        //Getters
118
 
        const int& GetMinWordLen() const {
119
 
                return m_minWordLen;
120
 
        }
121
 
 
122
 
        //Serialization API
123
 
        void Serialize(Archive &arch);
124
 
        void DeSerialize(Archive &arch);
125
 
 
126
 
        wxString ToString() const;
127
 
 
128
 
        void SetCcColourFlags(const size_t& ccColourFlags) {
129
 
                this->m_ccColourFlags = ccColourFlags;
130
 
        }
131
 
 
132
 
        const size_t& GetCcColourFlags() const {
133
 
                return m_ccColourFlags;
134
 
        }
135
 
};
136
 
 
137
 
#endif //TAGS_OPTIONS_DATA_H
 
1
//////////////////////////////////////////////////////////////////////////////
 
2
//////////////////////////////////////////////////////////////////////////////
 
3
//
 
4
// copyright            : (C) 2008 by Eran Ifrah
 
5
// file name            : tags_options_data.h
 
6
//
 
7
// -------------------------------------------------------------------------
 
8
// A
 
9
//              _____           _      _     _ _
 
10
//             /  __ \         | |    | |   (_) |
 
11
//             | /  \/ ___   __| | ___| |    _| |_ ___
 
12
//             | |    / _ \ / _  |/ _ \ |   | | __/ _ )
 
13
//             | \__/\ (_) | (_| |  __/ |___| | ||  __/
 
14
//              \____/\___/ \__,_|\___\_____/_|\__\___|
 
15
//
 
16
//                                                  F i l e
 
17
//
 
18
//    This program is free software; you can redistribute it and/or modify
 
19
//    it under the terms of the GNU General Public License as published by
 
20
//    the Free Software Foundation; either version 2 of the License, or
 
21
//    (at your option) any later version.
 
22
//
 
23
//////////////////////////////////////////////////////////////////////////////
 
24
//////////////////////////////////////////////////////////////////////////////
 
25
#ifndef TAGS_OPTIONS_DATA_H
 
26
#define TAGS_OPTIONS_DATA_H
 
27
 
 
28
#include "serialized_object.h"
 
29
#include "wx/filename.h"
 
30
#include <map>
 
31
 
 
32
enum CodeCompletionOpts {
 
33
        CC_PARSE_COMMENTS             = 0x00000001,
 
34
        CC_DISP_COMMENTS              = 0x00000002,
 
35
        CC_DISP_TYPE_INFO             = 0x00000004,
 
36
        CC_DISP_FUNC_CALLTIP          = 0x00000008,
 
37
        CC_LOAD_EXT_DB                = 0x00000010,
 
38
        CC_PARSE_EXT_LESS_FILES       = 0x00000040,
 
39
        CC_COLOUR_VARS                = 0x00000080,
 
40
        CC_COLOUR_WORKSPACE_TAGS      = 0x00000100,
 
41
        CC_CPP_KEYWORD_ASISST         = 0x00000200,
 
42
        CC_DISABLE_AUTO_PARSING       = 0x00000800,
 
43
        CC_MARK_TAGS_FILES_IN_BOLD    = 0x00001000,
 
44
//      CC_USE_FULL_RETAGGING         = 0x00002000,
 
45
        CC_RETAG_WORKSPACE_ON_STARTUP = 0x00004000,
 
46
        CC_ACCURATE_SCOPE_RESOLVING   = 0x00008000
 
47
};
 
48
 
 
49
enum CodeCompletionColourOpts {
 
50
        CC_COLOUR_CLASS             = 0x00000001,
 
51
        CC_COLOUR_STRUCT            = 0x00000002,
 
52
        CC_COLOUR_FUNCTION          = 0x00000004,
 
53
        CC_COLOUR_ENUM              = 0x00000008,
 
54
        CC_COLOUR_UNION             = 0x00000010,
 
55
        CC_COLOUR_PROTOTYPE         = 0x00000020,
 
56
        CC_COLOUR_TYPEDEF           = 0x00000040,
 
57
        CC_COLOUR_MACRO             = 0x00000080,
 
58
        CC_COLOUR_NAMESPACE         = 0x00000100,
 
59
        CC_COLOUR_ENUMERATOR        = 0x00000200,
 
60
        CC_COLOUR_VARIABLE          = 0x00000400,
 
61
        CC_COLOUR_MEMBER            = 0x00000800,
 
62
        CC_COLOUR_ALL               = CC_COLOUR_CLASS | CC_COLOUR_STRUCT | CC_COLOUR_FUNCTION |
 
63
        CC_COLOUR_ENUM | CC_COLOUR_UNION | CC_COLOUR_PROTOTYPE | CC_COLOUR_TYPEDEF | CC_COLOUR_MACRO |
 
64
        CC_COLOUR_NAMESPACE | CC_COLOUR_ENUMERATOR | CC_COLOUR_VARIABLE | CC_COLOUR_MEMBER,
 
65
        CC_COLOUR_DEFAULT           = CC_COLOUR_CLASS | CC_COLOUR_STRUCT | CC_COLOUR_FUNCTION |
 
66
        CC_COLOUR_ENUM | CC_COLOUR_PROTOTYPE
 
67
};
 
68
 
 
69
class TagsOptionsData : public SerializedObject
 
70
{
 
71
        size_t           m_ccFlags;
 
72
        size_t           m_ccColourFlags;
 
73
        wxArrayString    m_prep;
 
74
        wxString         m_fileSpec;
 
75
        wxArrayString    m_languages;
 
76
        int              m_minWordLen;
 
77
        wxArrayString    m_parserSearchPaths;
 
78
        wxArrayString    m_parserExcludePaths;
 
79
        bool             m_parserEnabled;
 
80
        int              m_maxItemToColour;
 
81
public:
 
82
        TagsOptionsData();
 
83
        virtual ~TagsOptionsData();
 
84
 
 
85
        //setters/getters
 
86
        void SetFlags(const size_t &flags) {
 
87
                m_ccFlags = flags;
 
88
        }
 
89
        void SetFileSpec(const wxString &filespec) {
 
90
                m_fileSpec = filespec;
 
91
        }
 
92
        void SetPreprocessor(const wxArrayString& prep) {
 
93
                m_prep = prep;
 
94
        }
 
95
        void SetLanguages(const wxArrayString &langs) {
 
96
                m_languages = langs;
 
97
        }
 
98
        void SetLanguageSelection(const wxString &lang);
 
99
 
 
100
        const wxArrayString &GetLanguages() const {
 
101
                return m_languages;
 
102
        }
 
103
        const wxArrayString& GetPreprocessor() const {
 
104
                return m_prep;
 
105
        }
 
106
        std::map<std::string, std::string> GetPreprocessorAsMap() const;
 
107
        std::map<wxString, wxString> GetPreprocessorAsWxMap() const;
 
108
 
 
109
        const size_t& GetFlags() const {
 
110
                return m_ccFlags;
 
111
        }
 
112
        const wxString &GetFileSpec() const {
 
113
                return m_fileSpec;
 
114
        }
 
115
 
 
116
        //Setters
 
117
        void SetMinWordLen(const int& minWordLen) {
 
118
                this->m_minWordLen = minWordLen;
 
119
        }
 
120
        //Getters
 
121
        const int& GetMinWordLen() const {
 
122
                return m_minWordLen;
 
123
        }
 
124
 
 
125
        //Serialization API
 
126
        void Serialize(Archive &arch);
 
127
        void DeSerialize(Archive &arch);
 
128
 
 
129
        wxString ToString() const;
 
130
 
 
131
        void SetCcColourFlags(const size_t& ccColourFlags) {
 
132
                this->m_ccColourFlags = ccColourFlags;
 
133
        }
 
134
 
 
135
        const size_t& GetCcColourFlags() const {
 
136
                return m_ccColourFlags;
 
137
        }
 
138
        void SetParserEnabled(const bool& parserEnabled) {
 
139
                this->m_parserEnabled = parserEnabled;
 
140
        }
 
141
        void SetParserSearchPaths(const wxArrayString& parserSearchPaths) {
 
142
                this->m_parserSearchPaths = parserSearchPaths;
 
143
        }
 
144
        const bool& GetParserEnabled() const {
 
145
                return m_parserEnabled;
 
146
        }
 
147
        const wxArrayString& GetParserSearchPaths() const {
 
148
                return m_parserSearchPaths;
 
149
        }
 
150
        void SetParserExcludePaths(const wxArrayString& parserExcludePaths) {
 
151
                this->m_parserExcludePaths = parserExcludePaths;
 
152
        }
 
153
        const wxArrayString& GetParserExcludePaths() const {
 
154
                return m_parserExcludePaths;
 
155
        }
 
156
        void SetMaxItemToColour(int maxItemToColour) {
 
157
                this->m_maxItemToColour = maxItemToColour;
 
158
        }
 
159
        int GetMaxItemToColour() const {
 
160
                return m_maxItemToColour;
 
161
        }
 
162
};
 
163
 
 
164
#endif //TAGS_OPTIONS_DATA_H