2 * Copyright (c) 2007-2013, Czirkos Zoltan http://code.google.com/p/gdash/
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef _GD_SELECTFILEAPPLET
18 #define _GD_SELECTFILEAPPLET
23 #include "framework/app.hpp"
25 template <typename T
> class Command1Param
;
27 class SelectFileActivity
: public Activity
{
29 SelectFileActivity(App
*app
, const char *title
, const char *start_dir
, const char *glob
, bool for_save
, const char *defaultname
, SmartPtr
<Command1Param
<std::string
> > command_when_successful
);
30 ~SelectFileActivity();
32 virtual void keypress_event(KeyCode keycode
, int gfxlib_keycode
);
33 virtual void redraw_event();
34 virtual void pushed_event();
36 void jump_to_directory(char const *jump_to
);
37 void file_selected(char const *filename
);
38 void file_selected_do_command();
41 SmartPtr
<Command1Param
<std::string
> > command_when_successful
;
45 unsigned names_per_page
;
48 char *directory_of_process
;
59 std::vector
<std::string
> files
;
60 std::string defaultname
;
61 std::string start_dir
;