]> git.lyx.org Git - lyx.git/blob - src/insets/insetcite.C
3c31e29335087b4a528b174feea690231d07e7f5
[lyx.git] / src / insets / insetcite.C
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 2000 The LyX Team.
8  * 
9  * ====================================================== */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "insetcite.h"
18 #include "LyXView.h"
19 #include "BufferView.h"
20 #include "frontends/Dialogs.h"
21
22
23 InsetCitation::InsetCitation(string const & key, string const & note)
24                 : InsetCommand("cite", key, note), dialogs_(0)
25 {}
26
27
28 InsetCitation::~InsetCitation()
29 {
30         if( dialogs_ != 0 )
31                 dialogs_->hideCitation( this );
32 }
33
34 string InsetCitation::getScreenLabel() const
35 {
36         string temp("[");
37         temp += getContents();
38
39         if( !getOptions().empty() ) {
40                 temp += ", " + getOptions();
41         }
42
43         return temp + ']';
44 }
45
46 void InsetCitation::Edit(BufferView * bv, int, int, unsigned int)
47 {
48         dialogs_ = bv->owner()->getDialogs();
49         dialogs_->showCitation( this );
50 }
51