Code::Blocks  SVN r11506
associations.h
Go to the documentation of this file.
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  {
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 
57 {
59 
60  public:
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 
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
void UpdateChanges()
void SetBatchBuildOnly()
void DoClearAssociation(const wxString &ext)
void DoSetAssociation(const wxString &ext, const wxString &descr, const wxString &exe, int icoNum)
wxCheckListBox * list
Definition: associations.h:58
bool DoCheckAssociation(const wxString &ext, const wxString &descr, const wxString &exe, int icoNum)
unsigned int CountAssocs()