btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / resedit / ResView.h
bloba15d8dc37d0e8e5d3cdb1d1386c1febb15b0dcd8
1 /*
2 * Copyright (c) 2005-2010, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
5 * Author:
6 * DarkWyrm <darkwyrm@gmail.com>
7 */
8 #ifndef RESVIEW_H
9 #define RESVIEW_H
11 #include <Entry.h>
12 #include <FilePanel.h>
13 #include <List.h>
14 #include <ListItem.h>
15 #include <MenuBar.h>
16 #include <Resources.h>
17 #include <String.h>
18 #include <View.h>
20 #include "ResourceRoster.h"
22 class BMenuBar;
23 class ResListView;
25 enum {
26 FILE_CLEAN = 0,
27 FILE_DIRTY,
28 FILE_INIT,
29 FILE_QUIT_AFTER_SAVE
32 class ResView : public BView
34 public:
35 ResView(const BRect &frame, const char *name,
36 const int32 &resize, const int32 &flags,
37 const entry_ref *ref = NULL);
38 ~ResView(void);
39 void AttachedToWindow(void);
40 void MessageReceived(BMessage *msg);
42 const char * Filename(void) const { return fFileName.String(); }
43 uint8 GetSaveStatus(void) const { return fSaveStatus; }
45 status_t SetTo(const entry_ref &dir, const BString &name);
46 void OpenFile(const entry_ref &ref);
47 void SaveFile(void);
48 void SaveAndQuit(void);
50 private:
51 void BuildMenus(BMenuBar *menuBar);
52 void EmptyDataList(void);
53 void UpdateRow(BRow *row);
54 void HandleDrop(BMessage *msg);
55 void AddResource(const entry_ref &ref);
56 void DeleteSelectedResources(void);
57 void SetSaveStatus(uint8 value);
59 ResListView *fListView;
60 entry_ref *fRef;
61 BString fFileName;
62 BMenuBar *fBar;
63 uint8 fSaveStatus;
64 BList fDataList;
65 BFilePanel *fOpenPanel,
66 *fSavePanel;
70 class ResDataRow : public BRow
72 public:
73 ResDataRow(ResourceData *data);
74 ResourceData * GetData(void) const;
76 private:
77 ResourceData *fResData;
80 extern ResourceRoster gResRoster;
82 #endif