2000-08-11 14:42:20 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-03-11 17:00:41 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file FormDocument.h
|
2002-09-05 15:14:23 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2000-08-18 14:36:12 +00:00
|
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-03-11 17:00:41 +00:00
|
|
|
|
*/
|
2000-08-11 14:42:20 +00:00
|
|
|
|
|
|
|
|
|
#ifndef FORM_DOCUMENT_H
|
|
|
|
|
#define FORM_DOCUMENT_H
|
|
|
|
|
|
2002-11-22 10:47:56 +00:00
|
|
|
|
#include "FormBase.h"
|
2003-09-05 13:15:43 +00:00
|
|
|
|
#include "BranchList.h"
|
2001-03-16 12:08:14 +00:00
|
|
|
|
|
2002-05-22 01:16:37 +00:00
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
|
2003-08-17 11:28:23 +00:00
|
|
|
|
#include "lyx_forms.h"
|
2002-05-22 01:16:37 +00:00
|
|
|
|
#include <vector>
|
|
|
|
|
|
2002-11-22 10:47:56 +00:00
|
|
|
|
class ControlDocument;
|
|
|
|
|
|
2000-08-18 14:36:12 +00:00
|
|
|
|
class BufferParams;
|
2000-08-11 14:42:20 +00:00
|
|
|
|
|
2003-08-17 11:28:23 +00:00
|
|
|
|
class FormColorpicker;
|
|
|
|
|
|
2002-06-13 13:43:51 +00:00
|
|
|
|
struct FD_document;
|
|
|
|
|
struct FD_document_paper;
|
|
|
|
|
struct FD_document_class;
|
|
|
|
|
struct FD_document_language;
|
|
|
|
|
struct FD_document_options;
|
|
|
|
|
struct FD_document_bullet;
|
2003-08-17 11:28:23 +00:00
|
|
|
|
struct FD_document_branch;
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
enum GuiColors {
|
|
|
|
|
GUI_COLOR_CHOICE = FL_FREE_COL15
|
|
|
|
|
};
|
|
|
|
|
|
2003-09-09 18:27:24 +00:00
|
|
|
|
|
2003-08-17 11:28:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-08-11 14:42:20 +00:00
|
|
|
|
|
2001-04-03 14:30:58 +00:00
|
|
|
|
/** This class provides an XForms implementation of the FormDocument dialog.
|
2003-04-02 09:49:19 +00:00
|
|
|
|
* The table-layout-form here changes values for latex-tabulars
|
2000-08-11 14:42:20 +00:00
|
|
|
|
*/
|
2002-11-22 10:47:56 +00:00
|
|
|
|
class FormDocument : public FormCB<ControlDocument, FormDB<FD_document> > {
|
2000-08-11 14:42:20 +00:00
|
|
|
|
public:
|
2002-11-22 10:47:56 +00:00
|
|
|
|
FormDocument();
|
2000-08-11 14:42:20 +00:00
|
|
|
|
private:
|
2000-11-10 17:29:47 +00:00
|
|
|
|
/** Redraw the form (on receipt of a Signal indicating, for example,
|
2001-03-05 19:02:40 +00:00
|
|
|
|
that the xforms colours have been re-mapped). */
|
2000-11-10 17:29:47 +00:00
|
|
|
|
virtual void redraw();
|
2000-10-05 07:57:00 +00:00
|
|
|
|
/// Build the dialog
|
|
|
|
|
virtual void build();
|
|
|
|
|
/// Filter the inputs
|
2002-11-22 10:47:56 +00:00
|
|
|
|
virtual ButtonPolicy::SMInput input( FL_OBJECT *, long);
|
2001-04-03 14:30:58 +00:00
|
|
|
|
/// Update the dialog.
|
2000-10-24 13:13:59 +00:00
|
|
|
|
virtual void update();
|
2001-04-03 14:30:58 +00:00
|
|
|
|
/// Apply from dialog
|
2000-10-05 07:57:00 +00:00
|
|
|
|
virtual void apply();
|
2000-08-11 14:42:20 +00:00
|
|
|
|
|
2003-08-17 11:28:23 +00:00
|
|
|
|
///
|
|
|
|
|
void branch_input(FL_OBJECT *);
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
|
|
|
|
void ChoiceBulletSize(FL_OBJECT * ob, long);
|
|
|
|
|
///
|
|
|
|
|
void InputBulletLaTeX(FL_OBJECT * ob, long);
|
|
|
|
|
///
|
2002-06-13 13:43:51 +00:00
|
|
|
|
void BulletDepth(FL_OBJECT * ob);
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
2002-06-13 13:43:51 +00:00
|
|
|
|
void BulletPanel(FL_OBJECT * ob);
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
|
|
|
|
void BulletBMTable(FL_OBJECT * ob, long);
|
|
|
|
|
///
|
|
|
|
|
void checkReadOnly();
|
|
|
|
|
///
|
2002-11-22 10:47:56 +00:00
|
|
|
|
void CheckChoiceClass();
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
|
|
|
|
void UpdateLayoutDocument(BufferParams const & params);
|
2002-04-10 14:06:14 +00:00
|
|
|
|
///
|
|
|
|
|
void UpdateClassParams(BufferParams const & params);
|
2000-08-11 14:42:20 +00:00
|
|
|
|
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
|
|
|
|
void paper_update(BufferParams const &);
|
|
|
|
|
///
|
|
|
|
|
void class_update(BufferParams const &);
|
|
|
|
|
///
|
|
|
|
|
void language_update(BufferParams const &);
|
|
|
|
|
///
|
|
|
|
|
void options_update(BufferParams const &);
|
|
|
|
|
///
|
|
|
|
|
void bullets_update(BufferParams const &);
|
2003-08-17 11:28:23 +00:00
|
|
|
|
///
|
|
|
|
|
void branch_update(BufferParams const &);
|
2000-10-05 07:57:00 +00:00
|
|
|
|
|
2001-11-07 10:25:05 +00:00
|
|
|
|
///
|
|
|
|
|
void paper_apply(BufferParams &);
|
|
|
|
|
///
|
|
|
|
|
bool class_apply(BufferParams &);
|
|
|
|
|
///
|
|
|
|
|
bool language_apply(BufferParams &);
|
|
|
|
|
///
|
|
|
|
|
bool options_apply(BufferParams &);
|
|
|
|
|
///
|
|
|
|
|
void bullets_apply(BufferParams &);
|
2003-08-17 11:28:23 +00:00
|
|
|
|
///
|
|
|
|
|
void branch_apply(BufferParams &);
|
2001-11-07 10:25:05 +00:00
|
|
|
|
|
2000-10-05 07:57:00 +00:00
|
|
|
|
/// Real GUI implementation.
|
2002-06-13 13:43:51 +00:00
|
|
|
|
boost::scoped_ptr<FD_document_paper> paper_;
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
2002-06-13 13:43:51 +00:00
|
|
|
|
boost::scoped_ptr<FD_document_class> class_;
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
2002-06-13 13:43:51 +00:00
|
|
|
|
boost::scoped_ptr<FD_document_language> language_;
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
2002-06-13 13:43:51 +00:00
|
|
|
|
boost::scoped_ptr<FD_document_options> options_;
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
2002-06-13 13:43:51 +00:00
|
|
|
|
boost::scoped_ptr<FD_document_bullet> bullets_;
|
2000-10-05 07:57:00 +00:00
|
|
|
|
///
|
2003-08-17 11:28:23 +00:00
|
|
|
|
boost::scoped_ptr<FD_document_branch> branch_;
|
|
|
|
|
///
|
2003-09-09 18:27:24 +00:00
|
|
|
|
boost::scoped_ptr<FormColorpicker> picker_;
|
2003-08-17 11:28:23 +00:00
|
|
|
|
///
|
2000-10-05 07:57:00 +00:00
|
|
|
|
int ActCell;
|
|
|
|
|
///
|
|
|
|
|
int Confirmed;
|
|
|
|
|
///
|
|
|
|
|
int current_bullet_panel;
|
|
|
|
|
///
|
|
|
|
|
int current_bullet_depth;
|
|
|
|
|
///
|
|
|
|
|
FL_OBJECT * fbullet;
|
|
|
|
|
///
|
2002-04-29 15:56:36 +00:00
|
|
|
|
std::vector<string> lang_;
|
2003-08-17 11:28:23 +00:00
|
|
|
|
/// Contains all legal branches for this doc
|
|
|
|
|
BranchList branchlist_;
|
2000-08-11 14:42:20 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|