-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.h
More file actions
77 lines (65 loc) · 1.7 KB
/
MainWindow.h
File metadata and controls
77 lines (65 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "Sidebar.h"
#include "UndoableTextView.h"
#include <Application.h>
#include <Bitmap.h>
#include <FilePanel.h>
#include <MenuBar.h>
#include <MessageRunner.h>
#include <StringView.h>
#include <SupportDefs.h>
#include <TextControl.h>
#include <TextView.h>
#include <Window.h>
#include <private/shared/ToolBar.h>
class MainWindow : public BWindow {
public:
MainWindow(void);
virtual ~MainWindow();
void MessageReceived(BMessage* msg);
BBitmap* ResourceToBitmap(const char* resName);
bool QuitRequested(void);
void OpenFile(const entry_ref& ref);
void SaveFile(const char* path);
void MenusBeginning();
private:
BMenuBar* _BuildMenu();
BToolBar* fToolbar;
Sidebar* fSidebar;
void _UpdateStatusBar();
void _UpdateStatusMessage(BString message);
void _UpdateToolbarState();
void _UpdateWindowTitle();
bool _ClipboardHasText() const;
bool _GetClipboardText(BString& outText) const;
bool fSaveTextOnExit;
bool fSaveFieldsOnExit;
bool fInsertClipboard;
bool fClearSettingsAfterUse;
int32 fFontSize;
BString fFontFamily;
status_t _LoadSettings(BMessage& settings);
status_t _SaveSettings();
void _RestoreValues(BMessage& settings);
UndoableTextView* fTextView;
BScrollView* fScrollView;
BStringView* fStatusBar;
BStringView* fMessageBar;
BMessageRunner* fStatusUpdater;
BMessageRunner* fStatusClearRunner = nullptr;
BMenuItem* fSaveMenuItem;
BFilePanel* fOpenPanel;
BFilePanel* fSavePanel;
BString fFilePath;
BWindow* fSettingsWindow;
BMenuItem* fUndoItem;
BMenuItem* fRedoItem;
BMenuItem* fCutItem;
BMenuItem* fCopyItem;
BMenuItem* fPasteItem;
BMenuItem* fSelectAllItem;
BString fLastSavedText;
bool IsDocumentModified() const;
};
#endif