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

akonadi/clients

main.cpp

Go to the documentation of this file.
00001 /*
00002     This file is part of Akonadi.
00003 
00004     Copyright (c) 2006 Cornelius Schumacher <schumacher@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 "out.h"
00023 #include "appendcommand.h"
00024 #include "listcommand.h"
00025 #include "fetchcommand.h"
00026 #include "deletecommand.h"
00027 #include "storecommand.h"
00028 
00029 #include <kcomponentdata.h>
00030 
00031 #include <QtCore/QCoreApplication>
00032 
00033 int main( int argc, char **argv )
00034 {
00035   QCoreApplication app( argc, argv );
00036   KComponentData kcd( "akonadi" );
00037 
00038   out() << "Akonadi Command Line Client (Version 0.1)" << endl;
00039 
00040   QString cmdarg;
00041   QString patharg;
00042   QByteArray part;
00043   QString content;
00044   if ( argc >= 2 ) cmdarg = argv[ 1 ];
00045   if ( argc >= 3 ) patharg = argv[ 2 ];
00046   if ( argc >= 4 ) part = argv[ 3 ];
00047   if ( argc >= 5 ) content = argv[ 4 ];
00048   Command *cmd = 0;
00049 
00050   if ( cmdarg == "ls" ) {
00051     cmd = new ListCommand( patharg );
00052   }
00053   else if ( cmdarg == "fetch" ) {
00054     cmd = new FetchCommand( patharg, part );
00055   }
00056   else if ( cmdarg == "rm" ) {
00057     cmd = new DeleteCommand( patharg );
00058   }
00059   else if ( cmdarg == "store" ) {
00060     cmd = new StoreCommand( patharg, content );
00061   }
00062   else if ( cmdarg == "append" ) {
00063     cmd = new AppendCommand( patharg, part, content );
00064   }
00065 
00066   if ( !cmd ) {
00067     err() << "Unknown command: '" << cmdarg << "'" << endl;
00068   } else {
00069     cmd->exec();
00070     delete cmd;
00071   }
00072 }

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
  •   doc
  • 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