~ubuntu-branches/ubuntu/quantal/kiten/quantal-updates

« back to all changes in this revision

Viewing changes to lib/DictDeinflect/entrydeinflect.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-16 13:14:44 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111216131444-fxt8pt2pha54qmdu
Tags: 4:4.7.90-0ubuntu1
New upstream beta release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 * This file is part of Kiten, a KDE Japanese Reference Tool                 *
3
 
 * Copyright (C) 2006 Joseph Kerian <jkerian@gmail.com>                      *
4
 
 * Copyright (C) 2006 Eric Kjeldergaard <kjelderg@gmail.com>                 *
5
 
 *                                                                           *
6
 
 * This library is free software; you can redistribute it and/or             *
7
 
 * modify it under the terms of the GNU Library General Public               *
8
 
 * License as published by the Free Software Foundation; either              *
9
 
 * version 2 of the License, or (at your option) any later version.          *
10
 
 *                                                                           *
11
 
 * This library is distributed in the hope that it will be useful,           *
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
14
 
 * Library General Public License for more details.                          *
15
 
 *                                                                           *
16
 
 * You should have received a copy of the GNU Library General Public License *
17
 
 * along with this library; see the file COPYING.LIB.  If not, write to      *
18
 
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
19
 
 * Boston, MA 02110-1301, USA.                                               *
20
 
 *****************************************************************************/
21
 
 
22
 
#include "entrydeinflect.h"
23
 
 
24
 
#include <KLocale>
25
 
 
26
 
#include <QString>
27
 
 
28
 
EntryDeinflect::EntryDeinflect(  const QString &correction
29
 
                               , const QString &type
30
 
                               , int index
31
 
                               , const QString &matchedEnding )
32
 
: Entry( QString( "Deinflect" ) )
33
 
, m_correction( correction )
34
 
, m_matchedEnding( matchedEnding )
35
 
, m_type( type )
36
 
, m_index( index )
37
 
{
38
 
}
39
 
 
40
 
EntryDeinflect::EntryDeinflect( const EntryDeinflect &old )
41
 
: Entry( old )
42
 
, m_correction( old.m_correction )
43
 
, m_type( old.m_type )
44
 
, m_index( old.m_index )
45
 
{
46
 
}
47
 
 
48
 
EntryDeinflect* EntryDeinflect::clone() const
49
 
{
50
 
  return new EntryDeinflect( *this );
51
 
}
52
 
 
53
 
QString EntryDeinflect::dumpEntry() const
54
 
{
55
 
  return QString();
56
 
}
57
 
 
58
 
bool EntryDeinflect::loadEntry( const QString &entry )
59
 
{
60
 
  return true;
61
 
}
62
 
 
63
 
bool EntryDeinflect::matchesQuery( const DictQuery &query ) const
64
 
{
65
 
  return query.toString().contains( m_matchedEnding );
66
 
}
67
 
 
68
 
QString EntryDeinflect::toHTML() const
69
 
{
70
 
      return QString( "<div class=\"Deinflect\">" )
71
 
              + i18n( "Possible de-conjugation %1 as %2", makeLink( m_correction ), m_type )
72
 
              + "</div>";
73
 
}