2000-08-11 14:42:20 +00:00
|
|
|
|
// -*- C++ -*-
|
2000-08-18 14:36:12 +00:00
|
|
|
|
/* This file is part of
|
|
|
|
|
* ======================================================
|
|
|
|
|
*
|
|
|
|
|
* LyX, The Document Processor
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2000 The LyX Team.
|
|
|
|
|
*
|
|
|
|
|
* @author J<EFBFBD>rgen Vigna
|
|
|
|
|
*
|
|
|
|
|
*======================================================*/
|
2000-08-11 14:42:20 +00:00
|
|
|
|
|
|
|
|
|
#ifndef FORM_DOCUMENT_H
|
|
|
|
|
#define FORM_DOCUMENT_H
|
|
|
|
|
|
|
|
|
|
#include "DialogBase.h"
|
|
|
|
|
#include "support/utility.hpp"
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG_
|
|
|
|
|
#pragma interface
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
class LyXView;
|
|
|
|
|
class Dialogs;
|
|
|
|
|
class Combox;
|
2000-08-18 14:36:12 +00:00
|
|
|
|
class BufferParams;
|
|
|
|
|
class PreferencesPolicy;
|
|
|
|
|
template <class x> class ButtonController;
|
2000-08-11 14:42:20 +00:00
|
|
|
|
|
|
|
|
|
struct FD_form_tabbed_document;
|
|
|
|
|
struct FD_form_doc_paper;
|
|
|
|
|
struct FD_form_doc_class;
|
|
|
|
|
struct FD_form_doc_language;
|
|
|
|
|
struct FD_form_doc_options;
|
|
|
|
|
struct FD_form_doc_bullet;
|
|
|
|
|
|
|
|
|
|
#ifdef SIGC_CXX_NAMESPACES
|
|
|
|
|
using SigC::Connection;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/** This class provides an XForms implementation of the FormDocument Popup.
|
|
|
|
|
The table-layout-form here changes values for latex-tabulars
|
|
|
|
|
*/
|
|
|
|
|
class FormDocument : public DialogBase, public noncopyable {
|
|
|
|
|
public:
|
|
|
|
|
/// #FormDocument x(Communicator ..., Popups ...);#
|
|
|
|
|
FormDocument(LyXView *, Dialogs *);
|
|
|
|
|
///
|
|
|
|
|
~FormDocument();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
static int WMHideCB(FL_FORM *, void *);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
static void OKCB(FL_OBJECT *, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
static void ApplyCB(FL_OBJECT *, long);
|
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
static void CancelCB(FL_OBJECT *, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
static void RestoreCB(FL_OBJECT *, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
static void InputCB(FL_OBJECT *, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
static void ChoiceClassCB(FL_OBJECT *, long);
|
|
|
|
|
///
|
|
|
|
|
static void ChoiceBulletSizeCB(FL_OBJECT * ob, long);
|
|
|
|
|
///
|
|
|
|
|
static void InputBulletLaTeXCB(FL_OBJECT * ob, long);
|
|
|
|
|
///
|
|
|
|
|
static void BulletDepthCB(FL_OBJECT * ob, long);
|
|
|
|
|
///
|
|
|
|
|
static void BulletPanelCB(FL_OBJECT * ob, long);
|
|
|
|
|
///
|
|
|
|
|
static void BulletBMTableCB(FL_OBJECT * ob, long);
|
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
enum EnumPopupStatus {
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
POPUP_UNMODIFIED,
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
POPUP_MODIFIED,
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
POPUP_READONLY
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private:
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void EnableDocumentLayout();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void DisableDocumentLayout();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
bool CheckDocumentInput(FL_OBJECT * ob, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void ChoiceBulletSize(FL_OBJECT * ob, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void InputBulletLaTeX(FL_OBJECT * ob, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void BulletDepth(FL_OBJECT * ob, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void BulletPanel(FL_OBJECT * ob, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void BulletBMTable(FL_OBJECT * ob, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void checkMarginValues();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
void CheckChoiceClass(FL_OBJECT * ob, long);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
void UpdateLayoutDocument(BufferParams const & params);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
|
2000-08-11 14:42:20 +00:00
|
|
|
|
/// Create the popup if necessary, update it and display it.
|
|
|
|
|
void show();
|
|
|
|
|
/// Hide the popup.
|
|
|
|
|
void hide();
|
|
|
|
|
/// Update the popup.
|
|
|
|
|
void update();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
void paper_update(BufferParams const &);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
void class_update(BufferParams const &);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
void language_update(BufferParams const &);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
void options_update(BufferParams const &);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-18 14:36:12 +00:00
|
|
|
|
void bullets_update(BufferParams const &);
|
2000-08-11 14:42:20 +00:00
|
|
|
|
/// Apply from popup
|
|
|
|
|
void apply();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void paper_apply();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
bool class_apply();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
bool language_apply();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
bool options_apply();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
void bullets_apply();
|
|
|
|
|
/// Cancel from popup
|
|
|
|
|
void cancel();
|
|
|
|
|
/// Build the popup
|
|
|
|
|
void build();
|
|
|
|
|
/// Explicitly free the popup.
|
|
|
|
|
void free();
|
|
|
|
|
|
|
|
|
|
/// Typedefinitions from the fdesign produced Header file
|
|
|
|
|
FD_form_tabbed_document * build_tabbed_document();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_paper * build_doc_paper();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_class * build_doc_class();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_language * build_doc_language();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_options * build_doc_options();
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_bullet * build_doc_bullet();
|
|
|
|
|
|
|
|
|
|
/// Real GUI implementation.
|
|
|
|
|
FD_form_tabbed_document * dialog_;
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_paper * paper_;
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_class * class_;
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_language * language_;
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_options * options_;
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
FD_form_doc_bullet * bullets_;
|
|
|
|
|
/// Which LyXView do we belong to?
|
|
|
|
|
LyXView * lv_;
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
2000-08-11 14:42:20 +00:00
|
|
|
|
Dialogs * d_;
|
|
|
|
|
/// Update connection.
|
|
|
|
|
Connection u_;
|
|
|
|
|
/// Hide connection.
|
|
|
|
|
Connection h_;
|
|
|
|
|
/// has form contents changed? Used to control OK/Apply
|
|
|
|
|
EnumPopupStatus status;
|
2000-08-14 15:31:16 +00:00
|
|
|
|
///
|
|
|
|
|
int ActCell;
|
|
|
|
|
///
|
|
|
|
|
int Confirmed;
|
|
|
|
|
///
|
|
|
|
|
int current_bullet_panel;
|
|
|
|
|
///
|
|
|
|
|
int current_bullet_depth;
|
2000-08-11 14:42:20 +00:00
|
|
|
|
///
|
|
|
|
|
FL_OBJECT * fbullet;
|
|
|
|
|
///
|
|
|
|
|
Combox * combo_language;
|
2000-08-18 14:36:12 +00:00
|
|
|
|
///
|
|
|
|
|
ButtonController<PreferencesPolicy> * bc_;
|
2000-08-11 14:42:20 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|