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 class KToggleAction;
00046 
00054 class KDEPRINT_EXPORT KMMainView : public QWidget, public KPReloadObject
00055 {
00056     Q_OBJECT
00057 public:
00058     KMMainView(QWidget *parent = 0, const char *name = 0, KActionCollection *coll = 0);
00059     ~KMMainView();
00060 
00061     void setOrientation(int);
00062     int orientation() const;
00063     void setViewType(int);
00064     int viewType() const;
00065     void enableToolbar(bool on = true);
00066     KAction* action(const char *name);
00067     void showPrinterInfos(bool on);
00068     bool printerInfosShown() const;
00069 
00070 public slots:
00071     void slotTimer();
00072     void slotShowPrinterInfos(bool);
00073     void slotChangePrinterState();
00074     void slotRemove();
00075     void slotConfigure();
00076     void slotAdd();
00077     void slotHardDefault();
00078     void slotSoftDefault();
00079     void slotTest();
00080     void slotServerRestart();
00081     void slotServerConfigure();
00082     void slotEnableBrowsing();
00083     void slotEnableSharing();
00084     void slotManagerConfigure();
00085     void slotAddSpecial();
00086     void slotRefresh();
00087     void slotToolSelected(int);
00088     void slotToggleFilter(bool);
00089     void slotHelp();
00090 
00091 protected slots:
00092     void slotPrinterSelected(const QString&);
00093     void slotRightButtonClicked(const QString&, const QPoint&);
00094     void slotToggleToolBar(bool);
00095     void slotToggleMenuBar(bool);
00096     void slotChangeView(int);
00097     void slotChangeDirection(int);
00098     void slotUpdatePossible( bool );
00099     void slotInit();
00100 
00101 protected:
00102     void initActions();
00103     void showErrorMsg(const QString& msg, bool usemgr = true);
00104     void restoreSettings();
00105     void saveSettings();
00106     void loadParameters();
00107     void reload();
00108     void configChanged();
00109     //void aboutToReload();
00110     void loadPluginActions();
00111     void removePluginActions();
00112     void createMessageWindow( const QString&, int delay = 500 );
00113     void destroyMessageWindow();
00114     void reset( const QString& msg = QString::null, bool useDelay = true, bool holdTimer = true );
00115 
00116 private:
00117     KMPrinterView   *m_printerview;
00118     KMPages     *m_printerpages;
00119     QPopupMenu  *m_pop;
00120     KActionCollection   *m_actions;
00121     KMPrinter   *m_current;
00122     KToolBar    *m_toolbar;
00123     PluginComboBox  *m_plugin;
00124     int     m_pactionsindex;
00125     QStringList m_toollist;
00126     bool        m_first;
00127     QBoxLayout  *m_boxlayout;
00128     class KMainWindowPrivate;
00129     KMainWindowPrivate *d;
00130     KToolBar *m_menubar;
00131     KToggleAction* enableBrowsing;
00132     KToggleAction* enableSharing;
00133     //check for browsing status and tick/untick enableBrowsing
00134     void setBrowsingStatus();
00135     //check for sharing status and tick/untick enableSharing
00136     void setSharingStatus();
00137 };
00138 
00139 KDEPRINT_EXPORT int kdeprint_management_add_printer_wizard( QWidget* parent );
00140 
00141 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys