kitchensync

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., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, 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::done()
00090 {
00091     m_stat = SYNC_DONE;
00092 }
00093 
00094 void ActionPart::slotConfigOk()
00095 {
00096 }
00097 
00098 void ActionPart::connectPartChange( const char *slot )
00099 {
00100     connect( core(), SIGNAL( partChanged( ActionPart * ) ), slot );
00101 }
00102 
00103 void ActionPart::connectSyncProgress( const char *slot )
00104 {
00105     connect( core(), SIGNAL( syncProgress( ActionPart *, int, int ) ), slot );
00106 }
00107 
00108 void ActionPart::connectProfileChanged( const char *slot )
00109 {
00110     connect( core(), SIGNAL( profileChanged( const Profile & ) ), slot );
00111 }
00112 
00113 void ActionPart::connectKonnectorDownloaded( const char *slot )
00114 {
00115     connect( core(),
00116              SIGNAL( konnectorDownloaded( Konnector *, Syncee::PtrList ) ),
00117              slot );
00118 }
00119 
00120 void ActionPart::connectStartSync( const char *slot )
00121 {
00122     connect( core(), SIGNAL( startSync() ), slot );
00123 }
00124 
00125 void ActionPart::connectDoneSync( const char *slot )
00126 {
00127     connect( core(), SIGNAL( doneSync() ), slot );
00128 }
00129 
00130 bool ActionPart::confirmBeforeWriting() const
00131 {
00132     return core()->currentProfile().confirmSync();
00133 }
00134 
00135 #include "actionpart.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys