kmmainview.h

00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Library General Public
00007  *  License version 2 as published by the Free Software Foundation.
00008  *
00009  *  This library is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *  Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this library; see the file COPYING.LIB.  If not, write to
00016  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  *  Boston, MA 02110-1301, USA.
00018  **/
00019 
00020 #ifndef KMMAINVIEW_H
00021 #define KMMAINVIEW_H
00022 
00023 #if !defined( _KDEPRINT_COMPILE ) && defined( __GNUC__ )
00024 #warning internal header, do not use except if you are a KDEPrint developer
00025 #endif
00026 
00027 #include <qwidget.h>
00028 #include <kdeprint/kpreloadobject.h>
00029 #include <kmainwindow.h>
00030 
00031 class KMManager;
00032 class KMPrinterView;
00033 class KMPrinter;
00034 class KMPages;
00035 class KActionCollection;
00036 class QPopupMenu;
00037 class QTimer;
00038 class QSplitter;
00039 class KToolBar;
00040 class KAction;
00041 class PluginComboBox;
00042 class QBoxLayout;
00043 class MessageWindow;
00044 class QMenuBar;
00045 
00053 class KDEPRINT_EXPORT KMMainView : public QWidget, public KPReloadObject
00054 {
00055     Q_OBJECT
00056 public:
00057     KMMainView(QWidget *parent = 0, const char *name = 0, KActionCollection *coll = 0);
00058     ~KMMainView();
00059 
00060     void setOrientation(int);
00061     int orientation() const;
00062     void setViewType(int);
00063     int viewType() const;
00064     void enableToolbar(bool on = true);
00065     KAction* action(const char *name);
00066     void showPrinterInfos(bool on);
00067     bool printerInfosShown() const;
00068 
00069 public slots:
00070     void slotTimer();
00071     void slotShowPrinterInfos(bool);
00072     void slotChangePrinterState();
00073     void slotRemove();
00074     void slotConfigure();
00075     void slotAdd();
00076     void slotHardDefault();
00077     void slotSoftDefault();
00078     void slotTest();
00079     void slotServerRestart();
00080     void slotServerConfigure();
00081     void slotManagerConfigure();
00082     void slotAddSpecial();
00083     void slotRefresh();
00084     void slotToolSelected(int);
00085     void slotToggleFilter(bool);
00086     void slotHelp();
00087 
00088 protected slots:
00089     void slotPrinterSelected(const QString&);
00090     void slotRightButtonClicked(const QString&, const QPoint&);
00091     void slotToggleToolBar(bool);
00092     void slotToggleMenuBar(bool);
00093     void slotChangeView(int);
00094     void slotChangeDirection(int);
00095     void slotUpdatePossible( bool );
00096     void slotInit();
00097 
00098 protected:
00099     void initActions();
00100     void showErrorMsg(const QString& msg, bool usemgr = true);
00101     void restoreSettings();
00102     void saveSettings();
00103     void loadParameters();
00104     void reload();
00105     void configChanged();
00106     //void aboutToReload();
00107     void loadPluginActions();
00108     void removePluginActions();
00109     void createMessageWindow( const QString&, int delay = 500 );
00110     void destroyMessageWindow();
00111     void reset( const QString& msg = QString::null, bool useDelay = true, bool holdTimer = true );
00112 
00113 private:
00114     KMPrinterView   *m_printerview;
00115     KMPages     *m_printerpages;
00116     QPopupMenu  *m_pop;
00117     KActionCollection   *m_actions;
00118     KMPrinter   *m_current;
00119     KToolBar    *m_toolbar;
00120     PluginComboBox  *m_plugin;
00121     int     m_pactionsindex;
00122     QStringList m_toollist;
00123     bool        m_first;
00124     QBoxLayout  *m_boxlayout;
00125     class KMainWindowPrivate;
00126     KMainWindowPrivate *d;
00127     KToolBar *m_menubar;
00128 };
00129 
00130 KDEPRINT_EXPORT int kdeprint_management_add_printer_wizard( QWidget* parent );
00131 
00132 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys