~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to deprecated/management/profile-editor/src/profileeditor.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _PROFILETOOL_H_
 
2
#define _PROFILETOOL_H_
 
3
 
 
4
#ifndef HELP_FILE_LOCATION
 
5
#define HELP_FILE_LOCATION ""
 
6
#endif 
 
7
 
 
8
/**
 
9
 * @short AppArmor Profile Tool
 
10
 * @author Matt Barringer <mbarringer@suse.de>
 
11
 * @version 1.0
 
12
 */
 
13
 
 
14
class ProfileToolFrame; 
 
15
class ProfileTreeData;
 
16
 
 
17
/**
 
18
 * The wxApp class
 
19
 **/
 
20
class AppArmorProfileTool : public wxApp
 
21
{
 
22
        public:
 
23
                virtual bool OnInit();
 
24
                virtual int OnExit();
 
25
        private:
 
26
                ProfileToolFrame *frame;
 
27
};
 
28
 
 
29
/**
 
30
 * The main frame
 
31
 **/
 
32
class ProfileToolFrame : public wxFrame
 
33
{
 
34
        public:
 
35
                ProfileToolFrame(const wxString& title, 
 
36
                                const wxPoint& pos, 
 
37
                                const wxSize& size, 
 
38
                                const wxString& startingProfile, 
 
39
                                const wxString& startingHighlight);
 
40
                ~ProfileToolFrame();
 
41
                void CreateControls(const wxString &startingProfile,
 
42
                                        const wxString &startingHighlight);
 
43
                void ClearProfile();
 
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, 
 
54
                                int matchCase, 
 
55
                                int wholeWord);
 
56
                void RepopulateControl();
 
57
                int SaveCurrentProfile();
 
58
 
 
59
                // Event handlers
 
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);
 
84
 
 
85
        private:
 
86
                wxTreeCtrl              *mpProfileTree;
 
87
                wxFindReplaceDialog     *mpFindDialog, *mpReplaceDialog;
 
88
                wxHtmlHelpController    *mpHelpController;
 
89
                ProfileTextCtrl         *mpProfileView;
 
90
                wxMenuBar               *mpMenuBar;
 
91
                wxFindReplaceData       mFindData, mReplaceData;
 
92
                wxTreeItemId            mRootNode;
 
93
                wxTreeItemId            mCurrentNode;
 
94
                wxSplitterWindow        *mpSplitterWindow;
 
95
                DECLARE_EVENT_TABLE()
 
96
};
 
97
 
 
98
/**
 
99
 * This class is used to keep track of what path goes with
 
100
 * what profile entry in the tree.
 
101
 */
 
102
 
 
103
class ProfileTreeData : public wxTreeItemData
 
104
{
 
105
        public:
 
106
                ProfileTreeData(const wxString& path) : mPath(path) {}
 
107
                wxString GetPath(void) { return mPath; }
 
108
        private:
 
109
                wxString mPath;
 
110
};
 
111
 
 
112
enum
 
113
{
 
114
        ID_MENU_FILE_NEW=1048,
 
115
        ID_MENU_FILE_PREFERENCES,
 
116
        ID_MENU_FILE_SAVE,
 
117
        ID_MENU_FILE_SAVE_AS,
 
118
        ID_MENU_HELP_ABOUT,
 
119
        ID_MENU_HELP_PROFILES,
 
120
        ID_MENU_EDIT_COPY,
 
121
        ID_MENU_EDIT_CUT,
 
122
        ID_MENU_EDIT_PASTE,
 
123
        ID_MENU_EDIT_UNDO,
 
124
        ID_MENU_EDIT_REDO,
 
125
        ID_MENU_EDIT_FIND,
 
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,
 
133
        ID_PROFILE_TREE
 
134
};
 
135
 
 
136
#endif // _PROFILETOOL_H_