Author: poenitz
Date: Sat Mar 15 01:02:41 2008
New Revision: 23744
URL: http://www.lyx.org/trac/changeset/23744
Log:
earder cleanup; cosmetics;
Modified:
lyx-devel/trunk/src/insets/Inset.cpp
lyx-devel/trunk/src/insets/Inset.h
lyx-devel/trunk/src/insets/InsetCitation.cpp
lyx-devel/trunk/src/insets/InsetCode.h
lyx-devel/trunk/src/insets/InsetCommandParams.cpp
lyx-devel/trunk/src/insets/InsetCommandParams.h
lyx-devel/trunk/src/insets/InsetNewline.h
lyx-devel/trunk/src/insets/InsetNewpage.cpp
lyx-devel/trunk/src/insets/InsetNewpage.h
lyx-devel/trunk/src/insets/InsetQuotes.cpp
lyx-devel/trunk/src/insets/InsetQuotes.h
lyx-devel/trunk/src/insets/InsetText.cpp
Modified: lyx-devel/trunk/src/insets/Inset.cpp
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/Inset.cpp?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/Inset.cpp (original)
+++ lyx-devel/trunk/src/insets/Inset.cpp Sat Mar 15 01:02:41 2008
@@ -429,4 +429,10 @@
return theApp() ? theApp()->updateInset(this) : 0;
}
+
+docstring Inset::completionPrefix(Cursor const &) const
+{
+ return docstring();
+}
+
} // namespace lyx
Modified: lyx-devel/trunk/src/insets/Inset.h
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/Inset.h?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/Inset.h (original)
+++ lyx-devel/trunk/src/insets/Inset.h Sat Mar 15 01:02:41 2008
@@ -19,10 +19,8 @@
#include "InsetCode.h"
#include "support/strfwd.h"
-
-#include <boost/shared_ptr.hpp>
-
-#include <vector>
+#include "support/types.h"
+
namespace lyx {
@@ -31,6 +29,7 @@
class BufferParams;
class BufferView;
class Change;
+class CompletionList;
class Cursor;
class CursorSlice;
class Dimension;
@@ -59,6 +58,14 @@
namespace graphics { class PreviewLoader; }
+
+/** returns the InsetCode corresponding to the \c name.
+* Eg, insetCode("branch") == BRANCH_CODE
+* Implemented in 'Inset.cpp'.
+*/
+InsetCode insetCode(std::string const & name);
+/// the other way
+std::string insetName(InsetCode);
/// Common base class to all insets
@@ -304,20 +311,6 @@
/// return true if the inset should be removed automatically
virtual bool autoDelete() const;
- class CompletionList {
- public:
- ///
- virtual ~CompletionList() {}
- ///
- virtual bool sorted() const =0;
- ///
- virtual size_t size() const =0;
- /// returns the string shown in the gui.
- virtual docstring const & data(size_t idx) const = 0;
- /// returns the resource string used to load an icon.
- virtual std::string icon(size_t /*idx*/) const { return
std::string(); }
- };
-
/// Returns true if the inset supports completions.
virtual bool completionSupported(Cursor const &) const { return
false; }
/// Returns true if the inset supports inline completions at the
@@ -336,8 +329,7 @@
{ return 0; }
/// Returns the completion prefix to filter the suggestions for
completion.
/// This is only called if completionList returned a non-null list.
- virtual docstring completionPrefix(Cursor const &) const
- { return docstring(); }
+ virtual docstring completionPrefix(Cursor const &) const;
/// Do a completion at the cursor position. Return true on success.
/// The completion does not contain the prefix. If finished is
true, the
/// completion is final. If finished is false, completion might
only be
Modified: lyx-devel/trunk/src/insets/InsetCitation.cpp
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetCitation.cpp?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetCitation.cpp (original)
+++ lyx-devel/trunk/src/insets/InsetCitation.cpp Sat Mar 15 01:02:41
2008
@@ -56,15 +56,15 @@
}
-vector<string> const & possible_cite_commands()
+vector<string> const & possibleCiteCommands()
{
static vector<string> const possible = init_possible_cite_commands();
return possible;
}
-//FIXME See the header for the issue.
-string const default_cite_command(biblio::CiteEngine engine)
+// FIXME See the header for the issue.
+string defaultCiteCommand(biblio::CiteEngine engine)
{
string str;
switch (engine) {
@@ -85,10 +85,9 @@
}
-string const
- asValidLatexCommand(string const & input, biblio::CiteEngine
const engine)
-{
- string const default_str = default_cite_command(engine);
+string asValidLatexCommand(string const & input, biblio::CiteEngine
const engine)
+{
+ string const default_str = defaultCiteCommand(engine);
if (!InsetCitation::isCompatibleCommand(input))
return default_str;
@@ -129,7 +128,7 @@
}
-docstring getComplexLabel(Buffer const & buffer,
+docstring complexLabel(Buffer const & buffer,
string const & citeType, docstring const & keyList,
docstring const & before, docstring const & after,
biblio::CiteEngine engine)
@@ -353,7 +352,7 @@
}
-docstring const getBasicLabel(docstring const & keyList, docstring
const & after)
+docstring basicLabel(docstring const & keyList, docstring const &
after)
{
docstring keys = keyList;
docstring label;
@@ -366,8 +365,9 @@
keys = ltrim(split(keys, key, ','));
label += ", " + key;
}
- } else
+ } else {
label = keys;
+ }
if (!after.empty())
label += ", " + after;
@@ -403,7 +403,7 @@
bool InsetCitation::isCompatibleCommand(string const & cmd)
{
- vector<string> const & possibles = possible_cite_commands();
+ vector<string> const & possibles = possibleCiteCommands();
vector<string>::const_iterator const end = possibles.end();
return find(possibles.begin(), end, cmd) != end;
}
@@ -415,13 +415,13 @@
docstring const after = getParam("after");
docstring label;
- biblio::CiteEngine const engine = buffer().params().getEngine();
- label = getComplexLabel(buffer(), getCmdName(), getParam("key"),
+ biblio::CiteEngine const engine = buffer().params().citeEngine();
+ label = complexLabel(buffer(), getCmdName(), getParam("key"),
before, after, engine);
// Fallback to fail-safe
if (label.empty())
- label = getBasicLabel(getParam("key"), after);
+ label = basicLabel(getParam("key"), after);
return label;
}
@@ -435,7 +435,7 @@
void InsetCitation::updateLabels(ParIterator const &)
{
- biblio::CiteEngine const engine = buffer().params().getEngine();
+ biblio::CiteEngine const engine = buffer().params().citeEngine();
if (cache.params == params() && cache.engine == engine)
return;
@@ -510,7 +510,7 @@
// should revert to \cite[]{}
int InsetCitation::latex(odocstream & os, OutputParams const &) const
{
- biblio::CiteEngine cite_engine = buffer().params().getEngine();
+ biblio::CiteEngine cite_engine = buffer().params().citeEngine();
// FIXME UNICODE
docstring const cite_str = from_utf8(
asValidLatexCommand(getCmdName(), cite_engine));
@@ -532,7 +532,7 @@
void InsetCitation::validate(LaTeXFeatures & features) const
{
- switch (features.bufferParams().getEngine()) {
+ switch (features.bufferParams().citeEngine()) {
case biblio::ENGINE_BASIC:
break;
case biblio::ENGINE_NATBIB_AUTHORYEAR:
Modified: lyx-devel/trunk/src/insets/InsetCode.h
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetCode.h?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetCode.h (original)
+++ lyx-devel/trunk/src/insets/InsetCode.h Sat Mar 15 01:02:41 2008
@@ -15,15 +15,8 @@
#ifndef INSETCODE_H
#define INSETCODE_H
-#include <string>
-
namespace lyx {
-/** This is not quite the correct place for this enum. I think
- the correct would be to let each subclass of Inset declare
- its own enum code. Actually the notion of an InsetCode
- should be avoided, but I am not sure how this could be done
- in a cleaner way. */
enum InsetCode {
///
NO_CODE, // 0
@@ -127,14 +120,6 @@
#endif
};
-/** returns the InsetCode corresponding to the \c name.
-* Eg, insetCode("branch") == BRANCH_CODE
-* Implemented in 'Inset.cpp'.
-*/
-InsetCode insetCode(std::string const & name);
-/// the other way
-std::string insetName(InsetCode);
-
} // namespace lyx
#endif
Modified: lyx-devel/trunk/src/insets/InsetCommandParams.cpp
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetCommandParams.cpp?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetCommandParams.cpp (original)
+++ lyx-devel/trunk/src/insets/InsetCommandParams.cpp Sat Mar 15
01:02:41 2008
@@ -40,10 +40,17 @@
using namespace std;
using namespace lyx::support;
+
namespace lyx {
-ParamInfo::ParamData::ParamData(std::string const & s, ParamType t) :
- name_(s), type_(t)
+/////////////////////////////////////////////////////////////////////
+//
+// ParamInfo::ParamData
+//
+/////////////////////////////////////////////////////////////////////
+
+ParamInfo::ParamData::ParamData(std::string const & s, ParamType t)
+ : name_(s), type_(t)
{}
@@ -105,6 +112,13 @@
}
return *it; // silence warning
}
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// InsetCommandParams
+//
+/////////////////////////////////////////////////////////////////////
InsetCommandParams::InsetCommandParams(InsetCode code)
@@ -158,6 +172,12 @@
}
static const ParamInfo pi;
return pi; // to silence the warning
+}
+
+
+std::string InsetCommandParams::insetType() const
+{
+ return insetName(insetCode_);
}
Modified: lyx-devel/trunk/src/insets/InsetCommandParams.h
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetCommandParams.h?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetCommandParams.h (original)
+++ lyx-devel/trunk/src/insets/InsetCommandParams.h Sat Mar 15
01:02:41 2008
@@ -15,9 +15,9 @@
#define INSETCOMMANDPARAMS_H
#include "InsetCode.h"
+
#include "support/docstring.h"
-#include <iosfwd>
#include <string>
#include <vector>
#include <map>
@@ -121,7 +121,7 @@
explicit InsetCommandParams(InsetCode code,
std::string const & cmdName);
///
- std::string insetType() const { return insetName(insetCode_); }
+ std::string insetType() const;
///
InsetCode code() const { return insetCode_; }
///
Modified: lyx-devel/trunk/src/insets/InsetNewline.h
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetNewline.h?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetNewline.h (original)
+++ lyx-devel/trunk/src/insets/InsetNewline.h Sat Mar 15 01:02:41 2008
@@ -12,65 +12,72 @@
#ifndef INSET_NEWLINE_H
#define INSET_NEWLINE_H
+#include "Inset.h"
-#include "Inset.h"
+#include "support/docstring.h"
#include "support/gettext.h"
namespace lyx {
-class InsetNewline : public Inset {
+class InsetNewline : public Inset
+{
public:
-
+ ///
InsetNewline() {}
-
+ ///
InsetCode lyxCode() const { return NEWLINE_CODE; }
-
+ ///
void metrics(MetricsInfo &, Dimension &) const;
-
- virtual void draw(PainterInfo & pi, int x, int y) const;
-
+ ///
+ void draw(PainterInfo & pi, int x, int y) const;
+ ///
int latex(odocstream &, OutputParams const &) const;
-
+ ///
int plaintext(odocstream &, OutputParams const &) const;
-
+ ///
int docbook(odocstream &, OutputParams const &) const;
-
- virtual void read(Lexer & lex);
-
- virtual void write(std::ostream & os) const;
+ ///
+ void read(Lexer & lex);
+ ///
+ void write(std::ostream & os) const;
/// We don't need \begin_inset and \end_inset
- virtual bool directWrite() const { return true; }
+ bool directWrite() const { return true; }
/// is this equivalent to a space (which is BTW different from
/// a line separator)?
bool isSpace() const;
-
- virtual docstring insetLabel() const { return docstring(); }
-
- virtual std::string getLyXName() const { return "\\newline"; }
-
- virtual std::string getCmdName() const { return "\\\\"; }
-
- virtual ColorCode ColorName() const { return Color_eolmarker; }
+ ///
+ docstring insetLabel() const { return docstring(); }
+ ///
+ std::string getLyXName() const { return "\\newline"; }
+ ///
+ std::string getCmdName() const { return "\\\\"; }
+ ///
+ ColorCode ColorName() const { return Color_eolmarker; }
private:
+ ///
Inset * clone() const { return new InsetNewline(*this); }
};
-class InsetLinebreak : public InsetNewline {
+
+class InsetLinebreak : public InsetNewline
+{
public:
+ ///
InsetLinebreak() {}
-
+ ///
docstring insetLabel() const { return _("line break"); }
-
+ ///
std::string getLyXName() const { return "\\linebreak"; }
-
+ ///
std::string getCmdName() const { return "\\linebreak{}"; }
-
+ ///
ColorCode ColorName() const { return Color_pagebreak; }
private:
- virtual Inset * clone() const { return new InsetLinebreak(*this); }
+ ///
+ Inset * clone() const { return new InsetLinebreak(*this); }
};
Modified: lyx-devel/trunk/src/insets/InsetNewpage.cpp
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetNewpage.cpp?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetNewpage.cpp (original)
+++ lyx-devel/trunk/src/insets/InsetNewpage.cpp Sat Mar 15 01:02:41
2008
@@ -26,6 +26,7 @@
#include "support/gettext.h"
using namespace std;
+
namespace lyx {
Modified: lyx-devel/trunk/src/insets/InsetNewpage.h
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetNewpage.h?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetNewpage.h (original)
+++ lyx-devel/trunk/src/insets/InsetNewpage.h Sat Mar 15 01:02:41 2008
@@ -12,86 +12,97 @@
#ifndef INSET_NEWPAGE_H
#define INSET_NEWPAGE_H
+#include "Inset.h"
-#include "Inset.h"
+#include "support/docstring.h"
#include "support/gettext.h"
namespace lyx {
-class InsetNewpage : public Inset {
+class InsetNewpage : public Inset
+{
public:
+ ///
InsetNewpage() {}
-
+ ///
InsetCode lyxCode() const { return NEWPAGE_CODE; }
-
+ ///
void metrics(MetricsInfo &, Dimension &) const;
-
+ ///
void draw(PainterInfo & pi, int x, int y) const;
-
+ ///
int latex(odocstream &, OutputParams const &) const;
-
+ ///
int plaintext(odocstream &, OutputParams const &) const;
-
+ ///
int docbook(odocstream &, OutputParams const &) const;
-
+ ///
void read(Lexer & lex);
-
+ ///
void write(std::ostream & os) const;
/// We don't need \begin_inset and \end_inset
bool directWrite() const { return true; }
-
+ ///
DisplayType display() const { return AlignCenter; }
-
- virtual docstring insetLabel() const { return _("New Page"); }
-
- virtual std::string getCmdName() const { return "\\newpage"; }
-
- virtual ColorCode ColorName() const { return Color_newpage; }
-
+ ///
+ docstring insetLabel() const { return _("New Page"); }
+ ///
+ std::string getCmdName() const { return "\\newpage"; }
+ ///
+ ColorCode ColorName() const { return Color_newpage; }
private:
+ ///
Inset * clone() const { return new InsetNewpage(*this); }
};
-class InsetPagebreak : public InsetNewpage {
+class InsetPagebreak : public InsetNewpage
+{
public:
+ ///
InsetPagebreak() {}
-
+ ///
docstring insetLabel() const { return _("Page Break"); }
-
+ ///
std::string getCmdName() const { return "\\pagebreak"; }
-
+ ///
ColorCode ColorName() const { return Color_pagebreak; }
-
private:
- virtual Inset * clone() const { return new InsetPagebreak(*this); }
+ ///
+ Inset * clone() const { return new InsetPagebreak(*this); }
};
-class InsetClearPage : public InsetNewpage {
+class InsetClearPage : public InsetNewpage
+{
public:
+ ///
InsetClearPage() {}
-
+ ///
docstring insetLabel() const { return _("Clear Page"); }
-
+ ///
std::string getCmdName() const { return "\\clearpage"; }
private:
- virtual Inset * clone() const { return new InsetClearPage(*this); }
+ ///
+ Inset * clone() const { return new InsetClearPage(*this); }
};
-class InsetClearDoublePage : public InsetNewpage {
+class InsetClearDoublePage : public InsetNewpage
+{
public:
+ ///
InsetClearDoublePage() {}
-
+ ///
docstring insetLabel() const { return _("Clear Double Page"); }
-
+ ///
std::string getCmdName() const { return "\\cleardoublepage"; }
private:
- virtual Inset * clone() const { return new
InsetClearDoublePage(*this); }
+ ///
+ Inset * clone() const { return new InsetClearDoublePage(*this); }
};
} // namespace lyx
Modified: lyx-devel/trunk/src/insets/InsetQuotes.cpp
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetQuotes.cpp?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetQuotes.cpp (original)
+++ lyx-devel/trunk/src/insets/InsetQuotes.cpp Sat Mar 15 01:02:41
2008
@@ -88,7 +88,7 @@
}
-InsetQuotes::InsetQuotes(quote_language l, quote_side s,
quote_times t)
+InsetQuotes::InsetQuotes(QuoteLanguage l, QuoteSide s, QuoteTimes t)
: language_(l), side_(s), times_(t)
{
}
@@ -97,14 +97,14 @@
InsetQuotes::InsetQuotes(Buffer const & buf, char_type c)
: language_(buf.params().quotes_language),
times_(buf.params().quotes_times)
{
- getPosition(c);
-}
-
-
-InsetQuotes::InsetQuotes(char_type c, quote_language l, quote_times
t)
+ setSide(c);
+}
+
+
+InsetQuotes::InsetQuotes(char_type c, QuoteLanguage l, QuoteTimes t)
: language_(l), times_(t)
{
- getPosition(c);
+ setSide(c);
}
@@ -114,17 +114,17 @@
}
-void InsetQuotes::getPosition(char_type c)
+void InsetQuotes::setSide(char_type c)
{
// Decide whether left or right
switch (c) {
case ' ':
case '(':
case '[':
- side_ = LeftQ; // left quote
+ side_ = LeftQuote; // left quote
break;
default:
- side_ = RightQ; // right quote
+ side_ = RightQuote; // right quote
}
}
@@ -142,48 +142,48 @@
for (i = 0; i < 6; ++i) {
if (str[0] == language_char[i]) {
- language_ = quote_language(i);
+ language_ = QuoteLanguage(i);
break;
}
}
if (i >= 6) {
lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
" bad language specification." << endl;
- language_ = EnglishQ;
+ language_ = EnglishQuotes;
}
for (i = 0; i < 2; ++i) {
if (str[1] == side_char[i]) {
- side_ = quote_side(i);
+ side_ = QuoteSide(i);
break;
}
}
if (i >= 2) {
lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
" bad side specification." << endl;
- side_ = LeftQ;
+ side_ = LeftQuote;
}
for (i = 0; i < 2; ++i) {
if (str[2] == times_char[i]) {
- times_ = quote_times(i);
+ times_ = QuoteTimes(i);
break;
}
}
if (i >= 2) {
lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
" bad times specification." << endl;
- times_ = DoubleQ;
- }
-}
-
-
-docstring InsetQuotes::dispString() const
+ times_ = DoubleQuotes;
+ }
+}
+
+
+docstring InsetQuotes::displayString() const
{
Language const * loclang = buffer().params().language;
string disp;
disp += quote_char[quote_index[side_][language_]];
- if (times_ == DoubleQ)
+ if (times_ == DoubleQuotes)
disp += disp;
@@ -215,8 +215,8 @@
retdisp = from_ascii(disp);
// in french, spaces are added inside double quotes
- if (times_ == DoubleQ && prefixIs(loclang->code(), "fr")) {
- if (side_ == LeftQ)
+ if (times_ == DoubleQuotes && prefixIs(loclang->code(), "fr")) {
+ if (side_ == LeftQuote)
retdisp += ' ';
else
retdisp.insert(size_t(0), 1, ' ');
@@ -236,7 +236,7 @@
dim.wid = 0;
// FIXME: should we add a language or a font parameter member?
- docstring const text = dispString();
+ docstring const text = displayString();
for (string::size_type i = 0; i < text.length(); ++i) {
if (text[i] == ' ')
dim.wid += fm.width('i');
@@ -251,7 +251,7 @@
void InsetQuotes::draw(PainterInfo & pi, int x, int y) const
{
// FIXME: should we add a language or a font parameter member?
- docstring const text = dispString();
+ docstring const text = displayString();
if (text.length() == 2 && text[0] == text[1]) {
pi.pain.text(x, y, text[0], pi.base.font);
@@ -290,9 +290,9 @@
const int quoteind = quote_index[side_][language_];
string qstr;
- if (language_ == FrenchQ && times_ == DoubleQ
+ if (language_ == FrenchQuotes && times_ == DoubleQuotes
&& prefixIs(runparams.local_font->language()->code(), "fr")) {
- if (side_ == LeftQ)
+ if (side_ == LeftQuote)
qstr = "\\og "; //the spaces are important here
else
qstr = " \\fg{}"; //and here
@@ -319,7 +319,7 @@
int InsetQuotes::plaintext(odocstream & os, OutputParams const &)
const
{
- docstring const str = dispString();
+ docstring const str = displayString();
os << str;
return str.size();
}
@@ -327,13 +327,13 @@
int InsetQuotes::docbook(odocstream & os, OutputParams const &) const
{
- if (times_ == DoubleQ) {
- if (side_ == LeftQ)
+ if (times_ == DoubleQuotes) {
+ if (side_ == LeftQuote)
os << "“";
else
os << "”";
} else {
- if (side_ == LeftQ)
+ if (side_ == LeftQuote)
os << "‘";
else
os << "’";
@@ -344,7 +344,7 @@
void InsetQuotes::textString(odocstream & os) const
{
- os << dispString();
+ os << displayString();
}
@@ -359,7 +359,7 @@
if (!use_babel
#endif
&& lyxrc.fontenc != "T1") {
- if (times_ == SingleQ)
+ if (times_ == SingleQuotes)
switch (type) {
case ',': features.require("quotesinglbase"); break;
case '<': features.require("guilsinglleft"); break;
Modified: lyx-devel/trunk/src/insets/InsetQuotes.h
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetQuotes.h?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetQuotes.h (original)
+++ lyx-devel/trunk/src/insets/InsetQuotes.h Sat Mar 15 01:02:41 2008
@@ -12,52 +12,47 @@
#ifndef INSET_QUOTES_H
#define INSET_QUOTES_H
-
#include "Inset.h"
-#include "support/types.h"
+#include "support/docstring.h"
namespace lyx {
-class BufferParams;
-class Language;
-class LaTeXFeatures;
-
-
/** Quotes.
Used for the various quotes. German, English, French, all either
double or single **/
-class InsetQuotes : public Inset {
+class InsetQuotes : public Inset
+{
public:
///
- enum quote_language {
+ enum QuoteLanguage {
///
- EnglishQ,
+ EnglishQuotes,
///
- SwedishQ,
+ SwedishQuotes,
///
- GermanQ,
+ GermanQuotes,
///
- PolishQ,
+ PolishQuotes,
///
- FrenchQ,
+ FrenchQuotes,
///
- DanishQ
+ DanishQuotes
};
///
- enum quote_side {
+ enum QuoteSide {
///
- LeftQ,
+ LeftQuote,
///
- RightQ
+ RightQuote
};
///
- enum quote_times {
+ enum QuoteTimes {
///
- SingleQ,
+ SingleQuotes,
///
- DoubleQ
+ DoubleQuotes
};
/** The constructor works like this:
@@ -71,7 +66,7 @@
/// Create the right quote inset after character c
InsetQuotes(Buffer const & buffer, char_type c);
/// Direct access to inner/outer quotation marks
- InsetQuotes(char_type c, quote_language l, quote_times t);
+ InsetQuotes(char_type c, QuoteLanguage l, QuoteTimes t);
///
docstring name() const;
///
@@ -103,23 +98,23 @@
///
Inset * clone() const { return new InsetQuotes(*this); }
- ///
- quote_language language_;
- ///
- quote_side side_;
- ///
- quote_times times_;
-
/** The parameters of the constructor are the language, the
side and the multiplicity of the quote.
*/
- InsetQuotes(quote_language l, quote_side s, quote_times t);
+ InsetQuotes(QuoteLanguage l, QuoteSide s, QuoteTimes t);
/// Decide whether we need left or right quotation marks
- void getPosition(char_type c);
+ void setSide(char_type c);
///
void parseString(std::string const &);
///
- docstring dispString() const;
+ docstring displayString() const;
+
+ ///
+ QuoteLanguage language_;
+ ///
+ QuoteSide side_;
+ ///
+ QuoteTimes times_;
};
} // namespace lyx
Modified: lyx-devel/trunk/src/insets/InsetText.cpp
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetText.cpp?rev=23744
=
=
=
=
=
=
=
=
======================================================================
--- lyx-devel/trunk/src/insets/InsetText.cpp (original)
+++ lyx-devel/trunk/src/insets/InsetText.cpp Sat Mar 15 01:02:41 2008
@@ -11,38 +11,38 @@
#include <config.h>
#include "InsetText.h"
-#include "InsetNewline.h"
-
+
+#include "buffer_funcs.h"
#include "Buffer.h"
-#include "buffer_funcs.h"
#include "BufferParams.h"
#include "BufferView.h"
+#include "CompletionList.h"
#include "CoordCache.h"
+#include "Cursor.h"
#include "CutAndPaste.h"
-#include "Cursor.h"
#include "DispatchResult.h"
#include "ErrorList.h"
#include "FuncRequest.h"
#include "InsetList.h"
#include "Intl.h"
+#include "Lexer.h"
#include "lyxfind.h"
-#include "Lexer.h"
#include "LyXRC.h"
-#include "Text.h"
#include "MetricsInfo.h"
-#include "OutputParams.h"
#include "output_docbook.h"
#include "output_latex.h"
+#include "OutputParams.h"
#include "output_plaintext.h"
+#include "paragraph_funcs.h"
#include "Paragraph.h"
-#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
#include "ParIterator.h"
#include "Row.h"
#include "sgml.h"
+#include "TexRow.h"
#include "TextClass.h"
+#include "Text.h"
#include "TextMetrics.h"
-#include "TexRow.h"
#include "WordList.h"
#include "frontends/alert.h"
@@ -66,7 +66,7 @@
using graphics::PreviewLoader;
-class TextCompletionList : public Inset::CompletionList
+class TextCompletionList : public CompletionList
{
public:
///
@@ -529,13 +529,9 @@
}
-Inset::CompletionList const * InsetText::createCompletionList(
- Cursor const & cur) const
-{
- if (!completionSupported(cur))
- return 0;
-
- return new TextCompletionList(cur);
+CompletionList const * InsetText::createCompletionList(Cursor const
& cur) const
+{
+ return completionSupported(cur) ? new TextCompletionList(cur) : 0;
}