2001-03-15 13:37:04 +00:00
|
|
|
// -*- C++ -*-
|
2001-02-12 14:09:09 +00:00
|
|
|
/**
|
|
|
|
* \file FormInclude.h
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* See the file COPYING
|
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
* \author John Levon
|
|
|
|
*/
|
|
|
|
#ifndef FORMINCLUDE_H
|
|
|
|
#define FORMINCLUDE_H
|
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
#include <boost/smart_ptr.hpp>
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
#include "FormBaseDeprecated.h"
|
|
|
|
#include "xformsBC.h"
|
2001-03-14 10:57:39 +00:00
|
|
|
#include "insets/insetinclude.h"
|
2001-02-12 14:09:09 +00:00
|
|
|
|
|
|
|
struct FD_form_include;
|
|
|
|
|
|
|
|
/** This class provides an XForms implementation of the FormInclude Dialog.
|
|
|
|
*/
|
2001-03-14 10:57:39 +00:00
|
|
|
class FormInclude : public FormBaseBD {
|
2001-02-12 14:09:09 +00:00
|
|
|
public:
|
|
|
|
///
|
|
|
|
FormInclude(LyXView *, Dialogs *);
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
enum State {
|
|
|
|
/// the browse button
|
2001-03-15 13:37:04 +00:00
|
|
|
BROWSE = 0,
|
2001-02-12 14:09:09 +00:00
|
|
|
/// the load file button
|
2001-03-15 13:37:04 +00:00
|
|
|
LOAD = 5,
|
2001-02-12 14:09:09 +00:00
|
|
|
/// the verbatim radio choice
|
2001-03-15 13:37:04 +00:00
|
|
|
VERBATIM = 10,
|
2001-02-12 14:09:09 +00:00
|
|
|
/// the input and include radio choices
|
2001-03-15 13:37:04 +00:00
|
|
|
INPUTINCLUDE = 11
|
2001-02-12 14:09:09 +00:00
|
|
|
};
|
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
/// Pointer to the actual instantiation of the ButtonController.
|
|
|
|
virtual xformsBC & bc();
|
2001-03-14 10:57:39 +00:00
|
|
|
/// Slot launching dialog to an existing inset
|
|
|
|
void showInclude(InsetInclude *);
|
|
|
|
|
|
|
|
/// Connect signals. Also perform any necessary initialisation.
|
|
|
|
virtual void connect();
|
|
|
|
/// Disconnect signals. Also perform any necessary housekeeping.
|
|
|
|
virtual void disconnect();
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
/// Build the dialog
|
|
|
|
virtual void build();
|
|
|
|
/// Filter the inputs
|
|
|
|
virtual bool input( FL_OBJECT *, long );
|
|
|
|
/// Update dialog before showing it
|
|
|
|
virtual void update();
|
|
|
|
/// Apply from dialog (modify or create inset)
|
|
|
|
virtual void apply();
|
2001-03-05 19:02:40 +00:00
|
|
|
/// Pointer to the actual instantiation of the xforms form
|
2001-02-12 14:09:09 +00:00
|
|
|
virtual FL_FORM * form() const;
|
2001-03-14 10:57:39 +00:00
|
|
|
/// bool indicates if a buffer switch took place
|
|
|
|
virtual void updateSlot(bool);
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
|
|
|
|
/// Type definition from the fdesign produced header file.
|
|
|
|
FD_form_include * build_include();
|
|
|
|
|
|
|
|
/// Real GUI implementation.
|
2001-03-15 13:37:04 +00:00
|
|
|
boost::scoped_ptr<FD_form_include> dialog_;
|
|
|
|
/// The ButtonController
|
|
|
|
ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
|
|
|
|
|
2001-03-14 10:57:39 +00:00
|
|
|
/// inset::hide connection.
|
|
|
|
Connection ih_;
|
|
|
|
|
|
|
|
/// pointer to the inset passed through showInset
|
|
|
|
InsetInclude * inset_;
|
|
|
|
/// the nitty-gritty. What is modified and passed back
|
|
|
|
InsetInclude::InsetIncludeParams params;
|
2001-02-12 14:09:09 +00:00
|
|
|
};
|
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
|
|
|
|
inline
|
|
|
|
xformsBC & FormInclude::bc()
|
|
|
|
{
|
|
|
|
return bc_;
|
|
|
|
}
|
2001-02-12 14:09:09 +00:00
|
|
|
#endif
|