2000-06-28 13:35:52 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2001-03-22 19:36:21 +00:00
|
|
|
* Copyright 2001 The LyX Team.
|
2000-06-28 13:35:52 +00:00
|
|
|
*
|
2001-03-22 19:36:21 +00:00
|
|
|
* ======================================================
|
2000-06-28 13:35:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef InsetMinipage_H
|
|
|
|
#define InsetMinipage_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetcollapsable.h"
|
2001-03-14 14:53:55 +00:00
|
|
|
#include "vspace.h"
|
2001-03-16 15:15:32 +00:00
|
|
|
#include <sigc++/signal_system.h>
|
2000-06-28 13:35:52 +00:00
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
/** The minipage inset
|
2000-06-28 13:35:52 +00:00
|
|
|
|
|
|
|
*/
|
|
|
|
class InsetMinipage : public InsetCollapsable {
|
|
|
|
public:
|
2001-03-14 14:53:55 +00:00
|
|
|
///
|
|
|
|
enum Position {
|
|
|
|
top,
|
2001-03-15 19:03:46 +00:00
|
|
|
center,
|
2001-03-14 14:53:55 +00:00
|
|
|
bottom
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum InnerPosition {
|
|
|
|
inner_center,
|
|
|
|
inner_top,
|
|
|
|
inner_bottom,
|
|
|
|
inner_stretch
|
|
|
|
};
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
|
|
|
InsetMinipage();
|
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
InsetMinipage(InsetMinipage const &, bool same_id = false);
|
|
|
|
///
|
2001-03-16 15:15:32 +00:00
|
|
|
~InsetMinipage();
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void write(Buffer const * buf, std::ostream & os) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void read(Buffer const * buf, LyXLex & lex);
|
2001-03-20 01:22:46 +00:00
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
Inset * clone(Buffer const &, bool same_id = false) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-03-22 19:36:21 +00:00
|
|
|
int ascent(BufferView *, LyXFont const &) const;
|
|
|
|
///
|
|
|
|
int descent(BufferView *, LyXFont const &) const;
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
string const editMessage() const;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-07-19 08:52:59 +00:00
|
|
|
bool insetAllowed(Inset::Code) const;
|
2001-03-14 14:53:55 +00:00
|
|
|
///
|
|
|
|
Position pos() const;
|
|
|
|
///
|
|
|
|
void pos(Position);
|
|
|
|
///
|
|
|
|
InnerPosition innerPos() const;
|
|
|
|
///
|
|
|
|
void innerPos(InnerPosition);
|
|
|
|
///
|
2002-01-14 16:10:29 +00:00
|
|
|
string const & pageHeight() const;
|
2001-03-14 14:53:55 +00:00
|
|
|
///
|
2002-01-14 16:10:29 +00:00
|
|
|
void pageHeight(string const &);
|
2001-03-14 14:53:55 +00:00
|
|
|
///
|
2002-01-14 16:10:29 +00:00
|
|
|
string const & pageWidth() const;
|
2001-03-16 15:15:32 +00:00
|
|
|
///
|
2002-01-14 16:10:29 +00:00
|
|
|
void pageWidth(string const &);
|
2001-03-16 15:15:32 +00:00
|
|
|
///
|
|
|
|
SigC::Signal0<void> hideDialog;
|
|
|
|
///
|
2001-03-29 15:00:20 +00:00
|
|
|
int getMaxWidth(BufferView *, UpdatableInset const *) const;
|
2001-03-22 15:45:15 +00:00
|
|
|
///
|
|
|
|
bool needFullRow() const { return false; }
|
2001-03-26 14:47:34 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
bool showInsetDialog(BufferView *) const;
|
2001-08-06 14:55:02 +00:00
|
|
|
|
2001-03-14 14:53:55 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
Position pos_;
|
|
|
|
///
|
|
|
|
InnerPosition inner_pos_;
|
|
|
|
///
|
2001-03-22 15:45:15 +00:00
|
|
|
string height_;
|
2001-03-14 14:53:55 +00:00
|
|
|
///
|
2001-03-16 15:15:32 +00:00
|
|
|
string width_;
|
2000-06-28 13:35:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|