~ubuntu-branches/ubuntu/oneiric/apvlv/oneiric

« back to all changes in this revision

Viewing changes to src/ApvlvCore.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ritter
  • Date: 2009-07-15 14:48:33 UTC
  • Revision ID: james.westby@ubuntu.com-20090715144833-k4hx9jqtb6vef121
Tags: upstream-0.0.6.8
ImportĀ upstreamĀ versionĀ 0.0.6.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the apvlv package
 
3
 *
 
4
 * Copyright (C) 2008 Alf.
 
5
 *
 
6
 * Contact: Alf <naihe2010@gmail.com>
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU General Public License
 
10
 * as published by the Free Software Foundation; either version 2.0 of
 
11
 * the License, or (at your option) any later version.
 
12
 *
 
13
 * This program is distributed in the hope that it will be useful, but
 
14
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
16
 * General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public
 
19
 * License along with this program; if not, write to the Free Software
 
20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
21
 *
 
22
 */
 
23
/* @PPCFILE ApvlvCore.hpp
 
24
 *
 
25
 *  Author: Alf <naihe2010@gmail.com>
 
26
 */
 
27
/* @date Created: 2008/09/30 00:00:00 Alf */
 
28
 
 
29
#ifndef _APVLV_CORE_H_
 
30
#define _APVLV_CORE_H_
 
31
 
 
32
#ifdef HAVE_CONFIG_H
 
33
# include "config.hpp"
 
34
#endif
 
35
 
 
36
#include "ApvlvUtil.hpp"
 
37
 
 
38
#include <gtk/gtk.h>
 
39
 
 
40
#include <iostream>
 
41
 
 
42
using namespace std;
 
43
 
 
44
namespace apvlv
 
45
{
 
46
  class ApvlvCore;
 
47
  class ApvlvCoreStatus
 
48
    {
 
49
  public:
 
50
    ApvlvCoreStatus ();
 
51
 
 
52
    virtual ~ApvlvCoreStatus ();
 
53
 
 
54
    virtual GtkWidget *widget ();
 
55
 
 
56
    virtual void active (bool act);
 
57
 
 
58
    virtual void setsize (int w, int h);
 
59
 
 
60
    virtual void show ();
 
61
 
 
62
  protected:
 
63
    GtkWidget *mHbox;
 
64
    };
 
65
 
 
66
  class ApvlvCore
 
67
    {
 
68
  public:
 
69
    ApvlvCore ();
 
70
 
 
71
    virtual ~ApvlvCore ();
 
72
 
 
73
    virtual void inuse (bool use);
 
74
 
 
75
    virtual bool inuse ();
 
76
 
 
77
    virtual int type ();
 
78
 
 
79
    virtual GtkWidget *widget ();
 
80
 
 
81
    virtual ApvlvCore *copy ();
 
82
 
 
83
    virtual bool loadfile (const char *file, bool check = true);
 
84
 
 
85
    virtual const char *filename ();
 
86
 
 
87
    virtual gint getrotate ();
 
88
 
 
89
    virtual gint pagenumber ();
 
90
 
 
91
    virtual gint pagesum ();
 
92
 
 
93
    virtual void showpage (gint, gdouble);
 
94
    virtual void refresh ();
 
95
 
 
96
    virtual gdouble zoomvalue ();
 
97
 
 
98
    virtual void setzoom (const char *s);
 
99
    virtual void setzoom (double d);
 
100
 
 
101
    virtual void zoomin ();
 
102
    virtual void zoomout ();
 
103
 
 
104
    virtual void setactive (bool act);
 
105
 
 
106
    virtual gdouble scrollrate ();
 
107
 
 
108
    virtual gboolean scrollto (double s);
 
109
 
 
110
    virtual void scrollup (int times);
 
111
    virtual void scrolldown (int times);
 
112
    virtual void scrollleft (int times);
 
113
    virtual void scrollright (int times);
 
114
 
 
115
    virtual void setsize (int wid, int hei);
 
116
 
 
117
    virtual returnType process (int times, guint keyval); 
 
118
 
 
119
  protected:
 
120
    bool mReady;
 
121
 
 
122
    bool mInuse;
 
123
 
 
124
    int mType;
 
125
 
 
126
    string mFilestr;
 
127
 
 
128
    guint mProCmd;
 
129
 
 
130
    double mScrollvalue;
 
131
 
 
132
    GList *mResults;
 
133
    string mSearchstr;
 
134
 
 
135
    enum
 
136
      {
 
137
        NORMAL,
 
138
        FITWIDTH,
 
139
        FITHEIGHT,
 
140
        CUSTOM
 
141
      } mZoommode;
 
142
 
 
143
    double mZoomrate;
 
144
 
 
145
    bool mZoominit;
 
146
 
 
147
    int mRotatevalue;
 
148
 
 
149
    int mPagenum;
 
150
 
 
151
    double mPagex, mPagey;
 
152
 
 
153
    double mVrate, mHrate;
 
154
 
 
155
    int mLines, mChars;
 
156
 
 
157
    int mWidth, mHeight;
 
158
 
 
159
    GtkAdjustment *mVaj, *mHaj;
 
160
 
 
161
    // the main widget
 
162
    GtkWidget *mVbox; 
 
163
 
 
164
    // the document scrolled window
 
165
    GtkWidget *mScrollwin;
 
166
 
 
167
    // if active
 
168
    bool mActive;
 
169
 
 
170
    // status bar
 
171
    ApvlvCoreStatus *mStatus;
 
172
    };
 
173
}
 
174
 
 
175
#endif