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

kaddressbook

  • sources
  • kde-4.12
  • kdepim
  • kaddressbook
kaddressbookpart.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KAddressBook.
3 
4  Copyright (c) 2009 Laurent Montel <montel@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program 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
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License along
17  with this program; if not, write to the Free Software Foundation, Inc.,
18  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20 
21 #include "kaddressbookpart.h"
22 #include "aboutdata.h"
23 #include "mainwidget.h"
24 #include "startup.h"
25 
26 #include <KComponentData>
27 #include <KDebug>
28 #include <KIconLoader>
29 #include <KLocale>
30 #include <KPluginFactory>
31 #include <KParts/StatusBarExtension>
32 #include <KAction>
33 #include <KActionCollection>
34 
35 #include <QVBoxLayout>
36 
37 K_PLUGIN_FACTORY( KAddressBookFactory, registerPlugin<KAddressBookPart>(); )
38 K_EXPORT_PLUGIN( KAddressBookFactory( AboutData() ) )
39 
40 KAddressBookPart::KAddressBookPart( QWidget *parentWidget, QObject *parent,
41  const QVariantList & )
42  : KParts::ReadOnlyPart( parent )
43 {
44  setComponentData( KAddressBookFactory::componentData() );
45 
46  KAddressBook::insertLibraryCatalogues();
47 
48  KIconLoader::global()->addAppDir( QLatin1String("kaddressbook") );
49  // create a canvas to insert our widget
50  QWidget *canvas = new QWidget( parentWidget );
51  canvas->setFocusPolicy( Qt::ClickFocus );
52  setWidget( canvas );
53  QVBoxLayout *topLayout = new QVBoxLayout( canvas );
54 
55  mMainWidget = new MainWidget( this, canvas );
56  initAction();
57 
58  topLayout->addWidget( mMainWidget );
59  topLayout->setMargin(0);
60  setXMLFile( QLatin1String("kaddressbookui.rc") );
61 }
62 
63 void KAddressBookPart::initAction()
64 {
65  KAction *action = new KAction( KIcon( QLatin1String("configure") ), i18n( "&Configure KAddressBook..." ), this );
66  actionCollection()->addAction( QLatin1String("kaddressbook_configure"), action );
67  connect( action, SIGNAL(triggered(bool)), mMainWidget,
68  SLOT(configure()) );
69 }
70 
71 void KAddressBookPart::newContact()
72 {
73  mMainWidget->newContact();
74 }
75 
76 void KAddressBookPart::newGroup()
77 {
78  mMainWidget->newGroup();
79 }
80 
81 KAddressBookPart::~KAddressBookPart()
82 {
83 }
84 
85 bool KAddressBookPart::openFile()
86 {
87  return false;
88 }
89 
90 void KAddressBookPart::guiActivateEvent( KParts::GUIActivateEvent *e )
91 {
92  kDebug();
93  KParts::ReadOnlyPart::guiActivateEvent( e );
94 }
95 
96 #include "kaddressbookpart.moc"
K_EXPORT_PLUGIN
K_EXPORT_PLUGIN(KAddressBookFactory(AboutData())) KAddressBookPart
Definition: kaddressbookpart.cpp:38
KAddressBookPart::KAddressBookPart
KAddressBookPart(QWidget *parentWidget, QObject *parent, const QVariantList &)
KAddressBookPart::~KAddressBookPart
virtual ~KAddressBookPart()
Definition: kaddressbookpart.cpp:81
QObject
MainWidget::newContact
void newContact()
Definition: mainwidget.cpp:668
AboutData
Definition: aboutdata.h:28
KAddressBookPart::newContact
void newContact()
Definition: kaddressbookpart.cpp:71
startup.h
aboutdata.h
KAddressBookPart::openFile
virtual bool openFile()
Definition: kaddressbookpart.cpp:85
mainwidget.h
KAddressBook::insertLibraryCatalogues
void insertLibraryCatalogues()
Definition: startup.cpp:6
kaddressbookpart.h
KAddressBookPart::newGroup
void newGroup()
Definition: kaddressbookpart.cpp:76
KAddressBookPart::initAction
void initAction()
Definition: kaddressbookpart.cpp:63
MainWidget::newGroup
void newGroup()
Definition: mainwidget.cpp:673
KAddressBookPart::guiActivateEvent
virtual void guiActivateEvent(KParts::GUIActivateEvent *)
Definition: kaddressbookpart.cpp:90
MainWidget
Definition: mainwidget.h:63
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

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