kontact

summarywidget.h
00001 /*
00002     This file is part of Kontact.
00003     Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
00004     Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
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, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 
00025 #ifndef SUMMARYWIDGET_H
00026 #define SUMMARYWIDGET_H
00027 
00028 #include "summary.h"
00029 
00030 #include <dcopobject.h>
00031 #include <pilotDaemonDCOP.h>
00032 
00033 #include <tqmap.h>
00034 #include <tqpixmap.h>
00035 #include <tqptrlist.h>
00036 #include <tqstringlist.h>
00037 #include <tqtimer.h>
00038 #include <tqwidget.h>
00039 #include <tqdatetime.h>
00040 
00041 class TQGridLayout;
00042 class TQLabel;
00043 class KURLLabel;
00044 
00045 class SummaryWidget : public Kontact::Summary, public DCOPObject
00046 {
00047   Q_OBJECT
00048   
00049   K_DCOP
00050 
00051   public:
00052     SummaryWidget( TQWidget *parent, const char *name = 0 );
00053     virtual ~SummaryWidget();
00054 
00055     int summaryHeight() const { return 1; }
00056 
00057     TQStringList configModules() const;
00058 
00059   k_dcop:
00060     // all the information is pushed to Kontact by the daemon, to remove the chance of Kontact calling a daemon
00061     // that is blocked for some reason, and blocking itself.
00062     void receiveDaemonStatusDetails( TQDateTime, TQString, TQStringList, TQString, TQString, TQString, bool );
00063   private slots:
00064     void updateView();
00065     void showSyncLog( const TQString &filename );
00066     void startKPilot();
00067     void slotAppRemoved( const TQCString & );
00068   private:
00069     TQTimer mTimer;
00070 
00071     TQLabel*mSyncTimeTextLabel;
00072     TQLabel*mSyncTimeLabel;
00073     KURLLabel*mShowSyncLogLabel;
00074     TQLabel*mPilotUserTextLabel;
00075     TQLabel*mPilotUserLabel;
00076     TQLabel*mPilotDeviceTextLabel;
00077     TQLabel*mPilotDeviceLabel;
00078     TQLabel*mDaemonStatusTextLabel;
00079     TQLabel*mDaemonStatusLabel;
00080     TQLabel*mConduitsTextLabel;
00081     TQLabel*mConduitsLabel;
00082     TQLabel*mNoConnectionLabel;
00083     KURLLabel*mNoConnectionStartLabel;
00084 
00085     TQGridLayout *mLayout;
00086 
00087     TQDateTime mLastSyncTime;
00088     TQString mDaemonStatus;
00089     TQStringList mConduits;
00090     TQString mSyncLog;
00091     TQString mUserName;
00092     TQString mPilotDevice;
00093     bool mDCOPSuccess;
00094 
00095     bool mStartedDaemon; // Record whether the daemon was started by kontact
00096     bool mShouldStopDaemon;
00097 };
00098 
00099 #endif
00100