source: trunk/EraserDoc.h @ 20

Revision 20, 6.4 KB checked in by lowjoel, 7 years ago (diff)

Garrett's updated code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1// EraserDoc.h
2//
3// Eraser. Secure data removal. For Windows.
4// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
5//
6// This program is free software; you can redistribute it and/or
7// modify it under the terms of the GNU General Public License
8// as published by the Free Software Foundation; either version 2
9// of the License, or (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19// 02111-1307, USA.
20
21
22#if !defined(AFX_ERASERDOC_H__70E9C85A_F0D1_11D2_BBF3_00105AAF62C4__INCLUDED_)
23#define AFX_ERASERDOC_H__70E9C85A_F0D1_11D2_BBF3_00105AAF62C4__INCLUDED_
24
25#if _MSC_VER > 1000
26#pragma once
27#endif // _MSC_VER > 1000
28
29#include "Item.h"
30#include "SystemTray.h"
31
32// constants
33const LPCTSTR szSettingsKey      = "Scheduler";
34const LPCTSTR szScheduleKey      = "Scheduled Assignments";
35
36const LPCTSTR szSchedulerEnabled = "SchedulerEnabled";
37const LPCTSTR szLog              = "SchedulerLog";
38const LPCTSTR szLogOnlyErrors    = "SchedulerLogOnlyErrors";
39const LPCTSTR szStartup          = "SchedulerStartup";
40const LPCTSTR szQueueTasks       = "SchedulerQueueTasks";
41const LPCTSTR szNoVisualErrors   = "SchedulerNoVisualErrors";
42const LPCTSTR szMaxLogSize       = "SchedulerMaxLogFileSize";
43
44const LPCTSTR szStartView        = "EraserStartView";
45const LPCTSTR szIconAnimation    = "EraserOutbarIconAnimation";
46const LPCTSTR szSmallIconView    = "EraserOutbarSmallIconView";
47const LPCTSTR szOutBarWidth      = "EraserOutbarWidth";
48const LPCTSTR szNoTrayIcon       = "EraserNoTrayIcon";
49const LPCTSTR szHideOnMinimize   = "EraserHideOnMinimize";
50const LPCTSTR szWindowRect       = "EraserWindowRect";
51
52const LPCTSTR szViewInfoBar      = "EraserViewInfoBar";
53const LPCTSTR szResolveLock      = "EraserResolveLock";
54const LPCTSTR szResolveAskUser   = "EraserResolveLockAskUser";
55
56const LPCTSTR szStartupPath      = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
57const LPCTSTR szLogFile          = "schedlog.txt";
58const LPCTSTR szRunOnStartup     = "Eraser";
59
60const LPCTSTR szClearSwapPath    = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management";
61const LPCTSTR szClearSwapValue   = "ClearPageFileAtShutdown";
62
63const LPCTSTR szFileExtension    = "ers";
64const LPCTSTR szFileWCard        = "*.ers";
65const LPCTSTR szFileFilter       = "Eraser Files (*.ers)|*.ers||";
66const LPCTSTR szExportTitle      = "Select Export File";
67const LPCTSTR szImportTitle      = "Select Import File";
68
69const LPCTSTR szDefaultFile      = "default.ers";
70
71// definitions
72#define VIEW_ERASER     1
73#define VIEW_SCHEDULER  2
74#define VIEW_EXPLORER   3
75
76// messages
77#define SCHEDULER_SET_TIMERS 1L
78
79// enumerations
80enum HeaderIcon
81{
82    IconExclamation,
83    IconEraser,
84    IconClock
85};
86
87enum OutbarFolders
88{
89    FolderEraser,
90    FolderExplorer
91};
92
93enum OutbarEraserViews
94{
95    ViewEraser,
96    ViewScheduler
97};
98
99
100class CEraserDoc : public CDocument
101{
102private:
103CEraserDoc(const CEraserDoc&) ;
104CEraserDoc& operator = (const CEraserDoc&);
105
106protected: // create from serialization only
107    CEraserDoc();
108    DECLARE_DYNCREATE(CEraserDoc)
109
110
111// Operations
112public:
113    virtual ~CEraserDoc();
114
115    BOOL LogAction(UINT);
116    BOOL LogException(CException*);
117    BOOL LogAction(CString);
118
119    void CalcNextAssignment();
120    void UpdateToolTip();
121
122    BOOL SavePreferences();
123    BOOL ReadPreferences();
124
125    BOOL Import(LPCTSTR szFile, BOOL bErrors = TRUE);
126    BOOL Export(LPCTSTR szFile, BOOL bErrors = TRUE);
127    BOOL SaveTasksToDefault();
128
129    BOOL AddScheduledTask(CScheduleItem*);
130    BOOL AddTask(CItem*);
131    void CleanList(CPtrArray&, int);
132    void FreeTasks();
133
134    CSystemTray m_stIcon;
135
136    CString m_strNextAssignment;
137    CString m_strExePath;
138
139    //Setting. resolving file lock
140    BOOL m_bResolveLock;
141    BOOL m_bResolveAskUser;
142    // Scheduler process counting
143    WORD m_wProcessCount;
144    BOOL m_bSchedulerEnabled;
145
146    // task arrays
147    CPtrArray m_paTasks;
148    CPtrArray m_paScheduledTasks;
149
150    // task queue
151    CPtrArray m_paQueuedTasks;
152
153    // settings (start view)
154    DWORD   m_dwStartView;
155
156    // settings (results)
157    BOOL    m_bResultsForFiles;
158    BOOL    m_bResultsForUnusedSpace;
159    BOOL    m_bResultsOnlyWhenFailed;
160    BOOL    m_bShellextResults;
161
162    // settings (shell extension)
163    BOOL    m_bErasextEnabled;
164
165    // settings (PRNG)
166    BOOL    m_bEnableSlowPoll;
167
168    // settings (paging file on NT)
169    BOOL    m_bClearSwap;
170
171    // settings (Scheduler)
172    BOOL    m_bLog;
173    BOOL    m_bLogOnlyErrors;
174    BOOL    m_bStartup;
175    BOOL    m_bQueueTasks;
176    BOOL    m_bNoVisualErrors;
177    DWORD   m_dwMaxLogSize;
178    BOOL    m_bNoTrayIcon;
179    BOOL    m_bHideOnMinimize;
180
181    // settings (Folder Bar)
182    BOOL    m_bIconAnimation;
183    BOOL    m_bSmallIconView;
184    DWORD   m_dwOutbarWidth;
185    RECT    m_rWindowRect;
186
187    // settings (View)
188    BOOL    m_bViewInfoBar;
189
190    CImageList* m_smallImageList;
191    CImageList m_ilHeader;
192
193// Overrides
194    // ClassWizard generated virtual function overrides
195    //{{AFX_VIRTUAL(CEraserDoc)
196    public:
197    virtual BOOL OnNewDocument();
198    virtual void Serialize(CArchive& ar);
199    virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
200    virtual void DeleteContents();
201    virtual void OnCloseDocument();
202    //}}AFX_VIRTUAL
203
204
205
206#ifdef _DEBUG
207    virtual void AssertValid() const;
208    virtual void Dump(CDumpContext& dc) const;
209#endif
210
211protected:
212
213// Generated message map functions
214protected:
215    //{{AFX_MSG(CEraserDoc)
216    afx_msg void OnUpdateFileExport(CCmdUI* pCmdUI);
217    afx_msg void OnFileExport();
218    afx_msg void OnFileImport();
219    afx_msg void OnTrayEnable();
220    afx_msg void OnUpdateTrayShowWindow(CCmdUI* pCmdUI);
221    afx_msg void OnUpdateTrayEnable(CCmdUI* pCmdUI);
222    afx_msg void OnTrayShowWindow();
223    afx_msg void OnEditPreferencesGeneral();
224    afx_msg void OnEditPreferencesEraser();
225    afx_msg void OnFileViewLog();
226    //}}AFX_MSG
227    DECLARE_MESSAGE_MAP()
228};
229
230/////////////////////////////////////////////////////////////////////////////
231
232//{{AFX_INSERT_LOCATION}}
233// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
234
235#endif // !defined(AFX_ERASERDOC_H__70E9C85A_F0D1_11D2_BBF3_00105AAF62C4__INCLUDED_)
Note: See TracBrowser for help on using the repository browser.