kitchensync Library API Documentation

actionpart.cpp

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
00005     Copyright (c) 2002 Maximilian Reiß <harlekin@handhelds.org>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020     Boston, MA 02111-1307, USA.
00021 */
00022 
00023 #include <kdebug.h>
00024 
00025 #include "actionpart.h"
00026 
00027 #include "core.h"
00028 
00029 using namespace KSync;
00030 
00031 ActionPart::ActionPart( QObject *parent, const char *name )
00032   : KParts::Part( parent, name )
00033 {
00034     m_window = 0;
00035 
00036     if ( parent && parent->inherits("KSync::Core") )
00037         m_window = static_cast<KSync::Core *>( parent );
00038 }
00039 
00040 ActionPart::~ActionPart()
00041 {
00042 }
00043 
00044 int ActionPart::syncProgress() const
00045 {
00046     return m_prog;
00047 }
00048 
00049 int ActionPart::syncStatus() const
00050 {
00051     return m_stat;
00052 }
00053 
00054 bool ActionPart::hasGui() const
00055 {
00056     return false;
00057 }
00058 
00059 bool ActionPart::configIsVisible() const
00060 {
00061     return false;
00062 }
00063 
00064 bool ActionPart::canSync() const
00065 {
00066     return false;
00067 }
00068 
00069 QWidget *ActionPart::configWidget()
00070 {
00071     return 0;
00072 }
00073 
00074 void ActionPart::sync( const SynceeList& , SynceeList& )
00075 {
00076     done();
00077 }
00078 
00079 Core* ActionPart::core()
00080 {
00081     return m_window;
00082 }
00083 
00084 Core* ActionPart::core() const
00085 {
00086     return m_window;
00087 }
00088 
00089 void ActionPart::progress( int pro )
00090 {
00091     m_prog = pro;
00092     emit sig_progress( this, pro );
00093 }
00094 
00095 void ActionPart::progress( const Progress& pro )
00096 {
00097     emit sig_progress( this,pro );
00098 }
00099 
00100 void ActionPart::error( const Error& err )
00101 {
00102     emit sig_error( this, err );
00103 }
00104 
00105 void ActionPart::done()
00106 {
00107     m_stat = SYNC_DONE;
00108     emit sig_syncStatus( this, m_stat );
00109 }
00110 
00111 void ActionPart::slotConfigOk()
00112 {
00113 }
00114 
00115 void ActionPart::connectPartChange( const char *slot )
00116 {
00117     connect( core(), SIGNAL( partChanged( ActionPart * ) ), slot );
00118 }
00119 
00120 void ActionPart::connectPartProgress( const char *slot )
00121 {
00122     connect( core(), SIGNAL( partProgress( ActionPart *, const Progress & ) ),
00123              slot );
00124 }
00125 
00126 void ActionPart::connectPartError( const char *slot )
00127 {
00128     connect( core(), SIGNAL( partError( ActionPart *, const Error & ) ),
00129              slot );
00130 }
00131 
00132 void ActionPart::connectKonnectorProgress( const char *slot )
00133 {
00134     connect( core(),
00135              SIGNAL( konnectorProgress( Konnector *, const Progress & ) ),
00136              slot );
00137 }
00138 
00139 void ActionPart::connectKonnectorError( const char *slot )
00140 {
00141     connect( core(), SIGNAL( konnectorError( Konnector *, const Error & ) ),
00142              slot );
00143 }
00144 
00145 void ActionPart::connectSyncProgress( const char *slot )
00146 {
00147     connect( core(), SIGNAL( syncProgress( ActionPart *, int, int ) ), slot );
00148 }
00149 
00150 void ActionPart::connectProfileChanged( const char *slot )
00151 {
00152     connect( core(), SIGNAL( profileChanged( const Profile & ) ), slot );
00153 }
00154 
00155 void ActionPart::connectKonnectorDownloaded( const char *slot )
00156 {
00157     connect( core(),
00158              SIGNAL( konnectorDownloaded( Konnector *, Syncee::PtrList ) ),
00159              slot );
00160 }
00161 
00162 void ActionPart::connectStartSync( const char *slot )
00163 {
00164     connect( core(), SIGNAL( startSync() ), slot );
00165 }
00166 
00167 void ActionPart::connectDoneSync( const char *slot )
00168 {
00169     connect( core(), SIGNAL( doneSync() ), slot );
00170 }
00171 
00172 bool ActionPart::confirmBeforeWriting() const
00173 {
00174     return core()->currentProfile().confirmSync();
00175 }
00176 
00177 #include "actionpart.moc"
KDE Logo
This file is part of the documentation for kitchensync Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 17 09:54:19 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003