2000-07-07 07:46:37 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 2000 The LyX Team.
|
|
|
|
*
|
|
|
|
* ====================================================== */
|
2000-06-07 08:53:40 +00:00
|
|
|
|
2000-07-07 07:46:37 +00:00
|
|
|
#include <config.h>
|
2000-06-07 08:53:40 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetcite.h"
|
2000-07-14 07:52:03 +00:00
|
|
|
#include "LyXView.h"
|
|
|
|
#include "BufferView.h"
|
|
|
|
#include "frontends/Dialogs.h"
|
2000-06-07 08:53:40 +00:00
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
|
2000-06-07 08:53:40 +00:00
|
|
|
InsetCitation::InsetCitation(string const & key, string const & note)
|
2000-07-14 07:52:03 +00:00
|
|
|
: InsetCommand("cite", key, note), dialogs_(0)
|
2000-07-15 23:51:46 +00:00
|
|
|
{}
|
|
|
|
|
2000-06-07 08:53:40 +00:00
|
|
|
|
2000-07-14 07:52:03 +00:00
|
|
|
InsetCitation::~InsetCitation()
|
|
|
|
{
|
|
|
|
if( dialogs_ != 0 )
|
|
|
|
dialogs_->hideCitation( this );
|
|
|
|
}
|
|
|
|
|
2000-06-07 08:53:40 +00:00
|
|
|
string InsetCitation::getScreenLabel() const
|
|
|
|
{
|
|
|
|
string temp("[");
|
|
|
|
temp += getContents();
|
|
|
|
|
|
|
|
if( !getOptions().empty() ) {
|
|
|
|
temp += ", " + getOptions();
|
|
|
|
}
|
|
|
|
|
|
|
|
return temp + ']';
|
|
|
|
}
|
2000-07-14 07:52:03 +00:00
|
|
|
|
|
|
|
void InsetCitation::Edit(BufferView * bv, int, int, unsigned int)
|
|
|
|
{
|
|
|
|
dialogs_ = bv->owner()->getDialogs();
|
|
|
|
dialogs_->showCitation( this );
|
|
|
|
}
|
|
|
|
|