~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/src/associations.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 General Public License, version 3
 
3
 * http://www.gnu.org/licenses/gpl-3.0.html
 
4
 */
 
5
 
 
6
#ifndef ASSOCIATIONS_H
 
7
#define ASSOCIATIONS_H
 
8
 
 
9
#include "scrollingdialog.h"
 
10
#include <wx/intl.h>
 
11
#include <wx/string.h>
 
12
#ifdef __WXMSW__
 
13
    #include <wx/msw/registry.h>
 
14
    #include <shlobj.h> // for SHChangeNotify()
 
15
    #ifdef __CBDEBUG__
 
16
        #include <windows.h>
 
17
        #include <wincon.h>
 
18
    #endif
 
19
    #define DDE_SERVICE    _T("CODEBLOCKS")
 
20
#else
 
21
    #define DDE_SERVICE    _T("/tmp/CODEBLOCKS%s.socket")
 
22
#endif
 
23
#define DDE_TOPIC    _T("CodeBlocksDDEServer")
 
24
#include <wx/ipc.h>
 
25
 
 
26
class wxCheckListBox;
 
27
class wxWindow;
 
28
class wxCommandEvent;
 
29
 
 
30
namespace Associations
 
31
{
 
32
    struct Assoc
 
33
    {
 
34
    wxString ext;
 
35
    wxString descr;
 
36
    int index;
 
37
    };
 
38
 
 
39
    unsigned int CountAssocs();
 
40
 
 
41
    void SetCore();
 
42
    void SetAll();
 
43
    void ClearAll();
 
44
    void SetBatchBuildOnly();
 
45
    bool Check();
 
46
 
 
47
    void DoSetAssociation(const wxString& ext, const wxString& descr, const wxString& exe, int icoNum);
 
48
    bool DoCheckAssociation(const wxString& ext, const wxString& descr, const wxString& exe, int icoNum);  // TODO: descriptions are not checked at all, and actually it's not necessary
 
49
                                                                                                           //       (extension + executable is actually enough)
 
50
                                                                                                           //        ---> decide whether to remove parameter from "Check" function or implement
 
51
    void DoClearAssociation(const wxString& ext);
 
52
 
 
53
    void UpdateChanges();
 
54
}
 
55
 
 
56
class ManageAssocsDialog : public wxScrollingDialog
 
57
{
 
58
    wxCheckListBox* list;
 
59
 
 
60
    public:
 
61
        ManageAssocsDialog(wxWindow* parent);
 
62
    protected:
 
63
        void OnApply(wxCommandEvent& event);
 
64
        void OnCancel(wxCommandEvent& event);
 
65
        void OnClearAll(wxCommandEvent& event);
 
66
    private:
 
67
        DECLARE_EVENT_TABLE()
 
68
};
 
69
 
 
70
#define ASC_ASSOC_DLG_NO_DONT_ASK       0
 
71
#define ASC_ASSOC_DLG_NO_ONLY_NOW       1
 
72
#define ASC_ASSOC_DLG_YES_C_FILES       2
 
73
#define ASC_ASSOC_DLG_YES_ALL_FILES     3
 
74
 
 
75
class AskAssocDialog : public wxScrollingDialog
 
76
{
 
77
    public:
 
78
        AskAssocDialog(wxWindow* parent);
 
79
    protected:
 
80
        void OnOK(wxCommandEvent& event);
 
81
        void OnESC(wxCommandEvent& event);
 
82
        void OnCharHook(wxKeyEvent& event);
 
83
    private:
 
84
        DECLARE_EVENT_TABLE()
 
85
};
 
86
 
 
87
 
 
88
 
 
89
#endif // ASSOCIATIONS_H