~noskcaj/ubuntu/utopic/libfm/merge

« back to all changes in this revision

Viewing changes to src/base/fm-nav-history.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Lee (李健秋)
  • Date: 2010-04-29 03:52:06 UTC
  • Revision ID: james.westby@ubuntu.com-20100429035206-qlj1jwsfcgr5mdx3
Tags: upstream-0.1.11
Import upstream version 0.1.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *      fm-nav-history.h
 
3
 *      
 
4
 *      Copyright 2009 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 __FM_NAV_HISTORY_H__
 
24
#define __FM_NAV_HISTORY_H__
 
25
 
 
26
#include <glib-object.h>
 
27
#include "fm-path.h"
 
28
 
 
29
G_BEGIN_DECLS
 
30
 
 
31
/* FIXME: Do we really need GObject for such a simple data structure? */
 
32
 
 
33
#define FM_NAV_HISTORY_TYPE                             (fm_nav_history_get_type())
 
34
#define FM_NAV_HISTORY(obj)                             (G_TYPE_CHECK_INSTANCE_CAST((obj),\
 
35
                        FM_NAV_HISTORY_TYPE, FmNavHistory))
 
36
#define FM_NAV_HISTORY_CLASS(klass)             (G_TYPE_CHECK_CLASS_CAST((klass),\
 
37
                        FM_NAV_HISTORY_TYPE, FmNavHistoryClass))
 
38
#define IS_FM_NAV_HISTORY(obj)                  (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
 
39
                        FM_NAV_HISTORY_TYPE))
 
40
#define IS_FM_NAV_HISTORY_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),\
 
41
                        FM_NAV_HISTORY_TYPE))
 
42
 
 
43
typedef struct _FmNavHistory                    FmNavHistory;
 
44
typedef struct _FmNavHistoryItem                FmNavHistoryItem;
 
45
typedef struct _FmNavHistoryClass               FmNavHistoryClass;
 
46
 
 
47
struct _FmNavHistoryItem
 
48
{
 
49
    FmPath* path;
 
50
    int scroll_pos;
 
51
};
 
52
 
 
53
struct _FmNavHistory
 
54
{
 
55
        GObject parent;
 
56
    GQueue items;
 
57
    GList* cur;
 
58
    guint n_max;
 
59
};
 
60
 
 
61
struct _FmNavHistoryClass
 
62
{
 
63
        GObjectClass parent_class;
 
64
};
 
65
 
 
66
GType           fm_nav_history_get_type         (void);
 
67
FmNavHistory*   fm_nav_history_new                      (void);
 
68
 
 
69
/* The returned GList belongs to FmNavHistory and shouldn't be freed. */
 
70
GList* fm_nav_history_list(FmNavHistory* nh);
 
71
const FmNavHistoryItem* fm_nav_history_get_cur(FmNavHistory* nh);
 
72
GList* fm_nav_history_get_cur_link(FmNavHistory* nh);
 
73
gboolean fm_nav_history_get_can_back(FmNavHistory* nh);
 
74
void fm_nav_history_back(FmNavHistory* nh, int old_scroll_pos);
 
75
gboolean fm_nav_history_get_can_forward(FmNavHistory* nh);
 
76
void fm_nav_history_forward(FmNavHistory* nh, int old_scroll_pos);
 
77
void fm_nav_history_chdir(FmNavHistory* nh, FmPath* path, int old_scroll_pos);
 
78
void fm_nav_history_jump(FmNavHistory* nh, GList* l, int old_scroll_pos);
 
79
void fm_nav_history_clear(FmNavHistory* nh);
 
80
void fm_nav_history_set_max(FmNavHistory* nh, guint num);
 
81
 
 
82
G_END_DECLS
 
83
 
 
84
#endif /* __FM_NAV_HISTORY_H__ */