~ubuntu-branches/ubuntu/vivid/fbreader/vivid-proposed

« back to all changes in this revision

Viewing changes to fbreader/src/fbreader/FBReaderActions.h

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2008-01-23 16:51:07 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080123165107-5q19etahzd72c33a
Tags: 0.8.12-3
* Add libzlui-maemo which allows using fbreader on the maemo platform, on
  Debian. Thanks, Riku Voipio. Closes: #462299
* makefiles/arch/maemo.mk: Don't build with -thumb. (Riku)
* Loosen dependency versions some more, so it only depends on the current
  upstream version or higher, ignoring the Debian revision.
* Use binary:Version instead of deprecated Source-Version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * FBReader -- electronic book reader
3
 
 * Copyright (C) 2004-2007 Nikolay Pultsin <geometer@mawhrin.net>
4
 
 * Copyright (C) 2005 Mikhail Sobolev <mss@mawhrin.net>
 
2
 * Copyright (C) 2004-2008 Geometer Plus <contact@geometerplus.com>
5
3
 *
6
4
 * This program is free software; you can redistribute it and/or modify
7
5
 * it under the terms of the GNU General Public License as published by
28
26
 
29
27
class ZLTextView;
30
28
 
31
 
enum ActionCode {
32
 
        // please, don't change these numbers
33
 
        // add new action id's at end of this enumeration
34
 
        NO_ACTION = 0,
35
 
        ACTION_SHOW_COLLECTION = 1,
36
 
        ACTION_SHOW_OPTIONS = 2,
37
 
        ACTION_UNDO = 3,
38
 
        ACTION_REDO = 4,
39
 
        ACTION_SHOW_CONTENTS = 5,
40
 
        ACTION_SEARCH = 6,
41
 
        ACTION_FIND_PREVIOUS = 7,
42
 
        ACTION_FIND_NEXT = 8,
43
 
        ACTION_LARGE_SCROLL_FORWARD = 9,
44
 
        ACTION_LARGE_SCROLL_BACKWARD = 10,
45
 
        ACTION_SMALL_SCROLL_FORWARD = 11,
46
 
        ACTION_SMALL_SCROLL_BACKWARD = 12,
47
 
        ACTION_MOUSE_SCROLL_FORWARD = 13,
48
 
        ACTION_MOUSE_SCROLL_BACKWARD = 14,
49
 
        ACTION_SCROLL_TO_HOME = 15,
50
 
        ACTION_SCROLL_TO_START_OF_TEXT = 16,
51
 
        ACTION_SCROLL_TO_END_OF_TEXT = 17,
52
 
        ACTION_CANCEL = 18,
53
 
        ACTION_INCREASE_FONT = 19,
54
 
        ACTION_DECREASE_FONT = 20,
55
 
        ACTION_SHOW_HIDE_POSITION_INDICATOR = 21,
56
 
        ACTION_TOGGLE_FULLSCREEN = 22,
57
 
        ACTION_FULLSCREEN_ON = 23,
58
 
        ACTION_ADD_BOOK = 24,
59
 
        ACTION_SHOW_BOOK_INFO = 25,
60
 
        ACTION_SHOW_HELP = 26,
61
 
        ACTION_ROTATE_SCREEN = 27,
62
 
        ACTION_SHOW_LAST_BOOKS = 28,
63
 
        ACTION_QUIT = 29,
64
 
        ACTION_OPEN_PREVIOUS_BOOK = 30,
65
 
        ACTION_FINGER_TAP_SCROLL_FORWARD = 31,
66
 
        ACTION_FINGER_TAP_SCROLL_BACKWARD = 32,
67
 
        ACTION_GOTO_NEXT_TOC_SECTION = 33,
68
 
        ACTION_GOTO_PREVIOUS_TOC_SECTION = 34,
69
 
        ACTION_COPY_SELECTED_TEXT_TO_CLIPBOARD = 35,
70
 
        ACTION_CLEAR_SELECTION = 36,
71
 
        ACTION_OPEN_SELECTED_TEXT_IN_DICTIONARY = 37,
 
29
class ActionCode {
 
30
 
 
31
public:
 
32
        static const std::string SHOW_COLLECTION;
 
33
        static const std::string SHOW_OPTIONS;
 
34
        static const std::string UNDO;
 
35
        static const std::string REDO;
 
36
        static const std::string SHOW_CONTENTS;
 
37
        static const std::string SEARCH;
 
38
        static const std::string FIND_PREVIOUS;
 
39
        static const std::string FIND_NEXT;
 
40
        static const std::string LARGE_SCROLL_FORWARD;
 
41
        static const std::string LARGE_SCROLL_BACKWARD;
 
42
        static const std::string SMALL_SCROLL_FORWARD;
 
43
        static const std::string SMALL_SCROLL_BACKWARD;
 
44
        static const std::string MOUSE_SCROLL_FORWARD;
 
45
        static const std::string MOUSE_SCROLL_BACKWARD;
 
46
        static const std::string TAP_SCROLL_FORWARD;
 
47
        static const std::string TAP_SCROLL_BACKWARD;
 
48
        static const std::string SCROLL_TO_HOME;
 
49
        static const std::string SCROLL_TO_START_OF_TEXT;
 
50
        static const std::string SCROLL_TO_END_OF_TEXT;
 
51
        static const std::string CANCEL;
 
52
        static const std::string INCREASE_FONT;
 
53
        static const std::string DECREASE_FONT;
 
54
        static const std::string SHOW_HIDE_POSITION_INDICATOR;
 
55
        static const std::string TOGGLE_FULLSCREEN;
 
56
        static const std::string FULLSCREEN_ON;
 
57
        static const std::string ADD_BOOK;
 
58
        static const std::string SHOW_BOOK_INFO;
 
59
        static const std::string SHOW_HELP;
 
60
        static const std::string ROTATE_SCREEN;
 
61
        static const std::string SHOW_LAST_BOOKS;
 
62
        static const std::string QUIT;
 
63
        static const std::string OPEN_PREVIOUS_BOOK;
 
64
        static const std::string GOTO_NEXT_TOC_SECTION;
 
65
        static const std::string GOTO_PREVIOUS_TOC_SECTION;
 
66
        static const std::string COPY_SELECTED_TEXT_TO_CLIPBOARD;
 
67
        static const std::string CLEAR_SELECTION;
 
68
        static const std::string OPEN_SELECTED_TEXT_IN_DICTIONARY;
 
69
        static const std::string GOTO_PAGE_NUMBER;
 
70
 
 
71
private:
 
72
        ActionCode();
72
73
};
73
74
 
74
75
class FBAction : public ZLApplication::Action {
81
82
        FBReader &myFBReader;
82
83
};
83
84
 
84
 
class ShowCollectionAction : public FBAction {
 
85
class ModeDependentAction : public FBAction {
 
86
 
 
87
protected:
 
88
        ModeDependentAction(FBReader &fbreader, int visibleInModes);
 
89
 
 
90
public:
 
91
        bool isVisible();
 
92
 
 
93
private:
 
94
        int myVisibleInModes;
 
95
};
 
96
 
 
97
class ShowCollectionAction : public ModeDependentAction {
85
98
 
86
99
public:
87
100
        ShowCollectionAction(FBReader &fbreader);
88
 
        bool isVisible();
89
101
        void run();
90
102
};
91
103
 
96
108
        void run();
97
109
};
98
110
 
99
 
class ShowRecentBooksListAction : public FBAction {
 
111
class ShowRecentBooksListAction : public ModeDependentAction {
100
112
 
101
113
public:
102
114
        ShowRecentBooksListAction(FBReader &fbreader);
103
 
        bool isVisible();
104
115
        void run();
105
116
};
106
117
 
127
138
        void run();
128
139
};
129
140
 
130
 
class ShowBookInfoAction : public FBAction {
 
141
class ShowBookInfoAction : public ModeDependentAction {
131
142
 
132
143
public:
133
144
        ShowBookInfoAction(FBReader &fbreader);
134
 
        bool isVisible();
135
145
        void run();
136
146
};
137
147
 
148
158
        const bool myForward;
149
159
};
150
160
 
151
 
class ScrollToHomeAction : public FBAction {
 
161
class ScrollToHomeAction : public ModeDependentAction {
152
162
 
153
163
public:
154
164
        ScrollToHomeAction(FBReader &fbreader);
155
 
        bool isVisible();
156
165
        void run();
157
166
};
158
167
 
159
 
class ScrollToStartOfTextAction : public FBAction {
 
168
class ScrollToStartOfTextAction : public ModeDependentAction {
160
169
 
161
170
public:
162
171
        ScrollToStartOfTextAction(FBReader &fbreader);
163
 
        bool isVisible();
164
172
        void run();
165
173
};
166
174
 
167
 
class ScrollToEndOfTextAction : public FBAction {
 
175
class ScrollToEndOfTextAction : public ModeDependentAction {
168
176
 
169
177
public:
170
178
        ScrollToEndOfTextAction(FBReader &fbreader);
171
 
        bool isVisible();
172
179
        void run();
173
180
};
174
181
 
180
187
        void run();
181
188
};
182
189
 
183
 
class RedoAction : public FBAction {
 
190
class RedoAction : public ModeDependentAction {
184
191
 
185
192
public:
186
193
        RedoAction(FBReader &fbreader);
187
 
        bool isVisible();
188
194
        bool isEnabled();
189
195
        void run();
190
196
};
270
276
        void run();
271
277
};
272
278
 
 
279
class GotoPageNumber : public ModeDependentAction {
 
280
 
 
281
public:
 
282
        GotoPageNumber(FBReader &fbreader);
 
283
        bool isEnabled();
 
284
        void run();
 
285
};
 
286
 
273
287
class SelectionAction : public FBAction {
274
288
 
275
289
public: