]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlEmbeddedFiles.h
Embedding: add 'addFile' to embed arbitrary file, fix a few bugs along the way
[lyx.git] / src / frontends / controllers / ControlEmbeddedFiles.h
1 // -*- C++ -*-
2 /**
3  * \file ControlEmbeddedFiles.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Bo Peng
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CONTROLEMBEDDEDFILES_H
13 #define CONTROLEMBEDDEDFILES_H
14
15 #include "Dialog.h"
16 #include "EmbeddedFiles.h"
17
18 namespace lyx {
19
20 namespace frontend {
21
22 class ControlEmbeddedFiles : public Dialog::Controller {
23 public:
24         ///
25         ControlEmbeddedFiles(Dialog &);
26         ///
27         virtual ~ControlEmbeddedFiles() {}
28         ///
29         EmbeddedFiles const & embeddedFiles() const { return *embedded_files; }
30         EmbeddedFiles & embeddedFiles() { return *embedded_files; }
31         ///
32         virtual bool initialiseParams(std::string const &);
33         /// obtain embedded files from buffer
34         void updateEmbeddedFiles();
35         ///
36         virtual void clearParams() {};
37         ///
38         virtual bool isBufferDependent() const { return true; }
39         ///
40         bool canApply() const { return true; }
41         ///
42         virtual bool canApplyToReadOnly() const { return true; }
43         ///
44         void setMessage(std::string const & msg) { message_ = msg; }
45         ///
46         void dispatchParams();
47         ///
48         void goTo(EmbeddedFile const & item);
49         ///
50         void view(EmbeddedFile const & item);
51         ///
52         docstring const browseFile();
53
54 protected:
55         // directly handle buffer embedded files
56         EmbeddedFiles * embedded_files;
57         //
58         std::string message_;
59 };
60
61 } // namespace frontend
62 } // namespace lyx
63
64 #endif // CONTROLEMBEDDEDFILES_H