1 /*
2  *      folder-view.h
3  *
4  *      Copyright 2009 - 2012 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
5  *
6  *      This program is free software; you can redistribute it and/or modify
7  *      it under the terms of the GNU General Public License as published by
8  *      the Free Software Foundation; either version 2 of the License, or
9  *      (at your option) any later version.
10  *
11  *      This program is distributed in the hope that it will be useful,
12  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *      GNU General Public License for more details.
15  *
16  *      You should have received a copy of the GNU General Public License
17  *      along with this program; if not, write to the Free Software
18  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  *      MA 02110-1301, USA.
20  */
21 
22 
23 #ifndef __STANDARD_VIEW_H__
24 #define __STANDARD_VIEW_H__
25 
26 #include <gtk/gtk.h>
27 #include "fm-folder-view.h"
28 
29 G_BEGIN_DECLS
30 
31 #define FM_STANDARD_VIEW_TYPE               (fm_standard_view_get_type())
32 #define FM_STANDARD_VIEW(obj)               (G_TYPE_CHECK_INSTANCE_CAST((obj),\
33             FM_STANDARD_VIEW_TYPE, FmStandardView))
34 #define FM_STANDARD_VIEW_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST((klass),\
35             FM_STANDARD_VIEW_TYPE, FmStandardViewClass))
36 #define FM_IS_STANDARD_VIEW(obj)            (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
37             FM_STANDARD_VIEW_TYPE))
38 #define FM_IS_STANDARD_VIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE((klass),\
39             FM_STANDARD_VIEW_TYPE))
40 
41 /**
42  * FmStandardViewMode
43  * @FM_FV_ICON_VIEW: standard icon view
44  * @FM_FV_COMPACT_VIEW: view with small icons and text on right of them
45  * @FM_FV_THUMBNAIL_VIEW: view with big icons/thumbnails
46  * @FM_FV_LIST_VIEW: table-form view
47  */
48 typedef enum
49 {
50     FM_FV_ICON_VIEW,
51     FM_FV_COMPACT_VIEW,
52     FM_FV_THUMBNAIL_VIEW,
53     FM_FV_LIST_VIEW
54 } FmStandardViewMode;
55 
56 #ifndef FM_DISABLE_DEPRECATED
57 #define FM_FOLDER_VIEW_MODE_IS_VALID(mode) FM_STANDARD_VIEW_MODE_IS_VALID(mode)
58 #endif
59 #define FM_STANDARD_VIEW_MODE_IS_VALID(mode)  ((guint)mode <= FM_FV_LIST_VIEW)
60 
61 typedef struct _FmStandardView             FmStandardView;
62 typedef struct _FmStandardViewClass        FmStandardViewClass;
63 
64 GType       fm_standard_view_get_type(void);
65 FmStandardView* fm_standard_view_new(FmStandardViewMode mode,
66                                      FmFolderViewUpdatePopup update_popup,
67                                      FmLaunchFolderFunc open_folders);
68 
69 void fm_standard_view_set_mode(FmStandardView* fv, FmStandardViewMode mode);
70 FmStandardViewMode fm_standard_view_get_mode(FmStandardView* fv);
71 
72 const char* fm_standard_view_mode_to_str(FmStandardViewMode mode);
73 FmStandardViewMode fm_standard_view_mode_from_str(const char* str);
74 
75 gint fm_standard_view_get_n_modes(void);
76 const char *fm_standard_view_get_mode_label(FmStandardViewMode mode);
77 const char *fm_standard_view_get_mode_tooltip(FmStandardViewMode mode);
78 const char *fm_standard_view_get_mode_icon(FmStandardViewMode mode);
79 
80 G_END_DECLS
81 
82 #endif /* __STANDARD_VIEW_H__ */
83