1
#ifndef _PROFILETOOL_H_
2
#define _PROFILETOOL_H_
4
#ifndef HELP_FILE_LOCATION
5
#define HELP_FILE_LOCATION ""
9
* @short AppArmor Profile Tool
10
* @author Matt Barringer <mbarringer@suse.de>
14
class ProfileToolFrame;
15
class ProfileTreeData;
20
class AppArmorProfileTool : public wxApp
23
virtual bool OnInit();
26
ProfileToolFrame *frame;
32
class ProfileToolFrame : public wxFrame
35
ProfileToolFrame(const wxString& title,
38
const wxString& startingProfile,
39
const wxString& startingHighlight);
41
void CreateControls(const wxString &startingProfile,
42
const wxString &startingHighlight);
44
bool DeleteProfile(wxString& profile);
45
void EnableSaveMenu(bool toggle);
46
int FindTreeNodeAndHighlight(wxTreeItemId startingNode, wxString path);
47
void LoadProfile(const wxString& profile, const wxString& highlight);
48
void PopulateControls();
49
void ProfileHasBeenModified();
50
int ProfileNeedSaving();
51
void ReloadProfile(const wxString &filePath);
52
void ReplaceAll(const wxString searchText,
53
const wxString replaceText,
56
void RepopulateControl();
57
int SaveCurrentProfile();
60
void OnQuit(wxCommandEvent& event);
61
void OnClose(wxCloseEvent &event);
62
void OnAbout(wxCommandEvent& event);
63
void OnSave(wxCommandEvent& event);
64
void OnFind(wxCommandEvent& event);
65
void OnSearchAllProfiles(wxCommandEvent& event);
66
void OnReplace(wxCommandEvent& event);
67
void OnSaveAs(wxCommandEvent& event);
68
void OnHelp(wxCommandEvent& event );
69
void OnDeleteProfile(wxCommandEvent &event);
70
void OnReloadProfile(wxCommandEvent &event);
71
void OnCheckSyntax(wxCommandEvent &event);
72
void OnEditMenu(wxCommandEvent& event);
73
void OnPreferences(wxCommandEvent& event);
74
void OnNewProfile(wxCommandEvent& event);
75
void OnProfileModified(wxStyledTextEvent &event);
76
void OnTreeSelection(wxTreeEvent& event);
77
void OnTreeContextMenu(wxTreeEvent& event);
78
void OnOpenInclude(wxCommandEvent &event);
79
void OnInsertInclude(wxCommandEvent &event);
80
void OnUpdateUI(wxStyledTextEvent &event);
81
void OnSize(wxSizeEvent& event);
82
void OnFindButton(wxFindDialogEvent& event);
83
void OnEndOfProfileReload(wxProcessEvent &event);
86
wxTreeCtrl *mpProfileTree;
87
wxFindReplaceDialog *mpFindDialog, *mpReplaceDialog;
88
wxHtmlHelpController *mpHelpController;
89
ProfileTextCtrl *mpProfileView;
91
wxFindReplaceData mFindData, mReplaceData;
92
wxTreeItemId mRootNode;
93
wxTreeItemId mCurrentNode;
94
wxSplitterWindow *mpSplitterWindow;
99
* This class is used to keep track of what path goes with
100
* what profile entry in the tree.
103
class ProfileTreeData : public wxTreeItemData
106
ProfileTreeData(const wxString& path) : mPath(path) {}
107
wxString GetPath(void) { return mPath; }
114
ID_MENU_FILE_NEW=1048,
115
ID_MENU_FILE_PREFERENCES,
117
ID_MENU_FILE_SAVE_AS,
119
ID_MENU_HELP_PROFILES,
126
ID_MENU_EDIT_REPLACE,
127
ID_MENU_EDIT_FIND_NEXT,
128
ID_MENU_EDIT_SEARCH_ALL_PROFILES,
129
ID_PREFERENCES_DIALOG,
130
ID_TREE_CONTEXT_DELETE,
131
ID_TREE_CONTEXT_RELOAD,
132
ID_RELOAD_PROFILE_PROCESS,
136
#endif // _PROFILETOOL_H_