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

akonadi/clients

kabceditor.cpp

Go to the documentation of this file.
00001 /*
00002     This file is part of Akonadi.
00003 
00004     Copyright (c) 2007 Tobias Koenig <tokoe@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00019     USA.
00020 */
00021 
00022 #include "kabceditor.h"
00023 
00024 #include <QtGui/QGridLayout>
00025 #include <QtGui/QLabel>
00026 #include <QtGui/QLineEdit>
00027 #include <QtGui/QPushButton>
00028 
00029 #include <akonadi/item.h>
00030 #include <kapplication.h>
00031 #include <kcmdlineargs.h>
00032 
00033 #include "kabc/kabcitemeditor.h"
00034 
00035 Dialog::Dialog( QWidget *parent )
00036   : KDialog( parent )
00037 {
00038   setCaption( "Contact Editor" );
00039   setButtons( Close );
00040 
00041   showButtonSeparator( true );
00042 
00043   QWidget *wdg = new QWidget( this );
00044   QGridLayout *layout = new QGridLayout( wdg );
00045 
00046   mEditor = new Akonadi::KABCItemEditor( Akonadi::KABCItemEditor::EditMode, wdg );
00047   layout->addWidget( mEditor, 0, 0, 1, 3 );
00048 
00049   QLabel *label = new QLabel( "Item Id:", wdg );
00050   layout->addWidget( label, 1, 0 );
00051 
00052   mId = new QLineEdit( wdg );
00053   layout->addWidget( mId, 1, 1 );
00054 
00055   QPushButton *button = new QPushButton( "Load", wdg );
00056   layout->addWidget( button, 1, 2 );
00057 
00058   connect( button, SIGNAL( clicked() ), SLOT( load() ) );
00059 
00060   button = new QPushButton( "Save", wdg );
00061   layout->addWidget( button, 2, 2 );
00062 
00063   connect( button, SIGNAL( clicked() ), SLOT( save() ) );
00064 
00065   setMainWidget( wdg );
00066 }
00067 
00068 Dialog::~Dialog()
00069 {
00070 }
00071 
00072 void Dialog::load()
00073 {
00074   mEditor->loadContact( Akonadi::Item( mId->text().toLongLong() ) );
00075 }
00076 
00077 void Dialog::save()
00078 {
00079   mEditor->saveContact();
00080 }
00081 
00082 int main( int argc, char **argv )
00083 {
00084   KCmdLineArgs::init( argc, argv, "kabceditor", 0, ki18n("KABC Editor"), "1.0" , ki18n("A contact editor for Akonadi"));
00085   KApplication app;
00086 
00087   Dialog dlg;
00088   dlg.exec();
00089 
00090   return 0;
00091 }
00092 
00093 #include "kabceditor.moc"

akonadi/clients

Skip menu "akonadi/clients"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal