kontact

summaryview_part.h

00001 /*
00002    This file is part of KDE Kontact.
00003 
00004    Copyright (C) 2003 Sven Lüppken <sven@kde.org>
00005    Copyright (C) 2003 Tobias König <tokoe@kde.org>
00006    Copyright (C) 2003 Daniel Molkentin <molkentin@kde.org>
00007 
00008    This library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Library General Public
00010    License as published by the Free Software Foundation; either
00011    version 2 of the License, or (at your option) any later version.
00012 
00013    This library is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Library General Public License for more details.
00017 
00018    You should have received a copy of the GNU Library General Public License
00019    along with this library; see the file COPYING.LIB.  If not, write to
00020    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021    Boston, MA 02110-1301, USA.
00022 */
00023 
00024 #ifndef SUMMARYVIEW_PART_H
00025 #define SUMMARYVIEW_PART_H
00026 
00027 #include <qdatetime.h>
00028 #include <qmap.h>
00029 
00030 #include <kparts/part.h>
00031 
00032 #include "core.h"
00033 #include "dropwidget.h"
00034 
00035 namespace Kontact
00036 {
00037   class Plugin;
00038   class Summary;
00039 }
00040 
00041 namespace KParts
00042 {
00043   class PartActivateEvent;
00044 }
00045 
00046 class QFrame;
00047 class QLabel;
00048 class QGridLayout;
00049 class KAction;
00050 class KCMultiDialog;
00051 
00052 class SummaryViewPart : public KParts::ReadOnlyPart
00053 {
00054   Q_OBJECT
00055 
00056   public:
00057     SummaryViewPart( Kontact::Core *core, const char *widgetName,
00058                      const KAboutData *aboutData,
00059                      QObject *parent = 0, const char *name = 0 );
00060     ~SummaryViewPart();
00061 
00062   public slots:
00063     void slotTextChanged();
00064     void slotAdjustPalette();
00065     void setDate( const QDate& newDate );
00066 
00067   signals:
00068     void textChanged( const QString& );
00069 
00070   protected:
00071     virtual bool openFile();
00072     virtual void partActivateEvent( KParts::PartActivateEvent *event );
00073 
00074   protected slots:
00075     void slotConfigure();
00076     void updateSummaries();
00077     void updateWidgets();
00078     void summaryWidgetMoved( QWidget *target, QWidget *widget, int alignment );
00079 
00080   private:
00081     void initGUI( Kontact::Core *core );
00082     void loadLayout();
00083     void saveLayout();
00084     QString widgetName( QWidget* ) const;
00085 
00086     QStringList configModules() const;
00087 
00088     QMap<QString, Kontact::Summary*> mSummaries;
00089     Kontact::Core *mCore;
00090     DropWidget *mFrame;
00091     QFrame *mMainWidget;
00092     QVBoxLayout *mMainLayout;
00093     QVBoxLayout *mLeftColumn;
00094     QVBoxLayout *mRightColumn;
00095     QLabel *mUsernameLabel;
00096     QLabel *mDateLabel;
00097     KAction *mConfigAction;
00098     KAction *mRefreshAction;
00099 
00100     QStringList mLeftColumnSummaries;
00101     QStringList mRightColumnSummaries;
00102 };
00103 
00104 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys