1 // ePDFView - A lightweight PDF Viewer.
2 // Copyright (C) 2006, 2007, 2009 Emma's Software.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 
18 #if !defined (__JOB_LOAD_H__)
19 #define __JOB_LOAD_H__
20 
21 namespace ePDFView
22 {
23     // Forward declarations.
24     class IDocument;
25 
26     ///
27     /// @class JobLoad
28     /// @brief A background job that loads a file.
29     ///
30     /// This class is used to load and reload the PDF files.
31     ///
32     class JobLoad: public IJob
33     {
34         public:
35             JobLoad (void);
36             ~JobLoad (void);
37 
38             IDocument &getDocument (void);
39             GError *getError (void);
40             const gchar *getFileName (void);
41             const gchar *getPassword (void);
42             gboolean isReloading (void);
43             gboolean run (void);
44             void setDocument (IDocument *document);
45             void setError (GError *error);
46             void setFileName (const gchar *fileName);
47             void setPassword (const gchar *password);
48             void setReload (gboolean reload);
49 
50         protected:
51             /// The document to notify when loaded or on error.
52             IDocument *m_Document;
53             /// The error produced when loading.
54             GError *m_Error;
55             /// The file name to load or reload.
56             gchar *m_FileName;
57             /// The password to use when loading the file.
58             gchar *m_Password;
59             /// Tells if we are reloading or loading from new.
60             gboolean m_Reload;
61     };
62 }
63 
64 #endif // __JOB_LOAD_H__
65