~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/include/filefilters.h

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
 
3
 * http://www.gnu.org/licenses/lgpl-3.0.html
 
4
 */
 
5
 
 
6
#ifndef FILEFILTERS_H
 
7
#define FILEFILTERS_H
 
8
 
 
9
#include <wx/string.h>
 
10
#include "settings.h"
 
11
 
 
12
/** Provides functions and constants regarding
 
13
  * file extension filters present in file dialogs
 
14
  * throughout Code::Blocks.
 
15
  */
 
16
namespace FileFilters
 
17
{
 
18
    /** @brief Adds file filters for various supported projects and workspaces. */
 
19
    DLLIMPORT void AddDefaultFileFilters();
 
20
 
 
21
    /** @brief Add a new extension filter.
 
22
      * @param name The filter's name.
 
23
      * @param mask The extension masks comma-separated string (i.e. "*.cpp,*.c").
 
24
      * @return True if added sucessfully, false if not (i.e. empty arguments).
 
25
      */
 
26
    DLLIMPORT bool Add(const wxString& name, const wxString& mask);
 
27
 
 
28
    /** @brief Generates and returns the filter string for use
 
29
      * in file dialogs.
 
30
      * @param ext If not empty, only filters matching this extension will be returned.
 
31
      * Note that @c ext *must* include the separating dot. It can be a full filename
 
32
      * if you want, but it *cannot* be just the extension (without the separating dot).
 
33
      * @return The filter string.
 
34
      */
 
35
    DLLIMPORT wxString GetFilterString(const wxString& ext = wxEmptyString);
 
36
 
 
37
    /** @brief Generates a simple special filter "All files". No other filters are added.
 
38
      * @return the "All files" filter.
 
39
      */
 
40
    DLLIMPORT wxString GetFilterAll();
 
41
 
 
42
    /** @brief Get the filter index for the special "All files" filter.
 
43
      * @return the "All files" filter index.
 
44
      */
 
45
    DLLIMPORT size_t GetIndexForFilterAll();
 
46
 
 
47
 
 
48
    /** @brief Get the Filter name for the Index-th filter in the FiltersList
 
49
      * @param FiltersList The list of Filters
 
50
      * @param Index The index in the FiltersList of the filter we want to know the name of
 
51
      * @param FilterName Receives the filters name if found
 
52
      * @return filter found : yes/no.
 
53
      */
 
54
    DLLIMPORT bool GetFilterNameFromIndex(const wxString& FiltersList, int Index, wxString& FilterName);
 
55
 
 
56
    /** @brief Get the index of the filter 'FilterName' in the FiltersList
 
57
      * @param FiltersList The list of Filters
 
58
      * @param FilterName Name of the filter we want to know the index of
 
59
      * @param Index Receives the index of the filter if found
 
60
      * @return filter found : yes/no.
 
61
      */
 
62
    DLLIMPORT bool GetFilterIndexFromName(const wxString& FiltersList, const wxString& FilterName, int& Index);
 
63
 
 
64
    // file extension constants
 
65
    // *just* the extension, e.g. "exe"
 
66
    extern const DLLIMPORT wxString WORKSPACE_EXT;
 
67
    extern const DLLIMPORT wxString CODEBLOCKS_EXT;
 
68
    extern const DLLIMPORT wxString DEVCPP_EXT;
 
69
    extern const DLLIMPORT wxString MSVC6_EXT;
 
70
    extern const DLLIMPORT wxString MSVC6_WORKSPACE_EXT;
 
71
    extern const DLLIMPORT wxString MSVC7_EXT;
 
72
    extern const DLLIMPORT wxString MSVC7_WORKSPACE_EXT;
 
73
    extern const DLLIMPORT wxString MSVC10_EXT;
 
74
    extern const DLLIMPORT wxString XCODE1_EXT;
 
75
    extern const DLLIMPORT wxString XCODE2_EXT;
 
76
    extern const DLLIMPORT wxString ASM_EXT;
 
77
    extern const DLLIMPORT wxString D_EXT;
 
78
    extern const DLLIMPORT wxString F_EXT;
 
79
    extern const DLLIMPORT wxString F77_EXT;
 
80
    extern const DLLIMPORT wxString F90_EXT;
 
81
    extern const DLLIMPORT wxString F95_EXT;
 
82
    extern const DLLIMPORT wxString FOR_EXT;
 
83
    extern const DLLIMPORT wxString FPP_EXT;
 
84
    extern const DLLIMPORT wxString F03_EXT;
 
85
    extern const DLLIMPORT wxString F08_EXT;
 
86
    extern const DLLIMPORT wxString JAVA_EXT;
 
87
    extern const DLLIMPORT wxString C_EXT;
 
88
    extern const DLLIMPORT wxString CC_EXT;
 
89
    extern const DLLIMPORT wxString CPP_EXT;
 
90
    extern const DLLIMPORT wxString CXX_EXT;
 
91
    extern const DLLIMPORT wxString CPLPL_EXT;
 
92
    extern const DLLIMPORT wxString INL_EXT;
 
93
    extern const DLLIMPORT wxString H_EXT;
 
94
    extern const DLLIMPORT wxString HH_EXT;
 
95
    extern const DLLIMPORT wxString HPP_EXT;
 
96
    extern const DLLIMPORT wxString HXX_EXT;
 
97
    extern const DLLIMPORT wxString HPLPL_EXT;
 
98
    extern const DLLIMPORT wxString S_EXT;
 
99
    extern const DLLIMPORT wxString SS_EXT;
 
100
    extern const DLLIMPORT wxString S62_EXT;
 
101
    extern const DLLIMPORT wxString OBJECT_EXT;
 
102
    extern const DLLIMPORT wxString XRCRESOURCE_EXT;
 
103
    extern const DLLIMPORT wxString STATICLIB_EXT;
 
104
    extern const DLLIMPORT wxString DYNAMICLIB_EXT;
 
105
    extern const DLLIMPORT wxString EXECUTABLE_EXT;
 
106
    extern const DLLIMPORT wxString NATIVE_EXT;
 
107
    extern const DLLIMPORT wxString RESOURCE_EXT;
 
108
    extern const DLLIMPORT wxString RESOURCEBIN_EXT;
 
109
    extern const DLLIMPORT wxString XML_EXT;
 
110
    extern const DLLIMPORT wxString SCRIPT_EXT;
 
111
 
 
112
    // a dot *and* the extension, e.g. ".exe"
 
113
    extern const DLLIMPORT wxString WORKSPACE_DOT_EXT;
 
114
    extern const DLLIMPORT wxString CODEBLOCKS_DOT_EXT;
 
115
    extern const DLLIMPORT wxString DEVCPP_DOT_EXT;
 
116
    extern const DLLIMPORT wxString MSVC6_DOT_EXT;
 
117
    extern const DLLIMPORT wxString MSVC6_WORKSPACE_DOT_EXT;
 
118
    extern const DLLIMPORT wxString MSVC7_DOT_EXT;
 
119
    extern const DLLIMPORT wxString MSVC7_WORKSPACE_DOT_EXT;
 
120
    extern const DLLIMPORT wxString MSVC10_DOT_EXT;
 
121
    extern const DLLIMPORT wxString XCODE1_DOT_EXT;
 
122
    extern const DLLIMPORT wxString XCODE2_DOT_EXT;
 
123
    extern const DLLIMPORT wxString ASM_DOT_EXT;
 
124
    extern const DLLIMPORT wxString D_DOT_EXT;
 
125
    extern const DLLIMPORT wxString F_DOT_EXT;
 
126
    extern const DLLIMPORT wxString F77_DOT_EXT;
 
127
    extern const DLLIMPORT wxString F90_DOT_EXT;
 
128
    extern const DLLIMPORT wxString F95_DOT_EXT;
 
129
    extern const DLLIMPORT wxString FOR_DOT_EXT;
 
130
    extern const DLLIMPORT wxString FPP_DOT_EXT;
 
131
    extern const DLLIMPORT wxString F03_DOT_EXT;
 
132
    extern const DLLIMPORT wxString F08_DOT_EXT;
 
133
    extern const DLLIMPORT wxString JAVA_DOT_EXT;
 
134
    extern const DLLIMPORT wxString C_DOT_EXT;
 
135
    extern const DLLIMPORT wxString CC_DOT_EXT;
 
136
    extern const DLLIMPORT wxString CPP_DOT_EXT;
 
137
    extern const DLLIMPORT wxString CXX_DOT_EXT;
 
138
    extern const DLLIMPORT wxString CPLPL_DOT_EXT;
 
139
    extern const DLLIMPORT wxString INL_DOT_EXT;
 
140
    extern const DLLIMPORT wxString H_DOT_EXT;
 
141
    extern const DLLIMPORT wxString HH_DOT_EXT;
 
142
    extern const DLLIMPORT wxString HPP_DOT_EXT;
 
143
    extern const DLLIMPORT wxString HXX_DOT_EXT;
 
144
    extern const DLLIMPORT wxString HPLPL_DOT_EXT;
 
145
    extern const DLLIMPORT wxString S_DOT_EXT;
 
146
    extern const DLLIMPORT wxString SS_DOT_EXT;
 
147
    extern const DLLIMPORT wxString S62_DOT_EXT;
 
148
    extern const DLLIMPORT wxString OBJECT_DOT_EXT;
 
149
    extern const DLLIMPORT wxString XRCRESOURCE_DOT_EXT;
 
150
    extern const DLLIMPORT wxString STATICLIB_DOT_EXT;
 
151
    extern const DLLIMPORT wxString DYNAMICLIB_DOT_EXT;
 
152
    extern const DLLIMPORT wxString EXECUTABLE_DOT_EXT;
 
153
    extern const DLLIMPORT wxString NATIVE_DOT_EXT;
 
154
    extern const DLLIMPORT wxString RESOURCE_DOT_EXT;
 
155
    extern const DLLIMPORT wxString RESOURCEBIN_DOT_EXT;
 
156
    extern const DLLIMPORT wxString XML_DOT_EXT;
 
157
    extern const DLLIMPORT wxString SCRIPT_DOT_EXT;
 
158
}
 
159
 
 
160
#endif // FILEFILTERS_H