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

akonadi/clients

kabcviewer.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 "kabcviewer.h"
00023 
00024 #include <QtGui/QVBoxLayout>
00025 
00026 #include <kapplication.h>
00027 #include <kcmdlineargs.h>
00028 #include <klocale.h>
00029 
00030 #include "kabc/kabcitembrowser.h"
00031 
00032 Dialog::Dialog( QWidget *parent )
00033   : KDialog( parent )
00034 {
00035   setCaption( "Contact Viewer" );
00036   setButtons( Close );
00037   showButtonSeparator( true );
00038 
00039   QWidget *wdg = new QWidget( this );
00040   QVBoxLayout *layout = new QVBoxLayout( wdg );
00041 
00042   mBrowser = new Akonadi::KABCItemBrowser( wdg );
00043   layout->addWidget( mBrowser );
00044 
00045   setMainWidget( wdg );
00046 
00047   resize( 520, 580 );
00048 }
00049 
00050 Dialog::~Dialog()
00051 {
00052 }
00053 
00054 void Dialog::loadUid( Akonadi::Item::Id uid )
00055 {
00056   mBrowser->setItem( Akonadi::Item( uid ) );
00057 }
00058 
00059 int main( int argc, char **argv )
00060 {
00061   KCmdLineArgs::init( argc, argv, "kabcviewer", 0, ki18n("KABC Viewer"), "1.0" , ki18n("A contact viewer for Akonadi"));
00062 
00063   KCmdLineOptions options;
00064   options.add("uid <uid>", ki18n( "Uid of the Akonadi contact" ));
00065   KCmdLineArgs::addCmdLineOptions( options );
00066   KApplication app;
00067 
00068   KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00069 
00070   Dialog dlg;
00071   if ( !args->isSet( "uid" ) ) {
00072     KCmdLineArgs::usage();
00073     return 1;
00074   }
00075 
00076   dlg.loadUid( args->getOption( "uid" ).toLongLong() );
00077   dlg.exec();
00078 
00079   return 0;
00080 }
00081 
00082 #include "kabcviewer.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