Subversion Repositories Filer-Free

Rev

Rev 38 | Rev 43 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
31 gdshaw@RISCPKG.ORG 1
// This file is part of the free Filer module for RISC OS.
2
// Copyright  2007 Graham Shaw.
3
// Redistribution and modification are permitted under the terms of the
4
// GNU General Public License (version 2 or any later version).
5
 
6
#ifndef FILER_FILER_MENU
7
#define FILER_FILER_MENU
8
 
9
#include "directory.h"
10
#include "menu.h"
11
#include "filer_options.h"
38 gdshaw@RISCPKG.ORG 12
#include "new_dir_dbox.h"
41 gdshaw@RISCPKG.ORG 13
#include "info_dbox.h"
31 gdshaw@RISCPKG.ORG 14
#include "filer_window.h"
15
 
16
class layout_method;
17
class sort_method;
18
 
19
class filer_menu:
20
        public menu
21
{
22
private:
23
        /** The filer window to which this menu belongs.
24
         * As menus may be shared between windows, ownership may change.
25
         */
26
        filer_window* _owner;
27
 
28
        /** The selected object, or 0 if there is more or less than one
29
         * object selected.
30
         */
31
        osgbpb_info* _object;
32
 
33
        /** The display submenu. */
34
        menu _display_menu;
35
 
36
        /** The rename submenu. */
37
        menu _rename_menu;
38
 
39
        /** The file access submenu. */
40
        menu _access_menu;
41
 
42
        /** The find submenu. */
43
        menu _find_menu;
44
 
45
        /** The filetype submenu. */
46
        menu _filetype_menu;
47
 
48
        /** The selection submenu. */
49
        menu _selection_menu;
50
 
51
        /** The options submenu. */
52
        menu _options_menu;
53
 
38 gdshaw@RISCPKG.ORG 54
        /** The new directory dialogue box. */
55
        new_dir_dbox _new_dir_dbox;
56
 
41 gdshaw@RISCPKG.ORG 57
        /** The file information dialogue box. */
58
        info_dbox _info_dbox;
59
 
31 gdshaw@RISCPKG.ORG 60
        /** A buffer for the rename menu option. */
61
        char* _rename_leafname;
62
 
63
        /** A buffer for the find menu option. */
64
        char* _find_pattern;
65
 
66
        /** A buffer for the filetype menu option. */
67
        char* _filetype_field;
68
 
69
        /** A buffer for the menu item leading to the selection menu. */
70
        char* _selection_text;
71
 
72
        /** The number of known layout methods. */
73
        unsigned int _layout_count;
74
 
75
        /** An array containing the known layout methods. */
76
        layout_method** _layout_methods;
77
 
78
        /** The number of known sorting methods. */
79
        unsigned int _sort_count;
80
 
81
        /** An array containing the known sorting methods. */
82
        sort_method** _sort_methods;
83
public:
84
        /** Construct filer menu.
85
         * @param app the initial owner of this menu
86
         */
87
        filer_menu(application* app);
88
 
89
        /** Destroy filer menu. */
90
        ~filer_menu();
91
 
92
        virtual void handle_menu_selection(wimp_selection& block);
93
        virtual void handle_menus_deleted();
94
 
95
        /** Show this menu.
96
         * @param block the pointer location
97
         */
98
        void show(wimp_pointer& block);
99
 
100
        /** Update menu according to layout method of owner. */
101
        void update_layout();
102
 
103
        /** Update menu according to sorting method of owner. */
104
        void update_sort();
105
 
106
        /** Update menu according to selection within owner. */
107
        void update_selection();
108
 
109
        /** Update menu according to pathname of owner. */
110
        void update_pathname();
111
 
112
        /** Update menu to reflect state of owner.
113
         * @param the (possibly new) new owner of this menu
114
         */
115
        void update(filer_window* owner);
116
};
117
 
118
#endif