]> git.lyx.org Git - lyx.git/blob - src/insets/insetcite.C
9f31ae2186234769310c7ce4f2a0a838704f2989
[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 InsetCitation::InsetCitation(string const & key, string const & note)
23                 : InsetCommand("cite", key, note), dialogs_(0)
24 {
25 }
26
27 InsetCitation::~InsetCitation()
28 {
29         if( dialogs_ != 0 )
30                 dialogs_->hideCitation( this );
31 }
32
33 string InsetCitation::getScreenLabel() const
34 {
35         string temp("[");
36
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