• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

korganizer

  • sources
  • kde-4.12
  • kdepim
  • korganizer
  • plugins
  • thisdayinhistory
thisdayinhistory.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (c) 2007 Loïc Corbasson <loic.corbasson@gmail.com>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21 
22 #include "thisdayinhistory.h"
23 
24 #include <KConfig>
25 #include <KConfigGroup>
26 
27 class ThisDayInHistoryFactory : public DecorationFactory
28 {
29  public:
30  Decoration *createPluginFactory()
31  {
32  return new ThisDayInHistory;
33  }
34 };
35 
36 K_EXPORT_PLUGIN( ThisDayInHistoryFactory )
37 
38 ThisDayInHistory::ThisDayInHistory()
39 {
40  KConfig _config( QLatin1String("korganizerrc") );
41  KConfigGroup config( &_config, "This Day in History Plugin" );
42 }
43 
44 QString ThisDayInHistory::info() const
45 {
46  return i18n( "This plugin provides links to Wikipedia's "
47  "'This Day in History' pages." );
48 }
49 
50 Element::List ThisDayInHistory::createDayElements( const QDate &date )
51 {
52  Element::List elements;
53 
54  StoredElement *element =
55  new StoredElement( QLatin1String("Wikipedia link"), i18n( "This day in history" ) );
56 
57  element->setUrl(
58  QString( i18nc( "Localized Wikipedia website", "http://en.wikipedia.org/wiki/" ) +
59  date.toString( i18nc( "Qt date format used by the localized Wikipedia",
60  "MMMM_d" ) ) ) );
61 
62  elements.append( element );
63 
64  return elements;
65 }
66 
67 Element::List ThisDayInHistory::createMonthElements( const QDate &date )
68 {
69  Element::List elements;
70 
71  StoredElement *element =
72  new StoredElement( QLatin1String("Wikipedia link"), i18n( "This month in history" ) );
73 
74  element->setUrl(
75  QString( i18nc( "Localized Wikipedia website", "http://en.wikipedia.org/wiki/" ) +
76  date.toString( i18nc( "Qt date format used by the localized Wikipedia",
77  "MMMM_yyyy" ) ) ) );
78 
79  elements.append( element );
80 
81  return elements;
82 }
ThisDayInHistory
Definition: thisdayinhistory.h:28
ThisDayInHistory::createMonthElements
Element::List createMonthElements(const QDate &)
Definition: thisdayinhistory.cpp:67
StoredElement
ThisDayInHistory::info
QString info() const
Definition: thisdayinhistory.cpp:44
ThisDayInHistory::createDayElements
Element::List createDayElements(const QDate &)
Definition: thisdayinhistory.cpp:50
Decoration
thisdayinhistory.h
K_EXPORT_PLUGIN
K_EXPORT_PLUGIN(KOrganizerFactory(createAboutData())) KOrganizerPart
Definition: korganizer_part.cpp:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

korganizer

Skip menu "korganizer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal